Browse Source

针对个人机构超级会员权限的修改

zhengjinyi 3 years ago
parent
commit
fdfbbce94d

+ 64 - 29
components/cm-module/listTemplate/productList.vue

@@ -25,37 +25,70 @@
 						<text class="list-details-miniQuantity"
 							>起订量:{{ item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber }}</text
 						>
-						<view class="list-details-price" v-if="item.priceFlag == 1">
-							<view class="list-none"><view class="price-small">¥未公开价格</view></view>
-						</view>
-						<view class="list-details-price" v-else-if="item.priceFlag == 2">
-							<view class="list-none"><view class="price-small">¥价格仅会员可见</view></view>
-						</view>
-						<view class="list-details-price" v-else-if="item.priceFlag == 3 && (firstClubType!=1)">
-							<view class="list-none"><view class="price-small">¥仅医美机构可见</view></view>
-						</view>
-						<view class="list-details-price" v-else>
-							<view class="list-shop">
-								<view class="list-price-none" v-if="item.repurchaseFlag == 1">
-									<text class="price-none">¥{{ item.originalPrice }}</text>
-									<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
+						<template v-if="item.priceFlag == 1">
+							<view class="list-details-price">
+								<view class="list-none"><view class="price-small">¥未公开价格</view></view>
+							</view>
+						</template>
+						<template v-else>
+							<template v-if="userIdentity == 4 && vipFlag != 1">
+								<view class="list-details-price" v-if="item.priceFlag == 2">
+									<view class="list-none"><view class="price-small">¥价格仅会员可见</view></view>
 								</view>
