fixed bug

This commit is contained in:
cmxdd
2020-08-06 17:02:11 +08:00
parent 6ec2318d0c
commit 71a25fd11d
13 changed files with 55 additions and 62 deletions

View File

@@ -37,10 +37,10 @@
<view class="title"><text>选择商品</text></view>
<!-- 商品列表 -->
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll">
<view class="listes_shoping" v-for="(item, index) in list" :key="index">
<view class="listes_shoping" v-for="(item, index) in list" :key="index" @click="checkboxChange(item.goods_id)">
<view>
<u-checkbox-group>
<u-checkbox @change="checkboxChange" shape="circle" active-color="#FF780F" v-model="item.checked" :name="item.goods_id"></u-checkbox>
<u-checkbox shape="circle" active-color="#FF780F" v-model="item.checked" :disabled="true" ></u-checkbox>
</u-checkbox-group>
</view>
<view><image :src="item.goods_image" mode="widthFix"></image></view>
@@ -270,11 +270,15 @@ export default {
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
let id = e.name;
if (e.value == true) {
this.pushes(id);
} else {
this.delarr(id);
for(let num in this.list){
if(id==this.list[num].goods_id){
if(this.list[num].checked==true){
this.delarr(id);
}else{
this.pushes(id);
}
this.list[num].checked = !this.list[num].checked
}
}
},
// 删除直播商品