|
|
@@ -294,7 +294,7 @@ export default {
|
|
|
self.shopList = []
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
},
|
|
|
logout(){
|
|
|
let that = this
|
|
|
@@ -326,21 +326,35 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
selectItemChange(item){
|
|
|
- this.selectItem = {
|
|
|
- ...item,
|
|
|
- currentUnit:item.bigUnit,
|
|
|
- currentUnitPrice:item.property==1?item.bigPrice:item.price,
|
|
|
- currentNum: 1,
|
|
|
- unitType: 0
|
|
|
- }
|
|
|
+
|
|
|
+ let obj = this.shopList.find(i=>i.id===item.id)
|
|
|
+ if(this.$util.isEmpty(obj)) {
|
|
|
+ this.selectItem = {
|
|
|
+ ...item,
|
|
|
+ currentUnit:item.bigUnit,
|
|
|
+ currentUnitPrice:item.property==1?item.bigPrice:item.price,
|
|
|
+ currentNum: 1,
|
|
|
+ unitType: 0
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.selectItem = obj
|
|
|
+ }
|
|
|
this.isShowFllowNum = true
|
|
|
},
|
|
|
enterReturn(item){
|
|
|
this.isShowFllowNum = false
|
|
|
- this.shopList.push(item)
|
|
|
+ let index = this.shopList.findIndex(i=>i.id===item.id)
|
|
|
+ console.log(1111,index)
|
|
|
+ console.log(item)
|
|
|
+ if(index >= 0) {
|
|
|
+ this.shopList.splice(index,1,item)
|
|
|
+ }else{
|
|
|
+ this.shopList.push(item)
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
collectMoneyBack(price){
|
|
|
console.log(price)
|