Parcourir la source

促销活动先选中产品,在修改数量提交订单未保存数量问题

xiaohaizhao il y a 1 an
Parent
commit
5ae0caee15
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      packageA/activity/selectProduct/index.js

+ 4 - 0
packageA/activity/selectProduct/index.js

@@ -297,6 +297,8 @@ Page({
     this.setData({
       [`list[${index}].qty`]: qty
     });
+    let i = this.data.resultList.findIndex(v => v.itemid == item.itemid);
+    if (i !== -1) this.data.resultList[i].qty = qty;
   },
   stepperChange(e) {
     const {
@@ -311,6 +313,8 @@ Page({
     this.setData({
       [`list[${index}]`]: item
     })
+    let i = this.data.resultList.findIndex(v => v.itemid == item.itemid);
+    if (i !== -1) this.data.resultList[i] = item;
   },
   onUnload() {
     //回收数据