Procházet zdrojové kódy

点击商品名称与价格,已经在商品列表中时可以对数量累加

shizhongqi před 3 měsíci
rodič
revize
7c855d0de7

+ 2 - 0
ghsPad/src/pages/home/components/rightItem.vue

@@ -196,6 +196,8 @@ export default {
             const hasItem = this.selectList.find(item => Number(item.id) == Number(info.id) && Number(item.property) == Number(property))
             this.$util.hitVoice()
             if(hasItem){
+                const currentNum = Number(hasItem.currentNum) || 0
+                this.replaceItemFn({ ...hasItem, currentNum: currentNum + 1 })
                 return
             }
             const unitName = property == 1 ? (info.bigUnit || info.unitName || '扎') : '份'

+ 2 - 0
hdPad/src/pages/home/components/rightItem.vue

@@ -191,6 +191,8 @@ export default {
             const hasItem = this.selectList.find(item => Number(item.id) == Number(info.id) && Number(item.property) == Number(property))
             this.$util.hitVoice()
             if(hasItem){
+                const currentNum = Number(hasItem.currentNum) || 0
+                this.replaceItemFn({ ...hasItem, currentNum: currentNum + 1 })
                 return
             }
             const unitName = property == 1 ? (info.bigUnit || info.unitName || '扎') : '份'