-								<view class="list-price" v-else>
-									<text
-										class="price-larger"
-										:class="
-											PromotionsFormat(item.promotions) || item.svipProductFlag == 1 ? 'none' : ''
-										"
-									>
-										¥{{
-											(PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
-												| NumFormat
-										}}
-									</text>
+								<view class="list-details-price" v-else-if="item.priceFlag == 3 && (firstClubType!=1)">
+									<view class="list-none"><view class="price-small">¥仅医美机构可见</view></view>
 								</view>
-							</view>
-							<button class="add-cart-btn" @click.stop="operationHanld(item)">数量</button>
-						</view>
+								<view class="list-details-price" v-else>
+									<view class="list-shop">
+										<view class="list-price-none" v-if="item.repurchaseFlag == 1">
+											<text class="price-none">¥{{ item.originalPrice }}</text>
+											<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
+										</view>
+										<view class="list-price" v-else>
+											<text
+												class="price-larger"
+												:class="
+													PromotionsFormat(item.promotions) || item.svipProductFlag == 1 ? 'none' : ''
+												"
+											>
+												¥{{
+													(PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
+														| NumFormat
+												}}
+											</text>
+										</view>
+									</view>
+									<button class="add-cart-btn" @click.stop="operationHanld(item)">数量</button>
+								</view>
+							</template>
+							<template v-if="userIdentity == 2 || (userIdentity == 4 && vipFlag == 1)">
+								<view class="list-details-price" v-if="item.priceFlag == 3 && (firstClubType!=1)">
+									<view class="list-none"><view class="price-small">¥仅医美机构可见</view></view>
+								</view>
+								<view class="list-details-price" v-else>
+									<view class="list-shop">
+										<view class="list-price-none" v-if="item.repurchaseFlag == 1">
+											<text class="price-none">¥{{ item.originalPrice }}</text>
+											<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
+										</view>
+										<view class="list-price" v-else>
+											<text
+												class="price-larger"
+												:class="
+													PromotionsFormat(item.promotions) || item.svipProductFlag == 1 ? 'none' : ''
+												"
+											>
+												¥{{
+													(PromotionsFormat(item.promotions) ? item.originalPrice : item.price)
+														| NumFormat
+												}}
+											</text>
+										</view>
+									</view>
+									<button class="add-cart-btn" @click.stop="operationHanld(item)">数量</button>
+								</view>
+							</template>
+						</template>
 						<view class="list-details-price">
 							<view class="floor-item-act">
 								<view class="coupon-tags" v-if="item.couponsLogo">优惠券</view>
@@ -150,6 +183,7 @@ export default {
 			cartQuantity: 0,
 			showRegularBtn: false,
 			isPrecedence: false,
+			userIdentity:0,
 			vipFlag:0,
 			firstClubType:0
 		}
@@ -173,6 +207,7 @@ export default {
 			const userInfo = await this.$api.getStorage()
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			this.userId = userInfo.userId ? userInfo.userId : 0
+			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
 			this.firstClubType = this.clubType
 			this.getProductAgainInfo()
 			this.GetUserCartNumber()

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

@@ -36,7 +36,7 @@
 									<text class="p sm">¥</text> <text class="p big">{{ item.price | NumFormat }}</text>
 								</view>
 							</template>
-							<template v-if="userIdentity == 4">
+							<template v-if="userIdentity == 4 && vipFlag != 1">
 								<view class="price" v-if="item.priceFlag == 1">
 									<text class="p sm">¥</text> <text class="p big">未公开价格</text>
 								</view>

+ 3 - 3
pages/goods/goods-supporting.vue

@@ -8,7 +8,7 @@
 						class="empty-container-image"
 						:src="StaticUrl + '/icon/icon-collection-empty@2x.png'"
 					></image>
-					<text class="error-text">暂无收藏商品~</text>
+					<text class="error-text">暂无配套商品~</text>
 				</view>
 				<!-- 列表 -->
 				<view class="tui-cart-cell  tui-mtop" v-for="(pros, index) in productList" :key="index">
@@ -34,7 +34,7 @@
 									>规格:{{ pros.unit != null ? pros.unit : '' }}</text
 								>
 								<template v-if="hasLogin">
-									<template v-if="userIdentity == 4">
+									<template v-if="userIdentity == 4 && vipFlag != 1">
 										<view class="list-details-price" v-if="pros.priceFlag == 1">
 											<view class="list-none"><view class="price-small">¥未公开价格</view></view>
 										</view>
@@ -130,7 +130,7 @@
 										<view class="list-details-price" v-if="pros.priceFlag == 1">
 											<view class="list-none"><view class="price-small">¥未公开价格</view></view>
 										</view>
-										<view class="list-details-price" v-else-if="pros.priceFlag == 3 && (firstClubType!=1)">
+										<view class="list-details-price" v-else-if="pros.priceFlag == 3 && firstClubType!=1">
 											<view class="list-none"><view class="price-small">¥仅医美机构可见</view></view>
 										</view>
 										<template v-else>

+ 4 - 4
pages/supplier/user/my-shop.vue

@@ -153,7 +153,7 @@
 										</view>
 									</template>
 								</template>
-								<template v-else-if="userIdentity === 4">
+								<template v-else-if="userIdentity === 4 && vipFlag !=1">
 									<view class="title-none" v-if="prop.priceFlag === 1">
 										<text class="p big">¥未公开价格</text>
 									</view>
@@ -175,7 +175,7 @@
 										}}</text>
 									</view>
 								</template>
-								<template v-else-if="userIdentity === 2">
+								<template v-else-if="userIdentity === 2 || (userIdentity == 4 && vipFlag == 1)">
 									<view class="title-none" v-if="prop.priceFlag === 1">
 										<text class="p big">¥未公开价格</text>
 									</view>
@@ -326,7 +326,7 @@
 										</view>
 									</template>
 								</template>
-								<template v-else-if="userIdentity === 4">
+								<template v-else-if="userIdentity === 4 && vipFlag != 1">
 									<view class="title-none" v-if="prop.priceFlag === 1">
 										<text class="p big">¥未公开价格</text>
 									</view>
@@ -348,7 +348,7 @@
 										}}</text>
 									</view>
 								</template>
-								<template v-else-if="userIdentity === 2">
+								<template v-else-if="userIdentity === 2 || (userIdentity == 4 && vipFlag == 1)">
 									<view class="title-none" v-if="prop.priceFlag === 1">
 										<text class="p big">¥未公开价格</text>
 									</view>

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

@@ -42,7 +42,7 @@
 							>
 								<text class="list-details-title">{{ pros.name }}</text>
 								<text class="list-details-specs">规格:{{ pros.unit != null ? pros.unit : '' }}</text>
