fixed bug
This commit is contained in:
@@ -46,10 +46,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>
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 获取商品数组变化
|
||||
getshoplist() {
|
||||
getshoplist(id) {
|
||||
let arr = this.arres_list;
|
||||
let newarr = this.list;
|
||||
this.shoplist = [];
|
||||
@@ -246,11 +246,16 @@ export default {
|
||||
},
|
||||
// 选中某个复选框时,由checkbox时触发
|
||||
checkboxChange(e) {
|
||||
let id = e.name;
|
||||
if (e.value == true) {
|
||||
this.pushes(id);
|
||||
} else {
|
||||
this.delarr(id);
|
||||
let id = 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
|
||||
}
|
||||
}
|
||||
},
|
||||
// 删除直播商品
|
||||
@@ -261,7 +266,7 @@ export default {
|
||||
} else {
|
||||
let index = that.arres_list.indexOf(id);
|
||||
that.arres_list.splice(index, 1);
|
||||
that.getshoplist();
|
||||
that.getshoplist(id);
|
||||
}
|
||||
},
|
||||
// 增加直播商品
|
||||
@@ -271,7 +276,7 @@ export default {
|
||||
console.log('为空');
|
||||
} else {
|
||||
that.arres_list.push(id);
|
||||
that.getshoplist();
|
||||
that.getshoplist(id);
|
||||
}
|
||||
},
|
||||
tosign() {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
},
|
||||
// 删除直播商品
|
||||
|
||||
Reference in New Issue
Block a user