lilei 8 miesięcy temu
rodzic
commit
87761be043
2 zmienionych plików z 23 dodań i 23 usunięć
  1. 12 12
      pagesB/cart/index.vue
  2. 11 11
      pagesB/shopiing/productDetail.vue

+ 12 - 12
pagesB/cart/index.vue

@@ -485,18 +485,6 @@
 				// 校验并提示信息
 				purchaseCheck({detailList:detailList}).then(res => {
 					if(res.status == 200){
-						const successList = res.data.successList.map(item => {
-							return {
-								productSn:item.productSn,
-								productCode: item.productCode,
-								qty: item.qty,
-								price:item.price,
-								promoSn: item.promoSn
-							}
-						})
-						const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)
-						const removeList = res.data.removeList.map(item => item.productCode)
-						const selloutList = res.data.selloutList.map(item => item.productCode)
 						const promoChangeFlag = res.data.promoChangeFlag
 						// 活动变更
 						if(promoChangeFlag){
@@ -512,6 +500,18 @@
 							})
 							return
 						}
+						const successList = res.data.successList.map(item => {
+							return {
+								productSn:item.productSn,
+								productCode: item.productCode,
+								qty: item.qty,
+								price:item.price,
+								promoSn: item.promoSn
+							}
+						})
+						const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)
+						const removeList = res.data.removeList.map(item => item.productCode)
+						const selloutList = res.data.selloutList.map(item => item.productCode)
 						console.log(successList,delSn)
 						console.log(removeList,selloutList)
 						// 有已下架或已售罄产品提示

+ 11 - 11
pagesB/shopiing/productDetail.vue

@@ -371,17 +371,6 @@
 						}]}).then(res => {
 							uni.hideLoading()
 							if(res.status == 200){
-								const successList = res.data.successList.map(item => {
-									return {
-										productSn:item.productSn,
-										productCode: item.productCode,
-										qty: item.qty,
-										price:item.price,
-										promoSn: item.promoSn
-									}
-								})
-								const removeList = res.data.removeList.map(item => item.productCode)
-								const selloutList = res.data.selloutList.map(item => item.productCode)
 								const promoChangeFlag = res.data.promoChangeFlag
 								// 活动变更
 								if(promoChangeFlag){
@@ -398,6 +387,17 @@
 									})
 									return
 								}
+								const successList = res.data.successList.map(item => {
+									return {
+										productSn:item.productSn,
+										productCode: item.productCode,
+										qty: item.qty,
+										price:item.price,
+										promoSn: item.promoSn
+									}
+								})
+								const removeList = res.data.removeList.map(item => item.productCode)
+								const selloutList = res.data.selloutList.map(item => item.productCode)
 								// 有已下架或已售罄产品提示
 								if(removeList.length || selloutList.length){
 									uni.showModal({