瀏覽代碼

商品模块修复BUG

zhengjinyi 4 年之前
父節點
當前提交
e55923e36f

+ 1 - 0
src/main/resources/static/css/product/instruement-list.css

@@ -150,6 +150,7 @@
     .productItem .price .price_text_tag .listTag{margin: 0;float: left}
     .productItem .price .main_price_unde { width: 100%;height: 31px;line-height: 31px;font-size: 14px;color: #4a4f58;text-align: left;float: left;}
     .productItem .price .main_price_show { width: 100%;height: 30px;line-height: 30px;font-size: 14px;color: #f94b4b;text-align: left;float: left;}
+    .productItem .price .main_price_show.none { color: #999999; text-decoration: line-through;}
     .productItem .name .tag{width: 44px;height: 18px;line-height: 18px;font-size: 12px;display: inline-block;margin-right: 5px;text-align: center;color: #FFFFFF !important;background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);border-radius: 0px 10px 0px 0px;}
 
 }

+ 1 - 0
src/main/resources/static/js/base.js

@@ -634,6 +634,7 @@ function setProductPrice(productList, productIds, userId, callback){
                         product.shopId = item.shopId;
                         product.userIdentity = item.userIdentity;
                         product.price = item.price;
+                        product.originalPrice = item.originalPrice;
                         product.priceLoaded = true;
                         product.ladderPriceFlag = item.ladderPriceFlag;
                         product.actStatus =item.actStatus;

+ 10 - 0
src/main/resources/static/js/product/produce-list.js

@@ -132,6 +132,16 @@ var productList = new Vue({
             }
 
         },
+        PromotionsFormat:function(promo){//促销活动类型数据处理
+            if(promo!=null){
+                if(promo.type == 1 && promo.mode == 1){
+                    return true
+                }else{
+                    return false
+                }
+            }
+            return false
+        },
         checkedClasslyFn:function(item,index){
             this.params.pageNum = 1;
             this.params.idType = index;

+ 1 - 1
src/main/resources/templates/index.html

@@ -150,7 +150,7 @@
                                                                     <template th:text="*{promotions.name}"></template>
                                                                     <th:block th:if="*{promotions.type}==1 and *{promotions.mode}==1">
                                                                         <!--单品优惠:优惠价-->
-                                                                        <span class="price_num"></span>
+                                                                        :¥<span class="price_num"></span>
                                                                     </th:block>
                                                                 </p>
                                                             </div>

+ 4 - 2
src/main/resources/templates/product/instruelist.html

@@ -97,10 +97,12 @@
                                            <div class="price_text_tag">
                                                 <p class="listTag" v-if="p.actStatus==1">
                                                     {{p.promotions.name}}
-                                                    <span v-if="p.priceFlag != 1">:¥{{p.promotions.price | NumFormat}}</span>
+                                                    <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
                                                 </p>
                                             </div>
-                                            <div class="main_price_show" v-text="'¥'+parseFloat(p.price).toFixed(2)"></div>
+                                            <div class="main_price_show" :class="PromotionsFormat(p.promotions) ? 'none' : ''">
+                                                ¥{{ (PromotionsFormat(p.promotions) ? p.originalPrice : p.price ) | NumFormat }}
+                                            </div>
                                         </template>
                                         <template v-else-if="p.priceFlag==2 && p.userIdentity==4">
                                              <div class="price_text_tag">

+ 0 - 1
src/main/resources/templates/supplier-center/shop/preview.html

@@ -53,7 +53,6 @@
                     <div class="info price">
                         <span class="label">价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:</span>
                         <p>
-                            <span class="fave-tag">优惠价</span>
                             <span class="fave-text">¥<span class="big">{{toFixedFn(shopInfo.price)}}</span></span>
                             <span class="fave-text-none">¥{{toFixedFn(shopInfo.normalPrice)}}</span>
                         </p>