Bladeren bron

用户行为记录

zhengjinyi 2 jaren geleden
bovenliggende
commit
b392ed03e9
2 gewijzigde bestanden met toevoegingen van 26 en 3 verwijderingen
  1. 24 1
      pages/seller/cart/components/cm-unit-popup.vue
  2. 2 2
      services/config.env.js

+ 24 - 1
pages/seller/cart/components/cm-unit-popup.vue

@@ -147,7 +147,8 @@ export default {
 				productCount: 1,
 				type: 1
 			},
-			isBtnDisabled: false
+			isBtnDisabled: false,
+			ladderPriceList:[]
 		}
 	},
 	filters: {
@@ -174,6 +175,10 @@ export default {
 			this.addParams.skuId = this.skuList[0].skuId
 			this.addParams.clubId = clubInfo.clubId ? clubInfo.clubId : 0
 			this.addParams.serviceProviderId = userInfo.serviceProviderId
+			if(this.skuList[0].ladderPriceList){
+				this.isShowLadder = true 
+				this.ladderPriceList = this.skuList[0].ladderPriceList
+			}
 		},
 		PromotionsFormat(promo) {
 			//促销活动类型数据处理
@@ -197,6 +202,7 @@ export default {
 			} else {
 				this.productCount++
 			}
+			this.totalLadderPrice()
 		},
 		//popup弹窗数量减按钮
 		changeCountSub() {
@@ -211,6 +217,7 @@ export default {
 				} else {
 					this.productCount--
 				}
+				this.totalLadderPrice()
 				this.isQuantity = false
 			}
 		},
@@ -229,6 +236,18 @@ export default {
 			} else {
 				this.productCount = e.detail.value
 			}
+			this.totalLadderPrice()
+		},
+		totalLadderPrice() {
+			//单独处理活动价格和阶梯价格
+			if(this.ladderPriceList.length>0){
+				this.ladderPriceList.forEach((ladder, index) => {
+					if (this.productCount >= ladder.buyNum) {
+						this.skuProduct.price = ladder.buyPrice
+					}
+				})
+			}
+			console.log('22222222',this.skuProduct.price)
 		},
 		handleBuyConfirm() {
 			this.addParams.productCount = this.productCount
@@ -256,6 +275,10 @@ export default {
 			this.skuProduct.price = sku.price
 			this.skuProduct.originalPrice = sku.originalPrice
 			this.isBtnDisabled = sku.stock === 0
+			if(sku.ladderPriceList.length>0){
+				this.ladderPriceList = sku.ladderPriceList
+			}
+			console.log('1111111111111',this.ladderPriceList)
 			this.$emit('skuClick', sku)
 		},
 		hidePopup() {

+ 2 - 2
services/config.env.js

@@ -4,8 +4,8 @@ if(process.env.NODE_ENV === 'development'){
     // URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
     // URL_CONFIG = 'http://192.168.2.68:18002'	 //涛涛联调地址
     // URL_CONFIG = 'http://192.168.2.17:18002' //志国联调地址
-    URL_CONFIG = 'https://core-b.caimei365.com'
-    // URL_CONFIG = 'https://core.caimei365.com'  
+    // URL_CONFIG = 'https://core-b.caimei365.com'
+    URL_CONFIG = 'https://core.caimei365.com'  
 }else{
     // 生产环境
     // URL_CONFIG = 'https://core-b.caimei365.com'