Bladeren bron

购物车价格计算bugfix

chao 4 jaren geleden
bovenliggende
commit
b3773acd29
1 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 4 1
      src/main/resources/static/js/shopping/cart.js

+ 4 - 1
src/main/resources/static/js/shopping/cart.js

@@ -161,6 +161,8 @@ var shoppingCart = new Vue({
                         });
                         if(promotionsPrice>=promotions.touchPrice){
                             reducedPrice += promotions.reducedPrice;
+                            totalPrice -= promotions.reducedPrice;
+
                         }
                     } else if (promotions.type===1 && promotions.mode ===1) {
                         promotions.productList.forEach(function(product){
@@ -170,7 +172,7 @@ var shoppingCart = new Vue({
                 });
                 _self.reducedPrice = reducedPrice;
                 _self.originalPrice = originalPrice;
-                _self.totalPrice = totalPrice-reducedPrice;
+                _self.totalPrice = totalPrice;
                 _self.kindCount = kindCount;
                 _self.totalCount = totalCount;
             });
@@ -195,6 +197,7 @@ var shoppingCart = new Vue({
                 cart.ladderPrices.forEach(function(ladder){
                     if(cart.number>=ladder.buyNum){
                         cart.price = ladder.buyPrice;
+                        cart.originalPrice = ladder.buyPrice;
                     }
                 });
             }