lilei 8 months ago
parent
commit
9723e42f0b
1 changed files with 20 additions and 20 deletions
  1. 20 20
      pagesB/shopiing/productDetail.vue

+ 20 - 20
pagesB/shopiing/productDetail.vue

@@ -373,23 +373,7 @@
 						}]}).then(res => {
 							uni.hideLoading()
 							if(res.status == 200){
-								const promoChangeFlag = res.data.promoChangeFlag
-								// 活动变更
-								if(promoChangeFlag){
-									uni.showModal({
-										title: '提示',
-										content: '促销活动已变更,请刷新?',
-										confirmText:'确定刷新',
-										success(ret) {
-											if(ret.confirm){
-												_this.showPopu = false
-												_this.refashOk = true
-											}
-										}
-									})
-									return
-								}
-								const successList = res.data.successList.map(item => {
+								const successList = res.data.successList ? res.data.successList.map(item => {
 									return {
 										productSn:item.productSn,
 										productCode: item.productCode,
@@ -397,9 +381,9 @@
 										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 removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
+								const selloutList = res.data.selloutList ? res.data.selloutList.map(item => item.productCode) : []
 								// 有已下架或已售罄产品提示
 								if(removeList.length || selloutList.length){
 									uni.showModal({
@@ -414,6 +398,22 @@
 										}
 									})
 								}else{
+									const promoChangeFlag = res.data.promoChangeFlag
+									// 活动变更
+									if(promoChangeFlag){
+										uni.showModal({
+											title: '提示',
+											content: '促销活动已变更,请刷新?',
+											confirmText:'确定刷新',
+											success(ret) {
+												if(ret.confirm){
+													_this.showPopu = false
+													_this.refashOk = true
+												}
+											}
+										})
+										return
+									}
 									// 直接提交
 									_this.submitForm(successList)
 								}