zhengjinyi hace 1 año
padre
commit
c0e59cacee

+ 13 - 7
src/main/resources/static/js/index.js

@@ -17,11 +17,17 @@ var homeData = new Vue({
         quickoperaList: [], // 快捷运营入口列表
     },
     filters: {
-        NumFormat: function(value) {//处理金额
-            return Number(value).toFixed(2);
-        },
+
     },
     methods: {
+        //处理金额
+        filtersFormat(value) {
+            if (value) {
+                return Number(value).toFixed(2)
+            } else {
+                return '0.00'
+            }
+        },
         // 快捷运营列表
         footList(arr) {
             if (!Array.isArray(arr)) return []
@@ -41,15 +47,15 @@ var homeData = new Vue({
             return newArr
         },
         // 是否显示vip标签价格
-        showVipPriceTag: function(pros){
+        showVipPriceTag(pros){
             //非会员
             // if(!GLOBAL_VIP_FLAG === 1) return false;
             // 商品所有机构可见
-            if(pros.priceFlag === 0  && pros.svipProductFlag === 1 ) return true;
+            if(pros.priceFlag === 0  && pros.svipProductFlag === 1 && pros.actStatus !==1 ) return true;
             // 商品价格仅资质机构可见
-            if(pros.priceFlag === 2  && pros.svipProductFlag === 1 && GLOBAL_USER_IDENTITY === 2) return true;
+            if(pros.priceFlag === 2  && pros.svipProductFlag === 1 && GLOBAL_USER_IDENTITY === 2 && pros.actStatus !==1) return true;
             // 商品价格仅医美机构可见
-            if(pros.priceFlag === 3  && pros.svipProductFlag === 1 && GLOBAL_USER_IDENTITY === 2 &&  GLOBAL_CLUB_TYPE === 1) return true;
+            if(pros.priceFlag === 3  && pros.svipProductFlag === 1 && GLOBAL_USER_IDENTITY === 2 &&  GLOBAL_CLUB_TYPE === 1 && pros.actStatus !==1) return true;
             // 其它
             return false;
         },

+ 3 - 3
src/main/resources/static/js/product/detail.js

@@ -325,7 +325,7 @@ var productDetail = new Vue({
                 });
             }
         },
-        getProductPrice: function () {//获取商品价格
+        getProductPrice () {//获取商品价格
             var _self = this;
             if (this.productId === 0) {return;}
             ProductApi.GetProductDdtailsPrice({ userId: GLOBAL_USER_ID,productId: this.productId }, function (response) {
@@ -333,7 +333,7 @@ var productDetail = new Vue({
                     _self.priceObj = response.data;
                     _self.number = response.data.minBuyNumber;
                     _self.addParams.skuId = response.data.skuId;
-                    if (response.data.actStatus == 1) {
+                    if (response.data.actStatus === 1) {
                         _self.promotions = response.data.promotions;
                         _self.promotionsId = response.data.promotions.id;
                     }
@@ -343,7 +343,7 @@ var productDetail = new Vue({
                 }
             });
         },
-        ladderPrice: function () {//获取商品阶梯价格
+        ladderPrice () {//获取商品阶梯价格
             var _self = this;
             if (!this.productId) {
                 return;

+ 1 - 1
src/main/resources/static/js/product/list.js

@@ -81,7 +81,7 @@ var productList = new Vue({
     },
     methods: {
         // 是否显示vip标签价格
-        showVipPriceTag: function(pros){
+        showVipPriceTag(pros){
             //非会员
             // if(!GLOBAL_VIP_FLAG === 1) return false;
             // 商品所有机构可见

+ 41 - 30
src/main/resources/templates/index.html

@@ -67,7 +67,7 @@
             <div class="new-list">
                 <a href="javascript:void(0)" class="new-li" v-for="(list ,index) in newsList" :key="index" @click="hanldDetails(list.id)">
                     <span class="new-icon"></span>
-                    <p>{{ list.title }}</p>
+                    <p v-text="list.title"></p>
                 </a>
             </div>
             <a href="/news.html" class="new-more"> 更多>> </a>
@@ -189,8 +189,8 @@
                     <!--固定楼层-->
                     <div class="section_page section_page_user hot" v-for="(floor,index) in hotListPageFloor">
                         <div class="section_page_title" >
-                            <h1 data-id="0">{{ floor.title }}</h1>
-                            <p>{{ floor.detail }}</p>
+                            <h1 data-id="0" v-text="floor.title"></h1>
+                            <p v-text="floor.detail"></p>
                             <a class="section_page_btn" href="/product/hot.html" target="_blank"></a>
                         </div>
                         <div class="swiper-container-floor hotList mySwiper" id="recommendBox">
@@ -215,20 +215,21 @@
                                                         <div class="svip-tag">
                                                             <div class="svip-icon">SVIP</div>
                                                             <!-- 公开价格 && (个人机构 || 资质机构) && 开通SVIP 可查看价格-->
-                                                            <template v-if="showVipPriceTag(pros.product)">
-                                                                <div class="svip-price">
-                                                                    <span v-html="pros.product && pros.product.svipPriceTag"></span>
-                                                                </div>
+                                                            <template v-else-if="GLOBAL_USER_IDENTITY === 2 ||
+                                                        (pros.product.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) ||
+                                                        (GLOBAL_USER_IDENTITY === 3 && pros.product.shopId==GLOBAL_SHOP_ID) ||
+                                                        GLOBAL_VIP_FLAG === 1">
+                                                                <template v-if="showVipPriceTag(pros.product)">
+                                                                    <div class="svip-price">
+                                                                        <span v-html="pros.product && pros.product.svipPriceTag"></span>
+                                                                    </div>
+                                                                </template>
                                                             </template>
                                                         </div>
                                                     </template>
                                                     <template v-else>
                                                         <p class="listTag" v-if="pros.product.actStatus == 1 && pros.product.promotions">
                                                             <span v-text="pros.product.promotions && pros.product.promotions.name"></span>
-                                                            <template v-if="PromotionsFormat(pros.product.promotions)">
-                                                                <!--单品优惠:优惠价-->
-                                                                <span class="price_unit">:¥</span><span class="price_num">{{ pros.product.price | NumFormat }}</span>
-                                                            </template>
                                                         </p>
                                                     </template>
                                                 </div>
@@ -246,16 +247,21 @@
                                                         <em class="price_grade_club red"><span>¥</span>仅医美机构可见</em>
                                                     </template>
                                                     <!-- 资质机构 || (价格全部机构可见 && 普通机构) || (供应商 && 商品为供应商下的商品) || 超级会员用户 -->
-                                                    <template v-else-if="GLOBAL_USER_IDENTITY === 2 || (pros.product.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) || (GLOBAL_USER_IDENTITY === 3 && pros.shopID==GLOBAL_SHOP_ID) || GLOBAL_VIP_FLAG === 1">
+                                                    <template v-else-if="GLOBAL_USER_IDENTITY === 2 ||
+                                                        (pros.product.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) ||
+                                                        (GLOBAL_USER_IDENTITY === 3 && pros.product.shopId==GLOBAL_SHOP_ID) ||
+                                                        GLOBAL_VIP_FLAG === 1">
                                                         <div class="main_price_show" :class="{none: showVipPriceTag(pros.product) || PromotionsFormat(pros.product.promotions)}">
-                                                            ¥<span class="price_num" v-if="showVipPriceTag(pros.product)">{{ pros.product.originalPrice | NumFormat }}</span>
-                                                            <span class="price_num" v-else>{{ pros.product.price | NumFormat }}</span>
+                                                            ¥
+                                                            <span class="price_num" v-if="showVipPriceTag(pros.product) || PromotionsFormat(pros.product.promotions)" v-text="filtersFormat(pros.product.originalPrice)"></span>
+                                                            <span class="price_num" v-else v-text="filtersFormat(pros.product.price)"></span>
                                                         </div>
                                                     </template>
                                                     <template v-else>
                                                         <!--供应商除自己的商品外,也显示价格等级-->
                                                         <em class="price_grade_shop">
-                                                            <span class="bold">¥</span><i :class="'icon mIcon price_grade_'+pros.product.priceGrade"></i>
+                                                            <span class="bold">¥</span>
+                                                            <i :class="'icon mIcon price_grade_'+pros.product.priceGrade"></i>
                                                         </em>
                                                     </template>
                                                 </div>
@@ -266,7 +272,7 @@
                                                     <div class="price_text_tag"></div>
                                                     <div v-if="pros.product.detailTalkFlag==2" class="main_price_show">¥价格祥聊</div>
                                                     <div v-else class="main_price_show">
-                                                        ¥<span class="price_num">{{ pros.product.price | NumFormat }}</span>
+                                                        ¥<span class="price_num" v-text="filtersFormat(pros.product.price)"></span>
                                                     </div>
                                                 </div>
                                             </template>
@@ -281,8 +287,8 @@
                     <div class="section_page section_page_user" v-for="(floor,index) in homePageFloor">
                         <template v-if="floor.floorContent">
                             <div class="section_page_title" >
-                                <h1 :data-id="index+1">{{ floor.title }}</h1>
-                                <p>{{ floor.detail }}</p>
+                                <h1 :data-id="index+1" v-text="floor.title"></h1>
+                                <p v-text="floor.detail"></p>
                             </div>
                             <div :class="floor.floorContent.templateType == 8 ? 'swiper-container-floor mySwiperSlide' : ''"
                                  :id="floor.floorContent.templateType == 8 ? 'recommendBox' : ''"
@@ -348,20 +354,21 @@
                                                             <div class="svip-tag">
                                                                 <div class="svip-icon">SVIP</div>
                                                                 <!-- 公开价格 && (个人机构 || 资质机构) && 开通SVIP 可查看价格-->
-                                                                <template v-if="showVipPriceTag(pros.product)">
-                                                                    <div class="svip-price">
-                                                                        <span v-html="pros.product.svipPriceTag"></span>
-                                                                    </div>
+                                                                <template v-else-if="GLOBAL_USER_IDENTITY === 2 ||
+                                                        (pros.product.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) ||
+                                                        (GLOBAL_USER_IDENTITY === 3 && pros.product.shopId==GLOBAL_SHOP_ID) ||
+                                                        GLOBAL_VIP_FLAG === 1">
+                                                                    <template v-if="showVipPriceTag(pros.product)">
+                                                                        <div class="svip-price">
+                                                                            <span v-html="pros.product.svipPriceTag"></span>
+                                                                        </div>
+                                                                    </template>
                                                                 </template>
                                                             </div>
                                                         </template>
                                                         <template v-else>
                                                             <p class="listTag" v-if="pros.product.actStatus ==1 && pros.product.promotions">
                                                                 <span v-text="pros.product.promotions.name"></span>
-                                                                <template v-if="PromotionsFormat(pros.product.promotions)">
-                                                                    <!--单品优惠:优惠价-->
-                                                                    <span class="price_unit">:¥</span><span class="price_num">{{ pros.product.price | NumFormat }}</span>
-                                                                </template>
                                                             </p>
                                                         </template>
                                                     </div>
@@ -379,10 +386,14 @@
                                                             <em class="price_grade_club red"><span>¥</span>仅医美机构可见</em>
                                                         </template>
                                                         <!-- 资质机构 || (价格全部机构可见 && 普通机构) || (供应商 && 商品为供应商下的商品) || 超级会员用户 -->
-                                                        <template v-else-if="GLOBAL_USER_IDENTITY === 2 || (pros.product.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) || (GLOBAL_USER_IDENTITY === 3 && pros.product.shopID==GLOBAL_SHOP_ID) || GLOBAL_VIP_FLAG === 1">
+                                                        <template v-else-if="GLOBAL_USER_IDENTITY === 2 ||
+                                                        (pros.product.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) ||
+                                                        (GLOBAL_USER_IDENTITY === 3 && pros.product.shopId==GLOBAL_SHOP_ID) ||
+                                                        GLOBAL_VIP_FLAG === 1">
                                                             <div class="main_price_show" :class="{none: showVipPriceTag(pros.product) || PromotionsFormat(pros.product.promotions)}">
-                                                                ¥<span class="price_num" v-if="showVipPriceTag(pros.product)">{{ pros.product.originalPrice | NumFormat }}</span>
-                                                                <span class="price_num" v-else>{{ pros.product.price | NumFormat }}</span>
+                                                                ¥
+                                                                <span class="price_num" v-if="showVipPriceTag(pros.product) || PromotionsFormat(pros.product.promotions)" v-text="filtersFormat(pros.product.originalPrice)"></span>
+                                                                <span class="price_num" v-else v-text="filtersFormat(pros.product.price)"></span>
                                                             </div>
                                                         </template>
                                                         <template v-else>
@@ -399,7 +410,7 @@
                                                         <div class="price_text_tag"></div>
                                                         <div v-if="pros.product.detailTalkFlag==2" class="main_price_show">¥价格祥聊</div>
                                                         <div v-else class="main_price_show">
-                                                            ¥<span class="price_num">{{ pros.product.price | NumFormat }}</span>
+                                                            ¥<span class="price_num" v-text="filtersFormat(pros.product.price)"></span>
                                                         </div>
                                                     </div>
                                                 </template>

+ 8 - 3
src/main/resources/templates/product/detail.html

@@ -98,9 +98,14 @@
                             <div class="svip-tag" v-if="priceObj.svipProductFlag == 1">
                                 <div class="svip-icon">SVIP</div>
                                 <!-- !价格未公开 && ((个人机构 + SVIP) || 资质机构 ) 可查看价格 -->
-                                <div class="svip-price" v-if="showVipPriceTag(priceObj)">
-                                    <span v-html="priceObj.svipPriceTag"></span>
-                                </div>
+                                <template v-else-if="GLOBAL_USER_IDENTITY === 2 ||
+                                (priceObj.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) ||
+                                (GLOBAL_USER_IDENTITY === 3 && priceObj.shopId==GLOBAL_SHOP_ID) ||
+                                GLOBAL_VIP_FLAG === 1">
+                                    <div class="svip-price" v-if="showVipPriceTag(priceObj)">
+                                        <span v-html="priceObj.svipPriceTag"></span>
+                                    </div>
+                                </template>
                             </div>
                         </template>
                         <!--未登录-->