فهرست منبع

Merge remote-tracking branch 'origin/developerB' into developerB

zhengjinyi 4 سال پیش
والد
کامیت
bbc5c7be2f

+ 1 - 1
src/main/resources/config/dev/application-dev.yml

@@ -52,7 +52,7 @@ logging:
 
 # 服务域名
 caimei:
-  spiServer: http://192.168.2.56:8008
+  spiServer: http://192.168.2.75:8008
   imageDomain: https://img-b.caimei365.com
   wwwDomain: https://www-b.caimei365.com
 

+ 10 - 2
src/main/resources/static/js/shopping/cart.js

@@ -68,6 +68,13 @@ var shoppingCart = new Vue({
             $(el).parents('.priceTag').find('.tag').removeClass("on").siblings('.mFixed').hide();
             if(!isPC){looseBody();}
         },
+        ckeckItem: function(event){
+            var el = event.currentTarget;
+            if(!$(el).prop("checked")){
+                $(el).parents('.supplierItem').find('.supplierTit').find('input.check').prop("checked", false);
+            }
+            this.computedPrice();
+        },
         ckeckSupplier: function(event, supplierChecked){
             var el = event.currentTarget;
             var _self = this;
@@ -157,12 +164,13 @@ var shoppingCart = new Vue({
                     if(promotions.mode ===2){
                         var promotionsPrice = 0;
                         promotions.productList.forEach(function(product){
-                            promotionsPrice += product.number * product.price;
+                            if (_self.submitIds.includes(product.productId*1)){
+                                promotionsPrice += product.number * product.price;
+                            }
                         });
                         if(promotionsPrice>=promotions.touchPrice){
                             reducedPrice += promotions.reducedPrice;
                             totalPrice -= promotions.reducedPrice;
-
                         }
                     } else if (promotions.type===1 && promotions.mode ===1) {
                         promotions.productList.forEach(function(product){

+ 2 - 2
src/main/resources/templates/shopping/cart.html

@@ -83,7 +83,7 @@
                 </div>
                 <div class="cartItem clear"  v-for="cart in supplier.cartList" >
                     <div class="c0">
-                        <input class="check" type="checkbox" name="cartList" :value="cart.productId" v-model="submitIds" @change="computedPrice()">
+                        <input class="check" type="checkbox" name="cartList" :value="cart.productId" v-model="submitIds" @change="ckeckItem($event)">
                     </div>
                     <div class="c1"><a :href="'/product-'+cart.productId+'.html'" target="_blank">
                         <img class="image" :src="cart.image">
@@ -198,7 +198,7 @@
                 <div class="item">商品数量:<em v-text="totalCount"></em></div>
             </div>
             <div class="right mfbt">
-                <div class="item">合计:<em v-text="'¥'+toFloat(totalPrice)"></em><span class="del"><del v-text="'¥'+toFloat(originalPrice)"></del><em>减{{'¥'+toFloat(reducedPrice)}}</em></span></div>
+                <div class="item">合计:<em v-text="'¥'+toFloat(totalPrice)"></em><span v-if="reducedPrice>0" class="del"><del v-text="'¥'+toFloat(originalPrice)"></del><em>减{{'¥'+toFloat(reducedPrice)}}</em></span></div>
                 <a class="submit" href="javascript:void(0);" @click="submitCart()">去结算</a>
             </div>
         </div>