浏览代码

超级会员会员中心页面修改

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

+ 14 - 11
components/cm-module/cart-components/index.vue

@@ -74,7 +74,12 @@
 												<!--使用过滤器对总价改变-->
 												<view
 													class="price"
-													:class="PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1 ? 'disabled' : ''"
+													:class="
+														PromotionsFormat(pros.promotions) ||
+														(pros.svipProductFlag == 1 && vipFlag == 1)
+															? 'disabled'
+															: ''
+													"
 												>
 													<text>¥</text>
 													{{
@@ -148,11 +153,9 @@
 												<template v-if="pros.svipProductFlag == 1">
 													<view class="svip-tags">
 														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
-														<view
-															class="price"
-															v-if="isShowVipFlag(pros)"
-															>{{ pros.svipPriceTag }}</view
-														>
+														<view class="price" v-if="isShowVipFlag(pros)">{{
+															pros.svipPriceTag
+														}}</view>
 													</view>
 												</template>
 											</view>
@@ -461,7 +464,7 @@ export default {
 			CustomBar: this.CustomBar, // 顶部导航栏高度
 			isIphoneX: this.$store.state.isIphoneX,
 			userId: 0,
-			userIdentity:0,
+			userIdentity: 0,
 			alertType: '',
 			isStock: '',
 			handlerPros: {}, // 监听单挑促销商品
@@ -575,11 +578,11 @@ export default {
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			this.initGetCartGoodsList()
 		},
-		isShowVipFlag(pros){
-			if(pros.priceFlag!=1){
-				if(this.userIdentity == 4 && this.vipFlag == 1){
+		isShowVipFlag(pros) {
+			if (pros.priceFlag != 1) {
+				if (this.userIdentity == 4 && this.vipFlag == 1) {
 					return true
-				}else if(this.userIdentity == 2){
+				} else if (this.userIdentity == 2) {
 					return true
 				}
 			}

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

@@ -163,7 +163,7 @@
 												"
 											>
 												¥{{
-													(PromotionsFormat(item.promotions)
+													(PromotionsFormat(item.promotions) || item.svipProductFlag == 1
 														? item.originalPrice
 														: item.price) | NumFormat
 												}}
@@ -189,7 +189,7 @@
 												"
 											>
 												¥{{
-													(PromotionsFormat(item.promotions)
+													(PromotionsFormat(item.promotions) || item.svipProductFlag == 1
 														? item.originalPrice
 														: item.price) | NumFormat
 												}}
@@ -214,7 +214,7 @@
 												"
 											>
 												¥{{
-													(PromotionsFormat(item.promotions)
+													(PromotionsFormat(item.promotions) || item.svipProductFlag == 1
 														? item.originalPrice
 														: item.price) | NumFormat
 												}}
@@ -242,7 +242,7 @@
 												"
 											>
 												¥{{
-													(PromotionsFormat(item.promotions)
+													(PromotionsFormat(item.promotions) || item.svipProductFlag == 1
 														? item.originalPrice
 														: item.price) | NumFormat
 												}}

+ 22 - 17
pages/seller/cart/cart.vue

@@ -62,11 +62,16 @@
 												<!--使用过滤器对总价改变-->
 												<view
 													class="price"
-													:class="PromotionsFormat(pros.promotions) ? 'disabled' : ''"
+													:class="
+														PromotionsFormat(pros.promotions) ||
+														(pros.svipProductFlag == 1 && vipFlag == 1)
+															? 'disabled'
+															: ''
+													"
 												>
 													<text>¥</text>
 													{{
-														(PromotionsFormat(pros.promotions)
+														(PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
 															? pros.originalPrice
 															: pros.price) | NumFormat
 													}}
@@ -105,7 +110,9 @@
 														@click.stop="clickPopupShow(pros, 1)"
 													>
 														{{ pros.promotions.name }}
-														<text v-if="pros.promotions != null && pros.promotions.type != 3">
+														<text
+															v-if="pros.promotions != null && pros.promotions.type != 3"
+														>
 															:¥{{
 																pros.promotions == null
 																	? '0.00'
@@ -129,11 +136,9 @@
 												<template v-if="pros.svipProductFlag == 1">
 													<view class="svip-tags">
 														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
-														<view
-															class="price"
-															v-if="isShowVipFlag(pros)"
-															>{{ pros.svipPriceTag }}</view
-														>
+														<view class="price" v-if="isShowVipFlag(pros)">{{
+															pros.svipPriceTag
+														}}</view>
 													</view>
 												</template>
 											</view>
@@ -305,8 +310,8 @@ export default {
 			depositIds: [6060, 6061, 6062, 6063, 6064], //定金商品ID
 			rechargeIds: [6065, 6066, 6067, 6068, 6069], //充值余额商品ID
 			isIphoneX: this.$store.state.isIphoneX,
-			vipFlag:0,
-			userIdentity:0
+			vipFlag: 0,
+			userIdentity: 0
 		}
 	},
 	onLoad() {
@@ -345,8 +350,8 @@ export default {
 			this.submitIds = []
 			this.vipFlag = clubInfo.vipFlag ? clubInfo.vipFlag : 0
 			this.userIdentity = clubInfo.userIdentity ? clubInfo.userIdentity : 0
-			console.log('userIdentity',this.userIdentity)
-			console.log('vipFlag',this.vipFlag)
+			console.log('userIdentity', this.userIdentity)
+			console.log('vipFlag', this.vipFlag)
 			this.listQuery.clubId = clubInfo.clubId ? clubInfo.clubId : 0
 			this.listQuery.againBuyProductIds = clubInfo.againBuyProductIds ? clubInfo.againBuyProductIds : ''
 			this.listQuery.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
@@ -971,15 +976,15 @@ export default {
 			this.isModallayer = true
 			this.$api.navigateTo(`/pages/goods/product?id=${id}`)
 		},
-		isShowVipFlag(pros){
-			if(pros.priceFlag!=1){
-				if(this.userIdentity == 4 && this.vipFlag == 1){
+		isShowVipFlag(pros) {
+			if (pros.priceFlag != 1) {
+				if (this.userIdentity == 4 && this.vipFlag == 1) {
 					return true
-				}else if(this.userIdentity == 2){
+				} else if (this.userIdentity == 2) {
 					return true
 				}
 			}
-		},
+		}
 	},
 	onReachBottom() {
 		if (this.hasNextPage) {

+ 16 - 9
pages/tabBar/user/user.vue

@@ -85,13 +85,13 @@
 								<view class="main-account-text">我的资产</view>
 							</view>
 							<view class="main-account-ri">
-								<view class="main-account-ri-view" @click="navigator('/pages/user/account/account')">
+								<view class="main-account-ri-view account" @click="navigator('/pages/user/account/account')">
 									<view class="main-account-icon" v-if="hasLogin">{{ userMoney }}</view>
 									<view class="main-account-icon none" v-else>-</view>
 									<view class="main-account-text">账户余额</view>
 								</view>
 								<view
-									class="main-account-ri-view"
+									class="main-account-ri-view beans"
 									@click="navigator('/pages/user/account/account-bean')"
 								>
 									<view class="main-account-icon" v-if="hasLogin">{{
@@ -100,7 +100,7 @@
 									<view class="main-account-icon none" v-else>-</view>
 									<view class="main-account-text">采美豆</view>
 								</view>
-								<view class="main-account-ri-view" @click="navigator('/pages/user/coupon/coupon')">
+								<view class="main-account-ri-view coupon" @click="navigator('/pages/user/coupon/coupon')">
 									<view class="main-account-icon" v-if="hasLogin">{{
 										couponNum ? couponNum : 0
 									}}</view>
@@ -814,7 +814,7 @@ page {
 			width: 100%;
 			height: 88rpx;
 			box-sizing: border-box;
-			padding: 24rpx 0;
+			padding:28rpx 0 20rpx 0;
 			line-height: 40rpx;
 			.main-member-none-text {
 				font-size: $font-size-26;
@@ -890,7 +890,7 @@ page {
 			padding: 24rpx 0;
 		}
 		.main-account-le {
-			width: 200rpx;
+			width: 165rpx;
 			height: 100%;
 			position: relative;
 			float: left;
@@ -923,21 +923,28 @@ page {
 			}
 		}
 		.main-account-ri {
-			width: 502rpx;
+			width: 537rpx;
 			height: 100%;
 			float: right;
 			.main-account-ri-view {
-				width: 33.33%;
 				height: 100%;
 				float: left;
+				&.account{
+					width: 40%;
+				}
+				&.beans{
+					width: 32%;
+				}
+				&.coupon{
+					width: 28%;
+				}
 				.main-account-icon {
 					width: 100%;
 					height: 74rpx;
 					line-height: 74rpx;
 					text-align: center;
-					font-size: $font-size-32;
+					font-size: $font-size-30;
 					color: #f94b4b;
-					font-weight: bold;
 					&.none {
 						color: #333333;
 						font: $font-size-36;

+ 3 - 5
pages/user/member/member-pay.vue

@@ -81,9 +81,8 @@ export default {
 			handelPayMsg: {},
 			payType: 0,
 			payParams: {
-				vipId: 0,
 				code: 0,
-				userId: 0
+				vipRecordId: 0
 			},
 			payHttpUrl: 'https://www.caimei365.com'
 		}
@@ -120,8 +119,7 @@ export default {
 			let data = JSON.parse(option.data)
 			const userInfo = await this.$api.getStorage()
 			this.payParams.code = await authorize.getCode('weixin')
-			this.payParams.vipId = data.packageId
-			this.payParams.userId = userInfo.userId ? userInfo.userId : 0
+			this.payParams.vipRecordId = data.vipRecordId
 			this.handelPayMsg = data
 			console.log(this.handelPayMsg)
 		},
@@ -179,7 +177,7 @@ export default {
 		BuildCatenate() {
 			// 生成网银支付链接
 			this.PayService.PayOrderPayLink({
-				vipId: this.payParams.vipId,
+				vipRecordId: this.payParams.vipRecordId,
 				payType: this.payType
 			}).then(response => {
 				this.payHttpUrl = response.data

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

@@ -42,7 +42,7 @@
 								<view class="list-none" v-if="pro.priceFlag == 2 && userIdentity == 4"
 									>¥价格仅会员可见</view
 								>
-								<view class="list-none-price" v-else>¥{{ pro.price | NumFormat }}</view>
+								<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
 							</template>
 						</view>
 						<view v-else class="product-price-none">

+ 16 - 9
pages/user/member/member-renew.vue

@@ -41,7 +41,7 @@
 				<view class="content">
 					<view class="title">
 						<text>购买超级会员</text>
-						<text class="iconfont icon-iconfontguanbi" @click.stop="hideTips"></text>
+						<text class="iconfont icon-iconfontguanbi" @click.stop="handelCanelBeans"></text>
 					</view>
 					<view class="text-content">
 						<view class="text"
@@ -71,10 +71,10 @@ export default {
 			payList: [],
 			userVip: {},
 			handelPayMsg: {
-				beans: 480000,
-				price: 4800,
-				month: '12个月',
-				packageId: 1
+				beans: 0,
+				price: 0,
+				month: '',
+				packageId: 0
 			},
 			payParam: {
 				userId: 0,
@@ -83,9 +83,7 @@ export default {
 			tabCurrent: 0
 		}
 	},
-	onLoad() {
-		
-	},
+	onLoad() {},
 	filters: {
 		TypeFormat(value) {
 			switch (value) {
@@ -128,6 +126,8 @@ export default {
 						el.packageId = el.id
 					})
 					this.payList = data
+					this.handelPayMsg = data[0]
+					this.payParam.packageId = data[0].packageId
 				})
 				.catch(error => {
 					console.log('获取会员套餐异常~')
@@ -169,7 +169,14 @@ export default {
 		},
 		hanldWechatPay() {
 			// 跳转微信只开通超级会员
-			this.$api.navigateTo(`/pages/user/member/member-pay?data=${JSON.stringify(this.handelPayMsg)}`)
+			this.PayService.getUserRegisterSuperPay(this.payParam)
+				.then(response => {
+					this.handelPayMsg.vipRecordId = response.data
+					this.$api.navigateTo(`/pages/user/member/member-pay?data=${JSON.stringify(this.handelPayMsg)}`)
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 		},
 		handleCheckedPay(index, pay) {
 			// 选择会员

+ 20 - 9
pages/user/member/member.vue

@@ -139,7 +139,7 @@
 								<view class="list-none" v-if="pro.priceFlag == 2 && userIdentity == 4"
 									>¥价格仅会员可见</view
 								>
-								<view class="list-none-price" v-else>¥{{ pro.price | NumFormat }}</view>
+								<view class="list-none-price" v-else>¥{{ pro.originalPrice | NumFormat }}</view>
 							</template>
 						</view>
 					</view>
@@ -154,7 +154,7 @@
 				<view class="content">
 					<view class="title">
 						<text>购买超级会员</text>
-						<text class="iconfont icon-iconfontguanbi" @click.stop="hideTips"></text>
+						<text class="iconfont icon-iconfontguanbi" @click.stop="handelCanelBeans"></text>
 					</view>
 					<view class="text-content">
 						<view class="text"
@@ -190,14 +190,14 @@ export default {
 			userIdentity: 0,
 			userVip: {},
 			handelPayMsg: {
-				beans: 480000,
-				price: 4800,
-				month: '12个月',
-				packageId: 1
+				beans: 0,
+				price: 0,
+				month: '',
+				packageId: 0
 			},
 			payParam: {
 				userId: 0,
-				packageId: 1
+				packageId: 0
 			},
 			payList: [],
 			privilegeList: [
@@ -325,6 +325,8 @@ export default {
 						el.packageId = el.id
 					})
 					this.payList = data
+					this.handelPayMsg = data[0]
+					this.payParam.packageId = data[0].packageId
 				})
 				.catch(error => {
 					console.log('获取会员套餐异常~')
@@ -367,7 +369,9 @@ export default {
 				.then(response => {
 					this.isShowBeansModal = false
 					this.$util.msg('开通成功', 2000, true, 'success')
-					this.getUserSuperCenter()
+					setTimeout(()=>{
+						this.getUserSuperCenter()
+					},2000)
 				})
 				.catch(error => {
 					this.$util.msg(error.msg, 2000)
@@ -375,7 +379,14 @@ export default {
 		},
 		hanldWechatPay() {
 			// 跳转微信只开通超级会员
-			this.$api.navigateTo(`/pages/user/member/member-pay?data=${JSON.stringify(this.handelPayMsg)}`)
+			this.PayService.getUserRegisterSuperPay(this.payParam)
+				.then(response => {
+					this.handelPayMsg.vipRecordId = response.data
+					this.$api.navigateTo(`/pages/user/member/member-pay?data=${JSON.stringify(this.handelPayMsg)}`)
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 		},
 		handleCheckedPay(index, pay) {
 			// 选择会员

+ 11 - 0
services/pay.service.js

@@ -76,6 +76,17 @@ export default class PayService {
             isHost:true
         })
     } 
+    /**
+	 *@在线支付开通超级会员
+	 */
+    getUserRegisterSuperPay (data = {}) {
+	    return this.AjaxService.get({ 
+	        url:'/user/register/super/pay', 
+	        data, 
+	        isLoading: true,
+	        isHost:true
+	    })
+    }
     /**
 	 *@param 微信支付开通超级会员
 	 *@param  vipId  套餐ID

+ 1 - 2
services/user.service.js

@@ -433,6 +433,5 @@ export default class UserService {
             isLoading: true,
             isHost:true
         })
-    }
-	
+    }		
 }