|
@@ -89,7 +89,7 @@
|
|
|
<view class="name">{{item.name}}</view>
|
|
|
<view class="priceRight">
|
|
|
<view class="price">¥ {{item.money?item.money:0}}</view>
|
|
|
- <image @click="deleteItem(index)" src="../../static/img/icon_delete.png" mode="" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
|
|
|
+ <image @click="deleteItem(item,index)" src="../../static/img/icon_delete.png" mode="" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -138,8 +138,27 @@
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- deleteItem(index){
|
|
|
- this.selectItemList.splice(index);
|
|
|
+ deleteItem(item,index){
|
|
|
+
|
|
|
+ // 更新数据
|
|
|
+ for (var i = 0; i < this.itemList.length; i++) {
|
|
|
+ let dic = this.itemList[i];
|
|
|
+
|
|
|
+ dic.list.forEach((item2, index) => {
|
|
|
+
|
|
|
+ if (item.id == item2.ID) {
|
|
|
+
|
|
|
+ item2.type = 0;
|
|
|
+ dic.num -= 1;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.selectItemList.splice(index,1);
|
|
|
},
|
|
|
caidanClick() {
|
|
|
this.qingdanShow = !this.qingdanShow
|
|
@@ -168,10 +187,6 @@
|
|
|
|
|
|
let item = this.itemList[this.leftIndex];
|
|
|
|
|
|
- if (this.sumCount) {
|
|
|
- this.sumCount = this.sumCount - item.num;
|
|
|
- }
|
|
|
-
|
|
|
var count = 0;
|
|
|
item.list.forEach((v, index) => {
|
|
|
if (v.type != 0) {
|
|
@@ -208,7 +223,7 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- console.log('selectItemList==', this.selectItemList);
|
|
|
+ // console.log('selectItemList==', this.selectItemList);
|
|
|
|
|
|
},
|
|
|
changeState(item) {
|
|
@@ -243,7 +258,7 @@
|
|
|
}
|
|
|
this.itemList = List;
|
|
|
|
|
|
- console.log('列表=', this.itemList);
|
|
|
+ // console.log('列表=', this.itemList);
|
|
|
|
|
|
})
|
|
|
},
|