|
|
|
@ -899,9 +899,21 @@ |
|
|
|
if (validPrices.length > 0) { |
|
|
|
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (prices.length > 0) { |
|
|
|
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.selectedGroupRule = {}; |
|
|
|
} |
|
|
|
@ -910,6 +922,12 @@ |
|
|
|
if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) { |
|
|
|
this.selectedGroupRule = item.productGroupBuyPrices[0]; |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.selectedGroupRule = {}; |
|
|
|
} |
|
|
|
@ -922,6 +940,12 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.pintuanGroupPopup.open('bottom') |
|
|
|
}, |
|
|
|
@ -1005,9 +1029,21 @@ |
|
|
|
if (validPrices.length > 0) { |
|
|
|
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (prices.length > 0) { |
|
|
|
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.selectedGroupRule = {}; |
|
|
|
} |
|
|
|
@ -1024,6 +1060,12 @@ |
|
|
|
if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) { |
|
|
|
this.selectedGroupRule = item.productGroupBuyPrices[0]; |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.selectedGroupRule = {}; |
|
|
|
} |
|
|
|
@ -1062,6 +1104,12 @@ |
|
|
|
selectGroupRule(rule) { |
|
|
|
this.selectedGroupRule = rule; |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
submitAddToCart() { |
|
|
|
let specChoices = {}; |
|
|
|
@ -1299,6 +1347,12 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
sliceMsg2(val) { |
|
|
|
var name = '' |
|
|
|
@ -1326,6 +1380,12 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
for(let i = 0;i<this.moreBuyData.length;i++){ |
|
|
|
if(this.moreBuyData[i].id == this.checkMoreBuyIndex){ |
|
|
|
this.moreBuyData[i].quantity = this.vModelValue |
|
|
|
@ -1417,6 +1477,10 @@ |
|
|
|
}, |
|
|
|
selectCoupon(item) { |
|
|
|
this.selectedCoupon = item; |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
this.$refs.couponPopup.close(); |
|
|
|
}, |
|
|
|
openCouponPopup() { |
|
|
|
|