|
@@ -252,15 +252,26 @@ var shoppingCart = new Vue({
|
|
|
_self.promotionsList.forEach(function (promotions) {
|
|
|
// 凑单满减
|
|
|
if (promotions.mode * 1 === 2 && promotions.type * 1 === 2) {
|
|
|
- var total = 0;
|
|
|
+ var collecTotal = 0;
|
|
|
+ var collecDiscountNum = 0;
|
|
|
promotions.productList.forEach(function (product) {
|
|
|
if (_self.submitIds.includes(product.productId * 1)) {
|
|
|
total += product.number * product.price;
|
|
|
}
|
|
|
});
|
|
|
- if (total >= promotions.touchPrice) {
|
|
|
- totalPrice -= promotions.reducedPrice;
|
|
|
- reducedPrice += promotions.reducedPrice;
|
|
|
+ if(promotions.discount == 1){// 支持凑单满减促销叠加条件的执行
|
|
|
+ collecDiscountNum += parseInt(collecTotal/promotions.touchPrice) // 凑单满减促销叠加次数 = 凑单商品合计价格/凑单满减促销价格
|
|
|
+ console.log('凑单促销满减叠加通道叠加次数',`${collecDiscountNum}次`)
|
|
|
+ if (collecTotal >= promotions.touchPrice) {
|
|
|
+ totalPrice -= promotions.reducedPrice*collecDiscountNum
|
|
|
+ reducedPrice += promotions.reducedPrice*collecDiscountNum
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ console.log('凑单促销满减非叠加通道')
|
|
|
+ if (collecTotal >= promotions.touchPrice) {
|
|
|
+ totalPrice -= promotions.reducedPrice
|
|
|
+ reducedPrice += promotions.reducedPrice
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|