Commit 9aac71ca authored by xieyishang's avatar xieyishang

sss~

parent 37f78d96
......@@ -4,7 +4,7 @@
<view class="yiCheckbox_body flex flex-wrap">
<!-- v-for="(value,index) in chinddata.spec_item" -->
<!-- :class="{'cur': rSelect.indexOf(index)!=-1}" -->
<view class="chindboxitem" :class="{'cur': item.ischild}" v-for="(item, index1) in chinddata.spec_item" :key="index1" @tap="tapInfo(item,index1)">
<view class="chindboxitem" :class="{'cur': chindisarr[index1]==true}" v-for="(item, index1) in chinddata.spec_item" :key="index1" @tap="tapInfo(item,index1)">
<!-- {{value.name}} -->
{{ item.name }}
</view>
......@@ -35,9 +35,13 @@
{name:"石霸天"},
{name:"石1天"}
],
myischildlist:[],//存储选中的状态
}
//myischildlist:[],//存储选中的状态
//这里坑了 先这样写 赶时间
chindisarr:[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false]
}
},
computed:{
},
methods:{
tapInfo(item,index) {
......@@ -45,26 +49,33 @@
console.info(item,index);
if (item.ischild == false) {//没选 就选
if (this.chindisarr[index] == false) {//没选 就选
//console.log(e)//打印下标
this.rSelect.push(item);//选中添加到数组里
this.isdataarr.push(item);//选中的数据 真实的 {name:this.chinddata.spec_item[key],id:key}
let chinddata = this.chinddata;
chinddata.spec_item[index].ischild = true;
// let chinddata = this.chinddata;
// chinddata.spec_item[index].ischild = true;
//this.chindisarr[index] = true;
this.$set(this.chindisarr, index, true);
this.$emit("changeSpecList",{data:chinddata,index:this.isindex,specList_item_id:this.chinddata.id});
//this.$emit("changeSpecList",{data:chinddata,index:this.isindex,specList_item_id:this.chinddata.id});
} else {
this.rSelect.splice(index, 1); //取消
this.isdataarr.splice(index, 1);
let chinddata = this.chinddata;
chinddata.spec_item[index].ischild = false;
this.$emit("changeSpecList",{data:chinddata,index:this.isindex,specList_item_id:this.chinddata.id});
//this.chindisarr[index] = false;
this.$set(this.chindisarr, index, false);
// let chinddata = this.chinddata;
// chinddata.spec_item[index].ischild = false;
// this.$emit("changeSpecList",{data:chinddata,index:this.isindex,specList_item_id:this.chinddata.id});
}
console.info("isindex",this.isindex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment