浏览代码

commit 超级会员测试修复问题

zhengjinyi 3 年之前
父节点
当前提交
ad65ac87dd

+ 2 - 2
components/cm-module/cart-components/index.vue

@@ -152,7 +152,7 @@
 												</template>
 												<template v-if="pros.svipProductFlag == 1">
 													<view class="svip-tags">
-														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+														<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
 														<view class="price" v-if="isShowVipFlag(pros)">{{
 															pros.svipPriceTag
 														}}</view>
@@ -1562,7 +1562,7 @@ page {
 		height: 210rpx;
 		padding: 0 0 26rpx 0;
 		.checkbox-box {
-			padding: 10rpx;
+			// padding: 10rpx;
 		}
 		.pros-img {
 			width: 210rpx;

+ 12 - 4
components/cm-module/pageTemplate/templatePrice.vue

@@ -10,7 +10,9 @@
 			>
 				<text class="p sm">¥</text>
 				<text class="p big">{{
-					(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
+					(PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
+						? goods.originalPrice
+						: goods.price) | NumFormat
 				}}</text>
 			</view>
 		</template>
@@ -28,7 +30,9 @@
 					>
 						<text class="p sm">¥</text>
 						<text class="p big">{{
-							(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
+							(PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
+								? goods.originalPrice
+								: goods.price) | NumFormat
 						}}</text>
 					</view>
 				</template>
@@ -54,7 +58,9 @@
 				>
 					<text class="p sm">¥</text>
 					<text class="p big">{{
-						(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
+						(PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
+							? goods.originalPrice
+							: goods.price) | NumFormat
 					}}</text>
 				</view>
 			</template>
@@ -68,7 +74,9 @@
 				>
 					<text class="p sm">¥</text>
 					<text class="p big">{{
-						(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
+						(PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
+							? goods.originalPrice
+							: goods.price) | NumFormat
 					}}</text>
 				</view>
 			</template>

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

@@ -41,7 +41,7 @@
 			</template>
 			<template v-if="goods.svipProductFlag == 1">
 				<view class="svip-tags">
-					<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+					<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
 					<view class="price" v-if="isShowVipFlag(goods)">{{ goods.svipPriceTag }}</view>
 				</view>
 			</template>

+ 3 - 3
components/cm-module/productDetails/cm-price.vue

@@ -151,7 +151,7 @@
 							</template>
 							<template v-if="product.svipProductFlag == 1">
 								<view class="svip-tags">
-									<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view> 
+									<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view> 
 									<view class="price" v-if="product.priceFlag != 1 && vipFlag == 1">{{ product.svipPriceTag }}</view>
 								</view>
 							</template>
@@ -169,7 +169,7 @@
 				</template>
 			</template>
 			<!-- 个人机构  -->
-			<template v-if="userIdentity == 4 && vipFlag == 0">
+			<template v-if="userIdentity == 4 && vipFlag !=1">
 				<template v-if="product.priceFlag == 1">
 					<text class="wrap-main-text">¥未公开价格</text>
 				</template>
@@ -210,7 +210,7 @@
 							</template>
 							<template v-if="product.svipProductFlag == 1">
 								<view class="svip-tags">
-									<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view> 
+									<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view> 
 									<view class="price" v-if="vipFlag == 1">{{ product.svipPriceTag }}</view>
 								</view>
 							</template>

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

@@ -183,7 +183,7 @@
 											</text>
 										</template>
 									</template>
-									<template v-if="userIdentity == 4 && vipFlag == 0">
+									<template v-if="userIdentity == 4 && vipFlag != 1">
 										<view class="price-larger" v-if="pros.priceFlag == 1">
 											<text class="txt">¥未公开价格</text>
 										</view>

+ 1 - 1
pages/goods/product.vue

@@ -794,7 +794,7 @@ export default {
 					if (this.product.priceFlag == 1) {
 						this.disabled = true
 					} else if (this.product.priceFlag == 2) {
-						if (this.userIdentity == 4 && this.vipFlag == 0) {
+						if (this.userIdentity == 4 && this.vipFlag != 1) {
 							this.disabled = true
 						} else {
 							this.disabled = false

+ 1 - 1
pages/search/search.vue

@@ -198,7 +198,7 @@
 										}}
 									</text>
 								</template>
-								<template v-if="userIdentity == 4 && vipFlag == 0">
+								<template v-if="userIdentity == 4 && vipFlag != 1">
 									<view class="price-larger" v-if="pros.priceFlag == 1">
 										<text class="txt">¥未公开价格</text>
 									</view>

+ 1 - 1
pages/seller/cart/cart.vue

@@ -135,7 +135,7 @@
 												</template>
 												<template v-if="pros.svipProductFlag == 1">
 													<view class="svip-tags">
-														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+														<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
 														<view class="price" v-if="isShowVipFlag(pros)">{{
 															pros.svipPriceTag
 														}}</view>

+ 47 - 44
pages/supplier/user/my-shop.vue

@@ -95,7 +95,9 @@
 										<template v-if="prop.priceFlag != 1">
 											<view class="svip-tags">
 												<view class="tags">SVIP</view>
-												<view class="price" v-if="prop.shopId == shopId">{{ prop.svipPriceTag }}</view>
+												<view class="price" v-if="prop.shopId == shopId">{{
+													prop.svipPriceTag
+												}}</view>
 											</view>
 										</template>
 										<template v-else>
@@ -115,15 +117,12 @@
 										<view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
 									</template>
 									<template v-if="prop.svipProductFlag == 1">
-										<template v-if="prop.priceFlag != 1 && userIdentity == 2">
-											<view class="svip-tags">
-												<view class="tags">SVIP</view>
-												<view class="price">{{ prop.svipPriceTag }}</view>
-											</view>
-										</template>
-										<template v-else>
-											<view class="svip-tags"> <view class="tags none">SVIP</view> </view>
-										</template>
+										<view class="svip-tags">
+											<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
+											<view class="price" v-if="isShowVipFlag(pros)">{{
+												pros.svipPriceTag
+											}}</view>
+										</view>
 									</template>
 								</template>
 							</view>
@@ -136,11 +135,11 @@
 										<view
 											class="price tui-skeleton-rect"
 											v-else
-											:class="PromotionsFormat(prop.promotions) ? 'none' : ''"
+											:class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
 										>
 											<text class="p sm">¥</text>
 											<text class="p big">{{
-												(PromotionsFormat(prop.promotions) ? prop.originalPrice : prop.price)
+												(PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
 													| NumFormat
 											}}</text>
 										</view>
@@ -164,11 +163,11 @@
 									<view
 										class="price tui-skeleton-rect"
 										v-if="prop.priceFlag === 0"
-										:class="PromotionsFormat(prop.promotions) ? 'none' : ''"
+										:class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
 									>
 										<text class="p sm">¥</text>
 										<text class="p big">{{
-											(PromotionsFormat(prop.promotions) ? prop.originalPrice : prop.price)
+											(PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
 												| NumFormat
 										}}</text>
 									</view>
@@ -180,11 +179,11 @@
 									<view
 										class="price tui-skeleton-rect"
 										v-else
-										:class="PromotionsFormat(prop.promotions) ? 'none' : ''"
+										:class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
 									>
 										<text class="p sm">¥</text>
 										<text class="p big">{{
-											(PromotionsFormat(prop.promotions) ? prop.originalPrice : prop.price)
+											(PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
 												| NumFormat
 										}}</text>
 									</view>
@@ -247,7 +246,9 @@
 										<template v-if="prop.priceFlag != 1">
 											<view class="svip-tags">
 												<view class="tags">SVIP</view>
-												<view class="price" v-if="prop.shopId == shopId">{{ prop.svipPriceTag }}</view>
+												<view class="price" v-if="prop.shopId == shopId">{{
+													prop.svipPriceTag
+												}}</view>
 											</view>
 										</template>
 										<template v-else>
@@ -267,15 +268,12 @@
 										<view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
 									</template>
 									<template v-if="prop.svipProductFlag == 1">
-										<template v-if="prop.priceFlag != 1 && userIdentity == 2">
-											<view class="svip-tags">
-												<view class="tags">SVIP</view>
-												<view class="price">{{ prop.svipPriceTag }}</view>
-											</view>
-										</template>
-										<template v-else>
-											<view class="svip-tags"> <view class="tags none">SVIP</view> </view>
-										</template>
+										<view class="svip-tags">
+											<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
+											<view class="price" v-if="isShowVipFlag(pros)">{{
+												pros.svipPriceTag
+											}}</view>
+										</view>
 									</template>
 								</template>
 							</view>
@@ -288,11 +286,11 @@
 										<view
 											class="price tui-skeleton-rect"
 											v-else
-											:class="PromotionsFormat(prop.promotions) ? 'none' : ''"
+											:class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
 										>
 											<text class="p sm">¥</text>
 											<text class="p big">{{
-												(PromotionsFormat(prop.promotions) ? prop.originalPrice : prop.price)
+												(PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
 													| NumFormat
 											}}</text>
 										</view>
@@ -316,11 +314,11 @@
 									<view
 										class="price tui-skeleton-rect"
 										v-if="prop.priceFlag === 0"
-										:class="PromotionsFormat(prop.promotions) ? 'none' : ''"
+										:class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
 									>
 										<text class="p sm">¥</text>
 										<text class="p big">{{
-											(PromotionsFormat(prop.promotions) ? prop.originalPrice : prop.price)
+											(PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
 												| NumFormat
 										}}</text>
 									</view>
@@ -332,11 +330,11 @@
 									<view
 										class="price tui-skeleton-rect"
 										v-else
-										:class="PromotionsFormat(prop.promotions) ? 'none' : ''"
+										:class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
 									>
 										<text class="p sm">¥</text>
 										<text class="p big">{{
-											(PromotionsFormat(prop.promotions) ? prop.originalPrice : prop.price)
+											(PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
 												| NumFormat
 										}}</text>
 									</view>
@@ -409,17 +407,7 @@ export default {
 			wxLogin.wxLoginAuthorize()
 		}
 		this.listQuery.id = this.supplierId = option.shopId
-		this.$api
-			.getStorage()
-			.then(resolve => {
-				this.shopId = resolve.shopId ? resolve.shopId : 0
-				this.userID = resolve.userId ? resolve.userId : 0
-				this.userIdentity = resolve.userIdentity
-				this.InitShopDataInfo()
-			})
-			.catch(error => {
-				this.InitShopDataInfo()
-			})
+		this.initGetStotage()
 	},
 	filters: {
 		NumFormat: function(text) {
@@ -429,7 +417,12 @@ export default {
 	},
 	methods: {
 		...mapMutations(['login', 'logout']),
-		InitShopDataInfo() {
+		async initGetStotage(option) {
+			const userInfo = await this.$api.getStorage()
+			this.shopId = userInfo.shopId ? userInfo.shopId : 0
+			this.userID = userInfo.userId ? userInfo.userId : 0
+			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
+			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			//初始化请求数据
 			this.GetSupplierHomeBanner()
 			this.GetSupplierHomeDeatils()
@@ -617,6 +610,16 @@ export default {
 		navToDetailPage(id) {
 			//跳转商品详情页
 			this.$api.navigateTo(`/pages/goods/product?id=${id}`)
+		},
+		isShowVipFlag(pros) {
+			// 超级会员价格显示控制
+			if (this.hasLogin && pros.priceFlag != 1) {
+				if (this.userIdentity == 1 || (this.userIdentity == 4 && this.vipFlag == 1)) {
+					return true
+				} else if (this.userIdentity == 2) {
+					return true
+				}
+			}
 		}
 	},
 	onPageScroll(e) {

+ 44 - 6
pages/tabBar/user/user.vue

@@ -56,9 +56,9 @@
 				<!-- 我的资产 -->
 				<view class="header-main-account">
 					<view class="main-member">
-						<view class="main-member-none" v-if="!hasLogin" @click="navigator('/pages/login/login')">
+						<view class="main-member-none" v-if="!hasLogin" @click.stop="navigatorMember('/pages/login/login')">
 							<view class="main-member-none-text">开通采美·超级会员,享专属特权</view>
-							<view class="main-member-none-btn">立即开通</view>
+							<view class="main-member-none-btn" @click.stop="navigatorMember('/pages/login/login')">立即开通</view>
 						</view>
 						<template v-else>
 							<view
@@ -67,7 +67,7 @@
 								@click="navigator('/pages/user/member/member')"
 							>
 								<view class="main-member-svip-h1">已开通采美·超级会员</view>
-								<view class="main-member-svip-p">有效期至:{{ userVip.endTime }}</view>
+								<view class="main-member-svip-p">有效期至:{{ userVip.time }}</view>
 								<view class="main-member-svip-icon"> <text class="iconfont icon-xiayibu"></text> </view>
 							</view>
 							<view
@@ -76,13 +76,13 @@
 								@click="navigator('/pages/user/member/member')"
 							>
 								<view class="main-member-svip-h1 red">采美·超级会员已过期</view>
-								<view class="main-member-svip-p">有效期至:2021-10-01</view>
+								<view class="main-member-svip-p">有效期至:{{ userVip.time }}</view>
 								<view class="main-member-svip-icon"> <text class="iconfont icon-xiayibu"></text> </view>
 							</view>
 							<view
 								class="main-member-none"
 								v-if="userVip.vipFlag == 0"
-								@click="navigator('/pages/user/member/member')"
+								@click="navigatorUserMember('/pages/user/member/member')"
 							>
 								<view class="main-member-none-text">开通采美·超级会员,享专属特权</view>
 								<view class="main-member-none-btn">立即开通</view>
@@ -580,13 +580,51 @@ export default {
 			// 友盟埋点个人机构升级点击事件
 			if (process.env.NODE_ENV != 'development') {
 				this.$uma.trackEvent('Um_Event_LoginCodeBtn', {
-					Um_Key_ClubName: `${this.name}`,
+					Um_Key_ClubName: this.getNowTime(),
 					Um_Key_PageName: '邀请码登录',
 					Um_Key_SourcePage: '个人中心'
 				})
 			}
 			this.$api.navigateTo(url)
 		},
+		navigatorMember(url) {
+			// 友盟埋点游客立即开通点击事件
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_userVisitorMember', {
+					Um_Key_Time: this.getNowTime(),
+					Um_Key_PageName: '游客立即开通',
+					Um_Key_SourcePage: '个人中心'
+				})
+			}
+			this.$api.navigateTo(url)
+		},
+		navigatorUserMember(url) {
+			// 友盟埋点机构立即开通点击事件
+			if (process.env.NODE_ENV != 'development') {
+				this.$uma.trackEvent('Um_Event_userClubMember', {
+					Um_Key_Time: `${this.name}`,
+					Um_Key_PageName: '机构立即开通',
+					Um_Key_SourcePage: '个人中心'
+				})
+			}
+			this.$api.navigateTo(url)
+		},
+		getNowTime () {
+			  let dateTime
+			  let yy = new Date().getFullYear()
+			  let mm = new Date().getMonth() + 1
+			  let dd = new Date().getDate()
+			  let hh = new Date().getHours()
+			  let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
+				:
+				new Date().getMinutes()
+			  let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
+				:
+				new Date().getSeconds()
+			  dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
+			  console.log(dateTime)
+			  return dateTime
+		},
 		navigatorNex(url) {
 			if (!this.hasLogin) {
 				this.$api.navigateTo(url)

+ 271 - 214
pages/user/coupon/coupon-product.vue

@@ -1,46 +1,68 @@
 <template>
 	<view class="container floor clearfix">
-		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="5"
+		></tui-skeleton>
 		<!-- 楼层 -->
 		<view class="container-section tui-skeleton">
-			<view class="floor-item-banner ad_01">
+			<view class="floor-item-banner ad_01" v-if="appletsBanner">
 				<image class="item-img-gg" :src="appletsBanner"></image>
 			</view>
 			<view class="section_page_main clearfix">
-				<view class="floor-item clearfix" v-for="(pros, idx) in productList" :key="idx" @click.stop="navToDetailPage(pros.productId)">
+				<view
+					class="floor-item clearfix"
+					v-for="(pros, idx) in productList"
+					:key="idx"
+					@click.stop="navToDetailPage(pros.productId)"
+				>
 					<image class="item-img tui-skeleton-fillet" :src="pros.image" mode="aspectFill"></image>
 					<view class="floor-item-content">
 						<view class="title tui-skeleton-rect">
 							<text class="mclap-tag" v-if="pros.beautyActFlag == '1'">美博会</text>
-							<text class="mclap" :class="pros.beautyActFlag == '1' ? 'indent' : ''">{{pros.name}} </text>
+							<text class="mclap" :class="pros.beautyActFlag == '1' ? 'indent' : ''"
+								>{{ pros.name }}
+							</text>
 						</view>
 						<view class="floor-item-price">
 							<view class="floor-item-act">
 								<view class="coupon-tags">优惠券</view>
-								<template v-if="pros.actStatus===1">
+								<template v-if="pros.actStatus === 1">
 									<view class="floor-tags" v-if="PromotionsFormat(pros.promotions)">
-										{{pros.promotions.name}}
-										<text v-if="pros.priceFlag != 1">:¥{{pros.price | NumFormat}}</text>
+										{{ pros.promotions.name }}
+										<text v-if="pros.priceFlag != 1">:¥{{ pros.price | NumFormat }}</text>
 									</view>
-									<view class="floor-tags" v-else>{{pros.promotions.name}}</view>	
+									<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
 								</template>
-								<template v-if="pros.actStatus ===0  &&  pros.ladderPriceFlag===1">
-									<view class="floor-tags">阶梯价格</view>	
+								<template v-if="pros.svipProductFlag == 1">
+									<view class="svip-tags">
+										<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
+										<view class="price" v-if="isShowVipFlag(pros)">{{ pros.svipPriceTag }}</view>
+									</view>
 								</template>
-							</view>	
+							</view>
 							<view>
-								<template v-if="userIdentity ===4">
+								<template v-if="userIdentity === 4 && vipFlag != 1">
 									<view class="title-none" v-if="pros.priceFlag === 1">
 										<text class="p big">¥未公开价格</text>
 									</view>
-									<view class="title-none"  v-if="pros.priceFlag === 2">
+									<view class="title-none" v-if="pros.priceFlag === 2">
 										<text class="p big">¥价格仅会员可见</text>
 									</view>
-									<view class="price tui-skeleton-rect" v-if="pros.priceFlag === 0" 
-										  :class="PromotionsFormat(pros.promotions) ? 'none' : ''">
+									<view
+										class="price tui-skeleton-rect"
+										v-if="pros.priceFlag === 0"
+										:class="PromotionsFormat(pros.promotions) ? 'none' : ''"
+									>
 										<text class="p sm">¥</text>
 										<text class="p big">
-											{{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price ) | NumFormat}}
+											{{
+												(PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)
+													| NumFormat
+											}}
 										</text>
 									</view>
 								</template>
@@ -48,10 +70,20 @@
 									<view class="title-none" v-if="pros.priceFlag === 1">
 										<text class="p big">¥未公开价格</text>
 									</view>
-									<view class="price tui-skeleton-rect" v-else :class="PromotionsFormat(pros.promotions) ? 'none' : ''">
+									<view
+										class="price tui-skeleton-rect"
+										v-else
+										:class="
+											PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'none' : ''
+										"
+									>
 										<text class="p sm">¥</text>
 										<text class="p big">
-											{{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price ) | NumFormat}}
+											{{
+												(PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
+													? pros.originalPrice
+													: pros.price) | NumFormat
+											}}
 										</text>
 									</view>
 								</template>
@@ -62,250 +94,275 @@
 			</view>
 			<!--加载loadding-->
 			<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
-			<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text='nomoreText'></tui-nomore>
+			<tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
 			<!--加载loadding-->
 		</view>
 	</view>
 </template>
 
 <script>
-	import { mapState,mapMutations} from 'vuex';
-	export default{
-		data(){
-			return{
-				userIdentity:0,
-				productList:[],
-				appletsBanner:'',
-				listQuery:{
-					userId:0,
-					couponId: 0,
-					pageSize: 10,
-					pageNum: 1,
-					source: 2
-				},
-				NavigationBarTitle:'',
-				nomoreText: '上拉显示更多',
-				hasNextPage:false,
-				loadding: false,
-				pullUpOn: true,
-				pullFlag: true
-			}
-		},
-		onLoad(option) {
-			this.listQuery.couponId = option.couponId	
-			this.$api.getComStorage('userInfo').then((resolve) =>{
-				this.listQuery.userId = resolve.userId ? resolve.userId : 0;
-				this.userIdentity = resolve.userIdentity
-				this.QueryCouponActivityList()
-			})
-		},
-		filters: {
-			NumFormat:function(text) {//处理金额				
-				return Number(text).toFixed(2);			
-			},		
-		},
-		computed: {
-			...mapState(['hasLogin','userInfo','identity'])
+import { mapState, mapMutations } from 'vuex'
+export default {
+	data() {
+		return {
+			vipFlag: 0,
+			userIdentity: 0,
+			productList: [],
+			appletsBanner: '',
+			listQuery: {
+				userId: 0,
+				couponId: 0,
+				pageSize: 10,
+				pageNum: 1,
+				source: 2
+			},
+			NavigationBarTitle: '',
+			nomoreText: '上拉显示更多',
+			hasNextPage: false,
+			loadding: false,
+			pullUpOn: true,
+			pullFlag: true
+		}
+	},
+	onLoad(option) {
+		this.listQuery.couponId = option.couponId
+		this.initGetStotage()
+	},
+	filters: {
+		NumFormat: function(text) {
+			//处理金额
+			return Number(text).toFixed(2)
+		}
+	},
+	computed: {
+		...mapState(['hasLogin', 'userInfo', 'identity'])
+	},
+	methods: {
+		async initGetStotage() {
+			// 初始化
+			const userInfo = await this.$api.getStorage()
+			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
+			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
+			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
+			this.QueryCouponActivityList()
 		},
-		methods:{
-			QueryCouponActivityList(){//楼层查看更多
-				this.ProductService.QueryCouponActivityList(this.listQuery).then(response =>{
-					let data  = response.data
-					uni.setNavigationBarTitle({title:data.coupon.name});
+		QueryCouponActivityList() {
+			//楼层查看更多
+			this.ProductService.QueryCouponActivityList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					uni.setNavigationBarTitle({ title: data.coupon.name })
 					this.appletsBanner = data.coupon.appletsBanner
 					this.productList = data.pageInfo.list
 					this.hasNextPage = data.pageInfo.hasNextPage
 					this.skeletonShow = false
-					if(this.hasNextPage){
+					if (this.hasNextPage) {
 						this.pullUpOn = false
 						this.nomoreText = '上拉显示更多'
-					}else{
-						this.pullUpOn = false
-						this.loadding = false
-						this.nomoreText = '已至底部'
+					} else {
+						if (this.productList.length <6) {
+							this.pullUpOn = true
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
 					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000)
 				})
-			},
-			OnReachBottomData(){// 上滑加载
-				this.listQuery.pageNum+=1
-				this.ProductService.QueryCouponActivityList(this.listQuery).then(response =>{
-					let data  = response.data
-					uni.setNavigationBarTitle({title:data.coupon.name});
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		OnReachBottomData() {
+			// 上滑加载
+			this.listQuery.pageNum += 1
+			this.ProductService.QueryCouponActivityList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					uni.setNavigationBarTitle({ title: data.coupon.name })
 					this.hasNextPage = data.pageInfo.hasNextPage
-					this.productList = this.productList.concat(data.pageInfo.list) 
+					this.productList = this.productList.concat(data.pageInfo.list)
 					this.skeletonShow = false
-					if(this.hasNextPage){
+					if (this.hasNextPage) {
 						this.pullUpOn = false
 						this.nomoreText = '上拉显示更多'
-					}else{
+					} else {
 						this.pullUpOn = false
 						this.loadding = false
 						this.nomoreText = '已至底部'
 					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000)
 				})
-			},
-			PromotionsFormat(promo){//促销活动类型数据处理
-				if(promo!=null){
-					if(promo.type == 1 && promo.mode == 1){
-						return true
-					}else{
-						return false
-					}
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		PromotionsFormat(promo) {
+			//促销活动类型数据处理
+			if (promo != null) {
+				if (promo.type == 1 && promo.mode == 1) {
+					return true
+				} else {
+					return false
 				}
-				return false
-			},
-			navToDetailPage(productId) {//跳转商品详情页
-				this.$api.navigateTo(`/pages/goods/product?id=${productId}`)
 			}
+			return false
 		},
-		onPullDownRefresh() {
-			setTimeout(() => {
-				this.productList = []
-				this.listQuery.pageNum = 1
-				this.QueryCouponActivityList()
-				uni.stopPullDownRefresh()
-			}, 200)
+		navToDetailPage(productId) {
+			//跳转商品详情页
+			this.$api.navigateTo(`/pages/goods/product?id=${productId}`)
 		},
-		onReachBottom() {
-			if(this.hasNextPage){
-				this.loadding = true
-				this.pullUpOn = true
-				this.OnReachBottomData()
-			}	
-		},
-		onShow() {
-			
+		isShowVipFlag(pros) {
+			// 超级会员价格显示控制
+			if (this.hasLogin && pros.priceFlag != 1) {
+				if (this.userIdentity == 4 && this.vipFlag == 1) {
+					return true
+				} else if (this.userIdentity == 2) {
+					return true
+				}
+			}
 		}
-	}
+	},
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.productList = []
+			this.listQuery.pageNum = 1
+			this.QueryCouponActivityList()
+			uni.stopPullDownRefresh()
+		}, 200)
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.OnReachBottomData()
+		}
+	},
+	onShow() {}
+}
 </script>
 
 <style lang="scss">
-	page{
-		background-color: #F7F7F7;
-	}
-	.container-home{
-		width: 100%;
-		height: auto;
-	}
-	.container-section{
-		width: 100%;
-		height: auto;
-		background-color: #F7F7F7;
-		box-sizing: border-box;
-		padding:24rpx;
-	}
-	.floor-item-banner{
+page {
+	background-color: #f7f7f7;
+}
+.container-home {
+	width: 100%;
+	height: auto;
+}
+.container-section {
+	width: 100%;
+	height: auto;
+	background-color: #f7f7f7;
+	box-sizing: border-box;
+	padding: 24rpx;
+}
+.floor-item-banner {
+	width: 100%;
+	height: 240rpx;
+	margin-bottom: 20rpx;
+	.item-img-gg {
 		width: 100%;
 		height: 240rpx;
-		margin-bottom: 20rpx;
-		.item-img-gg{
-			width: 100%;
-			height: 240rpx;
-			display: block;
-			border-radius: 16rpx;
-		}
+		display: block;
+		border-radius: 16rpx;
 	}
-	.section_page_main{
-		width: 100%;
-		height: auto;
+}
+.section_page_main {
+	width: 100%;
+	height: auto;
+	box-sizing: border-box;
+	.floor-item {
+		width: 339rpx;
+		height: 516rpx;
+		margin-right: 20rpx;
+		font-size: $font-size-24;
+		color: $text-color;
+		background: #ffffff;
+		line-height: 36rpx;
+		border-radius: 16rpx;
+		margin-bottom: 20rpx;
+		float: left;
 		box-sizing: border-box;
-		.floor-item{
+		position: relative;
+		&:nth-child(2n) {
+			margin-right: 0;
+		}
+		.item-img {
 			width: 339rpx;
-			height: 516rpx;
-			margin-right: 20rpx;
-			font-size: $font-size-24;
-			color: $text-color;
-			background: #FFFFFF;
-			line-height: 36rpx;
-			border-radius: 16rpx;
-			margin-bottom: 20rpx;
-			float: left;
+			height: 339rpx;
+			border-radius: 16rpx 16rpx 0 0;
+			display: block;
+			margin-bottom: 8rpx;
+		}
+		.floor-item-content {
+			width: 100%;
+			padding: 0 20rpx;
+			box-sizing: border-box;
+		}
+		.floor-item-act {
+			display: block;
+			width: 100%;
+			height: 32rpx;
+			text-align: center;
 			box-sizing: border-box;
+		}
+		.title-none {
+			font-size: $font-size-26;
+			color: #ff2a2a;
+			line-height: 54rpx;
+		}
+		.title {
+			width: 100%;
+			height: 70rpx;
+			display: flex;
+			line-height: 35rpx;
+			flex-direction: column;
+			margin: 8rpx 0;
+			padding: 0;
 			position: relative;
-			&:nth-child(2n){
-				margin-right: 0;
-			}
-			.item-img{
-				width: 339rpx;
-				height: 339rpx;
-				border-radius: 16rpx 16rpx 0 0;
-				display: block;
-				margin-bottom: 8rpx;
-			}
-			.floor-item-content{
+			.mclap {
 				width: 100%;
-				padding: 0 20rpx;
-				box-sizing: border-box;
+				line-height: 35rpx;
+				text-overflow: ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 2;
+				overflow: hidden;
+				font-size: 26rpx;
+				&.indent {
+					text-indent: 95rpx;
+				}
 			}
-			.floor-item-act{
+			.mclap-tag {
 				display: block;
-				width: 100%;
+				width: 84rpx;
 				height: 32rpx;
+				background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
+				border-radius: 4rpx 48rpx 4px 4px;
+				line-height: 32rpx;
+				font-size: $font-size-22;
+				color: #ffffff;
 				text-align: center;
-				box-sizing: border-box;
+				position: absolute;
+				left: 0;
+				top: 0;
 			}
-			.title-none{
-				font-size: $font-size-26;
-				color: #FF2A2A;
-				line-height: 54rpx;
+		}
+		.price {
+			color: #ff2a2a;
+			line-height: 54rpx;
+			&.none {
+				text-decoration: line-through;
+				color: #999999;
 			}
-			.title{
-				width: 100%;
-				height: 70rpx;
-				display: flex;
-				line-height: 35rpx;
-				flex-direction: column;
-				margin: 8rpx 0;
-				padding: 0;
-				position: relative;
-				.mclap{
-					width: 100%;
-					line-height:35rpx;
-					text-overflow:ellipsis;
-					display: -webkit-box;
-					word-break: break-all;
-					-webkit-box-orient: vertical;
-					-webkit-line-clamp: 2;
-					overflow: hidden;
-					font-size: 26rpx;
-					&.indent{
-						text-indent: 95rpx;
-					}
-				}
-				.mclap-tag{
-					display: block;
-					width: 84rpx;
-					height: 32rpx;
-					background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
-					border-radius: 4rpx 48rpx 4px 4px;
-					line-height: 32rpx;
-					font-size: $font-size-22;
-					color: #FFFFFF;
-					text-align: center;
-					position: absolute;
-					left: 0;
-					top: 0;
-				}
+			.sm {
+				font-size: $font-size-24;
 			}
-			.price{
-				color: #FF2A2A;
-				line-height:54rpx;
-				&.none{
-					text-decoration: line-through;
-					color: #999999;
-				}
-				.sm{
-					font-size: $font-size-24;
-				}
-				.big{
-					font-size: $font-size-28;
-				}
+			.big {
+				font-size: $font-size-28;
 			}
 		}
 	}
+}
 </style>
-                               

+ 14 - 14
pages/user/member/member-pay.vue

@@ -118,15 +118,14 @@ export default {
 	methods: {
 		async initGetStotage(option) {
 			let data = JSON.parse(option.data)
-			const userInfo = await this.$api.getStorage()
-			this.payParams.code = await authorize.getCode('weixin')
 			this.payParams.vipRecordId = data.vipRecordId
 			this.handelPayMsg = data
+			this.PayOrderOnLineSwitch()
 			console.log(this.handelPayMsg)
 		},
 		PayOrderOnLineSwitch() {
 			// 线上支付开关
-			this.PayService.PayOrderOnLineSwitch()
+			this.PayService.PayOrderOnLineSwitch()  
 				.then(response => {
 					if (response.data === 0) {
 						this.isPaySwitch = true
@@ -135,23 +134,23 @@ export default {
 					}
 				})
 				.catch(error => {
-					this.$util.msg(error.msg, 2000)
+					console.log('线上支付开关异常')
 				})
 		},
 		payConfirmClick() {
+			// 友盟埋点收集选择支付方式
+			if(process.env.NODE_ENV != 'development'){
+				this.$uma.trackEvent('Um_Event_userClubMemberChooseWechatPay', {
+					Um_Key_PageName: '支付超级会员',
+					Um_Key_SourcePage: '支付超级会员',
+					Um_Key_PayName:`${this.buttonText}`,
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+				})
+			}
 			if (this.isPaySwitch) {
 				this.$util.msg('支付系统遇到点小问题,请稍后重试')
 				return
 			}
-			// // 友盟埋点收集选择支付方式
-			// if(process.env.NODE_ENV != 'development'){
-			// 	this.$uma.trackEvent('Um_Event_ChooseWechatPay', {
-			// 		Um_Key_PageName: '线上支付',
-			// 		Um_Key_SourcePage: '选择支付',
-			// 		Um_Key_PayName:`${this.buttonText}`,
-			// 		Um_Key_PayOrderID:`${this.orderId}`
-			// 	})
-			// }
 			switch (this.tabCurrentIndex) {
 				case 0: // 微信小程序支付
 					this.MiniWxPayFor()
@@ -164,8 +163,9 @@ export default {
 					break
 			}
 		},
-		MiniWxPayFor() {
+		async MiniWxPayFor() {
 			// 使用微信支付
+			this.payParams.code = await authorize.getCode('weixin')
 			this.PayService.PayOrderVipWechat(this.payParams)
 				.then(response => {
 					let PayInfo = JSON.parse(response.data.data.payInfo)

+ 2 - 2
pages/user/member/member-product.vue

@@ -25,7 +25,7 @@
 								</template>
 								<template v-if="pro.svipProductFlag == 1">
 									<view class="svip-tags">
-										<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+										<view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
 										<view class="price" v-if="isShowVipFlag(pro)">{{ pro.svipPriceTag }}</view>
 									</view>
 								</template>
@@ -34,7 +34,7 @@
 						<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 == 0)"
+								<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>

+ 29 - 1
pages/user/member/member-renew.vue

@@ -148,20 +148,41 @@ export default {
 		},
 		hanldeShowBeans() {
 			// 显示采美豆抵扣开通超级会员弹窗
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集续费购买超级会员采美豆抵扣会员
+				this.$uma.trackEvent('Um_Event_userClubRenewMemberBeansConfirm', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '续费购买超级会员'
+				})
+			}
 			this.isShowBeansModal = true
 		},
 		handelCanelBeans() {
 			// 取消采美豆抵扣超级会员
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集取消采抵扣会员
+				this.$uma.trackEvent('Um_Event_userClubRenewMemberBeansCancel', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
 			this.isShowBeansModal = false
 		},
 		handelConfirmBeans() {
 			// 确认采美豆抵扣开通超级会员
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集确定采抵扣会员
+				this.$uma.trackEvent('Um_Event_userClubRenewMemberBeansConfirms', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
 			this.PayService.getUserRegisterSuperBeans(this.payParam)
 				.then(response => {
 					this.isShowBeansModal = false
 					this.$util.msg('续费成功', 2000, true, 'success')
 					setTimeout(() => {
-						uni.navigateBack({delta: 1})
+						uni.navigateBack({ delta: 1 })
 					}, 2000)
 				})
 				.catch(error => {
@@ -170,6 +191,13 @@ export default {
 		},
 		hanldWechatPay() {
 			// 跳转微信只开通超级会员
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集线上续费购买超级会员线上支付
+				this.$uma.trackEvent('Um_Event_userClubRenewMemberConfirm', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '续费购买超级会员'
+				})
+			}
 			this.PayService.getUserRegisterSuperPay(this.payParam)
 				.then(response => {
 					this.handelPayMsg.vipRecordId = response.data

+ 59 - 7
pages/user/member/member.vue

@@ -16,7 +16,7 @@
 					</view>
 					<view class="cm-member-p">
 						<text v-if="userVip.vipFlag == 0">享专属特权</text>
-						<text v-else>有效期至:{{ userVip.endTime }}</text>
+						<text v-else>有效期至:{{ userVip.time }}</text>
 					</view>
 				</view>
 				<view class="cm-member-btn" v-if="userVip.vipFlag == 1 || userVip.vipFlag == -1">
@@ -53,7 +53,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="cm-member-main" v-show="productCouponList.length>0">
+		<view class="cm-member-main" v-if="productCouponList.length > 0">
 			<view class="title">专属优惠券<text class="small">每月可领4个</text></view>
 			<view class="cm-member-coupon clearfix">
 				<view
@@ -84,7 +84,7 @@
 					</view>
 					<view class="list-cell-ri">
 						<template v-if="coupon.useStatus == 2">
-							<view class="icon-used-btn make" @click="toUseCoupon(coupon)">已使用</view>
+							<view class="icon-used-btn make">已使用</view>
 						</template>
 						<template v-else>
 							<view
@@ -93,8 +93,8 @@
 								@click="receiveCoupon(coupon)"
 								>立即领取</view
 							>
-							<view class="icon-used-btn make" v-if="coupon.getFlag == 1" @click="toUseCoupon(coupon)"
-								> 去使用</view
+							<view class="icon-used-btn make" v-if="coupon.getFlag == 1" @click="toUseCoupon(coupon)">
+								去使用</view
 							>
 						</template>
 					</view>
@@ -298,7 +298,7 @@ export default {
 		NumFormat(value) {
 			//处理金额
 			return Number(value).toFixed(2)
-		},
+		}
 	},
 	computed: {
 		...mapState(['hasLogin', 'userInfo', 'identity', 'isActivity'])
@@ -318,6 +318,7 @@ export default {
 					let data = response.data
 					this.userVip = data.vip
 					this.productCouponList = data.coupon
+					console.log('this.productCouponList', this.productCouponList)
 					this.isRequest = true
 				})
 				.catch(error => {
@@ -381,14 +382,35 @@ export default {
 		},
 		hanldeShowBeans() {
 			// 显示采美豆抵扣开通超级会员弹窗
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集采美豆抵扣会员
+				this.$uma.trackEvent('Um_Event_userClubMemberBeansConfirm', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
 			this.isShowBeansModal = true
 		},
 		handelCanelBeans() {
 			// 取消采美豆抵扣超级会员
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集取消采抵扣会员
+				this.$uma.trackEvent('Um_Event_userClubMemberBeansCancel', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
 			this.isShowBeansModal = false
 		},
 		handelConfirmBeans() {
 			// 确认采美豆抵扣开通超级会员
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集确定采抵扣会员
+				this.$uma.trackEvent('Um_Event_userClubMemberBeansConfirms', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
 			this.PayService.getUserRegisterSuperBeans(this.payParam)
 				.then(response => {
 					this.isShowBeansModal = false
@@ -403,6 +425,13 @@ export default {
 		},
 		hanldWechatPay() {
 			// 跳转微信只开通超级会员
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集线上微信支付
+				this.$uma.trackEvent('Um_Event_userClubMemberConfirm', {
+					Um_Key_Month: `${this.handelPayMsg.duration}个月`,
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
 			this.PayService.getUserRegisterSuperPay(this.payParam)
 				.then(response => {
 					this.handelPayMsg.vipRecordId = response.data
@@ -450,6 +479,17 @@ export default {
 					break
 			}
 		},
+		hanldRenewPayUrl(url) {
+			// 监听续费跳转并做友盟埋点
+			if (process.env.NODE_ENV != 'development') {
+				// 友盟埋点收集续费按钮点击事件
+				this.$uma.trackEvent('Um_Event_userClubRenewMember', {
+					Um_Key_Time: this.getNowTime(),
+					Um_Key_SourcePage: '会员中心'
+				})
+			}
+			this.$api.navigateTo(url)
+		},
 		hanldPayUrl(url) {
 			// 跳转
 			this.$api.navigateTo(url)
@@ -481,6 +521,18 @@ export default {
 				}
 			}
 		},
+		getNowTime() {
+			let dateTime
+			let yy = new Date().getFullYear()
+			let mm = new Date().getMonth() + 1
+			let dd = new Date().getDate()
+			let hh = new Date().getHours()
+			let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
+			let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
+			dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
+			console.log(dateTime)
+			return dateTime
+		}
 	},
 	onPageScroll(e) {
 		//实时获取到滚动的值
@@ -734,7 +786,7 @@ page {
 			&:nth-child(2n) {
 				margin-right: 0;
 			}
-			&.none{
+			&.none {
 				background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon-none@2x.png);
 				background-size: cover;
 			}