fixed bug adout shop

This commit is contained in:
cmxdd
2020-08-10 20:24:58 +08:00
parent e223fd5ff9
commit 9fac4e8a2e
11 changed files with 129 additions and 79 deletions

View File

@@ -37,10 +37,17 @@
<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" @click="checkboxChange(item.goods_id)">
<view class="listes_shoping" v-for="(item, index) in list" :key="index">
<view>
<u-checkbox-group>
<u-checkbox shape="circle" active-color="#FF780F" v-model="item.checked" :disabled="true" ></u-checkbox>
<u-checkbox
shape="circle"
size="40"
active-color="#FF780F"
v-model="item.checked"
:name="index"
@change="checkboxChange"
></u-checkbox>
</u-checkbox-group>
</view>
<view><image :src="item.goods_image" mode="widthFix"></image></view>
@@ -275,15 +282,14 @@ export default {
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
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
}
let that = this;
let num =Number(e.name)
if (e.value == true) {
that.delarr(that.list[num].goods_id);
that.list[num].checked=true
} else {
that.pushes(that.list[num].goods_id);
that.list[num].checked=false
}
},
// 删除直播商品