-								<template v-if="userIdentity == 4">
+								<template v-if="userIdentity == 4 && vipFlag != 1">
 									<view class="list-details-price" v-if="pros.priceFlag == 1">
 										<view class="list-none"><view class="price-small">¥未公开价格</view></view>
 									</view>

+ 51 - 16
pages/user/member/member-product.vue

@@ -25,19 +25,37 @@
 								</template>
 								<template v-if="pro.svipProductFlag == 1">
 									<view class="svip-tags">
-										<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
+										<view class="tags" :class="{ none: !isShowVipFlag }">SVIP</view>
 										<view class="price" v-if="isShowVipFlag(pro)">{{ pro.svipPriceTag }}</view>
 									</view>
 								</template>
 							</view>
 						</view>
 						<view class="product-price" v-if="hasLogin">
+							<!-- 价格未公开 -->
 							<view class="list-none" v-if="pro.priceFlag == 1">¥未公开价格</view>
+							<!-- 价格公开 -->
 							<template v-else>
-								<view class="list-none" v-if="pro.priceFlag == 2 && ( userIdentity == 4 && vipFlag != 1)"
-									>¥价格仅会员可见</view
-								>
-								<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
+								<!-- 个人机构且不是超级会员 -->
+								<template v-if="userIdentity == 4 && vipFlag != 1">
+									<!-- 价格仅会员可见 -->
+									<view class="list-none" v-if="pro.priceFlag == 2"
+										>¥价格仅会员可见</view
+									>
+									<!-- 价格仅医美机构可见 -->
+									<view class="list-none" v-else-if="pro.priceFlag == 3"
+										>¥仅医美机构可见</view
+									>
+									<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
+								</template>
+								<!-- 资质机构 || 个人机构且是超级会员 -->
+								<template v-else>
+									<!-- 价格仅医美机构可见 -->
+									<view class="list-none" v-if="pro.priceFlag == 3 && firstClubType!=1"
+										>¥仅医美机构可见</view
+									>
+									<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
+								</template>
 							</template>
 						</view>
 						<view v-else class="product-price-none">
@@ -80,6 +98,7 @@ export default {
 			},
 			vipFlag: 0,
 			userIdentity: 0,
+			firstClubType:0,
 			productList: [],
 			nomoreText: '上拉显示更多',
 			hasNextPage: false,
