Browse Source

单品促销-优惠价活动,前端标签展示逻辑优化

yuwenjun1997 2 years ago
parent
commit
e4f86e5a89

+ 3 - 1
components/cm-module/pageTemplate/templateTags.vue

@@ -38,7 +38,9 @@
 		<!-- 个人机构 -->
 		<template v-else-if="userIdentity === 4">
 			<template v-if="goods.actStatus == 1">
-				<view class="floor-tags" v-if="PromotionsFormat(goods.promotions)"> {{ goods.promotions.name }} </view>
+				<view class="floor-tags" v-if="PromotionsFormat(goods.promotions)"> 
+                    {{ goods.promotions.name }} <text v-if="goods.priceFlag != 1">:¥{{ goods.price | NumFormat }}</text>
+                </view>
 				<view class="floor-tags" v-else>{{ goods.promotions.name }}</view>
 			</template>
 			<template v-if="goods.svipProductFlag == 1">

+ 4 - 4
pages/goods/components/cm-price.vue

@@ -48,7 +48,7 @@
 								{{ product.promotions.name
 								}}<text v-if="hasLogin"
 									>:¥{{
-										product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat
+										product.promotions == null ? '0.00' : product.price | NumFormat
 									}}</text
 								>
 							</view>
@@ -90,7 +90,7 @@
 								{{ product.promotions.name
 								}}<text v-if="hasLogin && product.priceFlag != 1"
 									>:¥{{
-										product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat
+										product.promotions == null ? '0.00' : product.price | NumFormat
 									}}</text
 								>
 							</view>
@@ -136,7 +136,7 @@
 									{{ product.promotions.name
 									}}<text v-if="hasLogin && product.priceFlag != 1"
 										>:¥{{
-											product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat
+											product.promotions == null ? '0.00' : product.price | NumFormat
 										}}</text
 									>
 								</view>
@@ -198,7 +198,7 @@
 									{{ product.promotions.name
 									}}<text v-if="hasLogin && product.priceFlag != 1"
 										>:¥{{
-											product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat
+											product.promotions == null ? '0.00' : product.price | NumFormat
 										}}</text
 									>
 								</view>

+ 1 - 1
pages/goods/goods-classify.vue

@@ -152,7 +152,7 @@
 												v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
 											>
 												{{ pros.promotions.name }}
-												<text v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
+												<text v-if="hasLogin && ((userIdentity === 4 && pros.priceFlag === 0) || (userIdentity === 2 && pros.priceFlag !== 1))"
 													>:¥{{ pros.price | NumFormat }}</text
 												>
 											</view>

+ 7 - 4
pages/goods/product.vue

@@ -116,7 +116,7 @@
 										:scaleMultiple="0.82"
 										originRight
 									>
-										{{ current + 1 }}/{{ productImage.length }}
+										{{ current + 1 }}/{{ productImage && productImage.length }}
 									</tui-tag>
 								</view>
 							</uni-swiper-dot>
@@ -143,7 +143,7 @@
 										<view class="">分享</view>
 									</button>
 								</view>
-								<view class="wrap-label" v-if="product.tagsList.length > 0">
+								<view class="wrap-label" v-if="product.tagsList && product.tagsList.length > 0">
 									<view
 										class="label-a tui-skeleton-fillet"
 										v-for="(label, index) in product.tagsList"
@@ -566,7 +566,7 @@
 			:btnType="btnType"
 			:goodsData="goodsData"
 			@buyConfirm="handleBuyConfirm"
-			@skuClick="handleSkuClick"
+			@skuClick="handleSkuClick" 
 		></cm-unit-popup>
 		<!-- 弹窗提示 -->
 		<tui-modal
@@ -843,7 +843,10 @@ export default {
 					this.productImage = []
 					this.shop = response.data.shop
 					this.shopId = response.data.shopId
-					this.product = this.skuProduct = response.data
+                    const dataStr = JSON.stringify(response.data)
+					this.product = JSON.parse(dataStr)
+                    this.skuProduct = JSON.parse(dataStr)
+                    console.log('is same obj',this.product === this.skuProduct)
 					this.skusCount = this.product.skus.length
 					this.addParams.skuId = this.product.skuId
 					if (this.product.tinyTypeName) {

+ 1 - 1
pages/search/search.vue

@@ -271,7 +271,7 @@
                                             v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
                                         >
                                             {{ pros.promotions.name }}
-                                            <text v-if="pros.priceFlag != 1 && hasLogin && userIdentity == 2">
+                                            <text v-if="hasLogin && ((userIdentity === 4 && pros.priceFlag === 0) || (userIdentity === 2 && pros.priceFlag !== 1))">
                                                 :¥{{ pros.price | NumFormat }}
                                             </text>
                                         </view>

+ 1 - 3
pages/user/collection/collection.vue

@@ -81,9 +81,7 @@
 														v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
 													>
 														{{ pros.promotions.name }}
-														<text v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
-															>:¥{{ pros.price | NumFormat }}</text
-														>
+														<text>:¥{{ pros.price | NumFormat }}</text>
 													</view>
 													<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
 												</template>