@@ -99,7 +118,7 @@ export default {
 		}
 	},
 	computed: {
-		...mapState(['hasLogin', 'userInfo', 'identity', 'isActivity'])
+		...mapState(['hasLogin', 'clubType'])
 	},
 	methods: {
 		async initGetStotage() {
@@ -107,6 +126,7 @@ export default {
 			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
+			this.firstClubType = this.clubType
 			this.getSvipProductPage()
 		},
 		getSvipProductPage() {
@@ -191,15 +211,30 @@ export default {
 			this.isModallayer = false
 		},
 		isShowVipFlag(pros) {
-			// 超级会员价格显示控制
-			if (this.hasLogin && pros.priceFlag != 1) {
-				if (this.userIdentity == 4 && this.vipFlag == 1) {
-					return true
-				} else if (this.userIdentity == 2) {
-					return true
-				}
-			}
-		}
+			/**
+			 *显示SVIP和超级会员价格:
+			 * 	个人机构(不是超级会员,但价格所有机构可见),
+			 *	资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
+			 * 	超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
+			 *商品价格是否可见:priceFlag  0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
+			 *	普通机构
+			 * 		超级会员 && priceFlag === 0
+			 * 	资质机构
+			 * 		priceFlag !== 1 ||
+			 * 		超级会员
+			 * 			商品priceFlag === 3 && 是否是医美机构
+			*/
+			// 未登录 || 非会员
+			if(!this.hasLogin || !this.vipFlag === 1) return false
+			// 商品所有机构可见
+			if(pros.priceFlag === 0 ) return true
+			// 商品价格仅资质机构可见
+			if(pros.priceFlag === 2 && this.userIdentity === 2) return true
+			// 商品价格仅医美机构可见
+			if(pros.priceFlag === 3 && this.userIdentity === 2 &&  this.firstClubType == 1) return true
+			// 其它
+			return false
+		},
 	},
 	onPullDownRefresh() {
 		setTimeout(() => {
@@ -314,7 +349,7 @@ page {
 					width: 100%;
 					line-height: 37rpx;
 					font-size: $font-size-26;
-					color: #333333;
+					color: #f94b4b;
 					margin-top: 8rpx;
 					.list-none-price {
 						text-decoration: line-through;

+ 49 - 16
pages/user/member/member.vue

@@ -131,21 +131,37 @@
 								</template>
 								<template v-if="pro.svipProductFlag == 1">
 									<view class="svip-tags">
-										<view class="tags" :class="{ none: userVip.vipFlag == 0 }">SVIP</view>
+										<view class="tags" :class="{ none: !isShowVipFlag }">SVIP</view>
 										<view class="price" v-if="isShowVipFlag(pro)">{{ pro.svipPriceTag }}</view>
 									</view>
 								</template>
 							</view>
 						</view>
 						<view class="product-price">
+							<!-- 价格未公开 -->
 							<view class="list-none" v-if="pro.priceFlag == 1">¥未公开价格</view>
+							<!-- 价格公开 -->
 							<template v-else>
-								<view
-									class="list-none"
-									v-if="pro.priceFlag == 2 && (userIdentity == 4 && userVip.vipFlag == 0)"
-									>¥价格仅会员可见</view
-								>
-								<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
+								<!-- 个人机构且不是超级会员 -->
+								<template v-if="userIdentity == 4 && userVip.vipFlag != 1">
+									<!-- 价格仅会员可见 -->
+									<view class="list-none" v-if="pro.priceFlag == 2"
+										>¥价格仅会员可见</view
+									>
+									<!-- 价格仅医美机构可见 -->
+									<view class="list-none" v-else-if="pro.priceFlag == 3"
+										>¥仅医美机构可见</view
+									>
+									<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
+								</template>
+								<!-- 资质机构 || 个人机构且是超级会员 -->
+								<template v-else>
+									<!-- 价格仅医美机构可见 -->
+									<view class="list-none" v-if="pro.priceFlag == 3 && firstClubType!=1"
+										>¥仅医美机构可见</view
+									>
+									<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
+								</template>
 							</template>
 						</view>
 					</view>
@@ -207,6 +223,7 @@ export default {
 			memberType: 0,
 			tabCurrent: 0,
 			userIdentity: 0,
+			firstClubType:0,
 			userVip: {},
 			handelPayMsg: {
 				beans: 0,
@@ -301,13 +318,14 @@ export default {
 		}
 	},
 	computed: {
-		...mapState(['hasLogin', 'userInfo', 'identity', 'isActivity'])
+		...mapState(['hasLogin','clubType'])
 	},
 	methods: {
 		async initGetStotage() {
 			const userInfo = await this.$api.getStorage()
 			this.payParam.userId = this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
 			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
+			this.firstClubType = this.clubType
 			this.getUserSuperCenter()
 			this.getSvipProductPage()
 		},
@@ -512,14 +530,29 @@ export default {
 			this.isModallayer = false
 		},
 		isShowVipFlag(pros) {
-			// 超级会员价格显示控制
-			if (pros.priceFlag != 1) {
-				if (this.userIdentity == 4 && this.userVip.vipFlag == 1) {
-					return true
-				} else if (this.userIdentity == 2) {
-					return true
-				}
-			}
+			/**
+			 *显示SVIP和超级会员价格:
+			 * 	个人机构(不是超级会员,但价格所有机构可见),
+			 *	资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
+			 * 	超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
+			 *商品价格是否可见:priceFlag  0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
+			 *	普通机构
+			 * 		超级会员 && priceFlag === 0
+			 * 	资质机构
+			 * 		priceFlag !== 1 ||
+			 * 		超级会员
+			 * 			商品priceFlag === 3 && 是否是医美机构
+			*/
+			// 未登录 || 非会员
+			if(!this.hasLogin || !this.vipFlag === 1) return false
+			// 商品所有机构可见
+			if(pros.priceFlag === 0 ) return true
+			// 商品价格仅资质机构可见
+			if(pros.priceFlag === 2 && this.userIdentity === 2) return true
+			// 商品价格仅医美机构可见
+			if(pros.priceFlag === 3 && this.userIdentity === 2 &&  this.firstClubType == 1) return true
+			// 其它
+			return false
 		},
 		getNowTime() {
 			let dateTime