Przeglądaj źródła

commit -m 超级会员中心 测试问题修复

zhengjinyi 3 lat temu
rodzic
commit
49946be34b

+ 22 - 6
components/cm-module/cart-components/index.vue

@@ -417,6 +417,10 @@
 							<view class="tui-popup-text left">优惠券</view>
 							<view class="tui-popup-text right bold red">-¥{{ couponPrice | NumFormat }}</view>
 						</view>
+						<view class="tui-popup-h1" v-if="svipReducedPrice > 0">
+							<view class="tui-popup-text left">超级会员优惠</view>
+							<view class="tui-popup-text right bold red">-¥{{ svipReducedPrice | NumFormat }}</view>
+						</view>
 						<view class="tui-popup-h1">
 							<view class="tui-popup-text left bold">共减</view>
 							<view class="tui-popup-text right bold red">-¥{{ totalDiscountAmount | NumFormat }}</view>
@@ -477,11 +481,12 @@ export default {
 			setGoodData: '', // 确认订单的商品
 			isCheckAll: false, // 是否全选
 			kindCount: 0, // 购物车宝贝数量
-			totalAmount: 0, //商品最终合计总价
+			totalAmount: 0, // 商品最终合计总价
 			allPrice: 0, // 所有价格
 			totalOriginalPrice: 0, // 所有原价价
-			reducedPrice: 0, // 满减
+			reducedPrice: 0, // 促销满减
 			couponPrice: 0, // 优惠金额
+			svipReducedPrice: 0, // 超级会员优惠金额
 			totalDiscountAmount: 0, // 总共减去金额
 			isDiscount: false, // 控制显示优惠明细
 			allCount: 0, // 被选中的产品数量
@@ -822,6 +827,8 @@ export default {
 			let totalPrice = 0
 			let reducedPrice = 0
 			let originalPrice = 0
+			let svipReducedPrice = 0
+			let totalAmount = 0
 			this.goodsList.forEach((item, index) => {
 				let supplierPrice = 0
 				let supplierReducedPrice = 0
@@ -831,6 +838,13 @@ export default {
 				item.cartList.forEach(pros => {
 					if (pros.isChecked) {
 						supplierPrice += pros.price * pros.number
+						svipReducedPrice += item.svipReducedPrice
+						if( pros.svipProductFlag == 1 ){
+							totalAmount += item.originalPrice
+						}else{
+							item.totalprice = supplierPrice
+							totalAmount += item.totalprice
+						}
 						// 单品满减
 						if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
 							// 单品满减-重新计算供应商总价/满减金额
@@ -855,7 +869,7 @@ export default {
 				totalPrice += item.totalprice
 				reducedPrice += item.reducedprice
 				originalPrice += item.originalprice
-				this.totalAmount = totalPrice
+				this.totalAmount = totalAmount
 			})
 			// 总促销计算
 			this.promotionsList.forEach(promotions => {
@@ -873,6 +887,8 @@ export default {
 					}
 				}
 			})
+			// 最后勾选的超级会员优惠价
+			this.svipReducedPrice = svipReducedPrice
 			// 最后统计商品原价
 			this.totalOriginalPrice = originalPrice
 			// 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
@@ -893,9 +909,9 @@ export default {
 					this.couponPrice = 0
 				}
 			}
-			// 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
-			this.totalDiscountAmount = this.reducedPrice + this.couponPrice
-			console.log('总共减去优惠金额', this.totalDiscountAmount)
+			// 最终优惠金额 = 促销优惠金额 + 优惠券优惠金额 + 超级会员优惠金额 
+			this.totalDiscountAmount = this.reducedPrice + this.couponPrice + this.svipReducedPrice
+			console.log('最终优惠金额', this.totalDiscountAmount)
 			// 控制显示优惠明细
 			if (this.totalDiscountAmount > 0) {
 				this.isDiscount = true

+ 1 - 1
components/cm-module/orderDetails/goodsList.vue

@@ -173,7 +173,7 @@ export default {
 			if (pros.validFlag == 9) {
 				return
 			} else {
-				this.$api.navigateTo(`/pages/goods/product?id=${pros.productID}`)
+				this.$api.navigateTo(`/pages/goods/product?id=${pros.productId}`)
 			}
 		},
 		clickPopupShow(pros) {

+ 16 - 50
components/cm-module/pageTemplate/templatePrice.vue

@@ -2,23 +2,15 @@
 	<!-- 楼层价格显示公共组件 -->
 	<view>
 		<template v-if="vipFlag == 1">
-			<view class="title-none" v-if="goods.priceFlag === 1">
-				<text class="p big">¥未公开价格</text>
-			</view>
+			<view class="title-none" v-if="goods.priceFlag === 1"> <text class="p big">¥未公开价格</text> </view>
 			<view
 				class="price tui-skeleton-rect"
 				v-else
-				:class="
-					PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
-						? 'none'
-						: ''
-				"
+				:class="PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1 ? 'none' : ''"
 			>
 				<text class="p sm">¥</text>
 				<text class="p big">{{
-					(PromotionsFormat(goods.promotions)
-						? goods.originalPrice
-						: goods.price) | NumFormat
+					(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
 				}}</text>
 			</view>
 		</template>
@@ -32,18 +24,11 @@
 					<view
 						class="price tui-skeleton-rect"
 						v-else
-						:class="
-							PromotionsFormat(goods.promotions) ||
-							goods.svipProductFlag == 1
-								? 'none'
-								: ''
-						"
+						:class="PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1 ? 'none' : ''"
 					>
 						<text class="p sm">¥</text>
 						<text class="p big">{{
-							(PromotionsFormat(goods.promotions)
-								? goods.originalPrice
-								: goods.price) | NumFormat
+							(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
 						}}</text>
 					</view>
 				</template>
@@ -51,58 +36,39 @@
 					<view class="no-price">
 						<view class="p-stars">
 							<text class="p-no">¥</text>
-							<uni-grader
-								:grade="Number(goods.priceGrade)"
-								:margin="14"
-							></uni-grader>
+							<uni-grader :grade="Number(goods.priceGrade)" :margin="14"></uni-grader>
 						</view>
 					</view>
 				</template>
 			</template>
 			<!-- 个人机构查看价格 -->
 			<template v-else-if="userIdentity === 4">
-				<view class="title-none" v-if="goods.priceFlag === 1">
-					<text class="p big">¥未公开价格</text>
-				</view>
+				<view class="title-none" v-if="goods.priceFlag === 1"> <text class="p big">¥未公开价格</text> </view>
 				<view class="title-none" v-if="goods.priceFlag === 2">
 					<text class="p big">¥价格仅会员可见</text>
 				</view>
 				<view
 					class="price tui-skeleton-rect"
 					v-if="goods.priceFlag === 0"
-					:class="
-						PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
-							? 'none'
-							: ''
-					"
+					:class="PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1 ? 'none' : ''"
 				>
 					<text class="p sm">¥</text>
 					<text class="p big">{{
-						(PromotionsFormat(goods.promotions)
-							? goods.originalPrice
-							: goods.price) | NumFormat
+						(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
 					}}</text>
 				</view>
 			</template>
 			<!-- 协销和会员机构查看价格 -->
 			<template v-else>
-				<view class="title-none" v-if="goods.priceFlag === 1">
-					<text class="p big">¥未公开价格</text>
-				</view>
+				<view class="title-none" v-if="goods.priceFlag === 1"> <text class="p big">¥未公开价格</text> </view>
 				<view
 					class="price tui-skeleton-rect"
 					v-else
-					:class="
-						PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1
-							? 'none'
-							: ''
-					"
+					:class="PromotionsFormat(goods.promotions) || goods.svipProductFlag == 1 ? 'none' : ''"
 				>
 					<text class="p sm">¥</text>
 					<text class="p big">{{
-						(PromotionsFormat(goods.promotions)
-							? goods.originalPrice
-							: goods.price) | NumFormat
+						(PromotionsFormat(goods.promotions) ? goods.originalPrice : goods.price) | NumFormat
 					}}</text>
 				</view>
 			</template>
@@ -161,11 +127,11 @@ export default {
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			this.goods = data
 		},
-		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
 				}
 			}

+ 5 - 9
components/cm-module/pageTemplate/templateTags.vue

@@ -42,11 +42,7 @@
 			<template v-if="goods.svipProductFlag == 1">
 				<view class="svip-tags">
 					<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
-					<view
-						class="price"
-						v-if="isShowVipFlag(goods)"
-						>{{ goods.svipPriceTag }}</view
-					>
+					<view class="price" v-if="isShowVipFlag(goods)">{{ goods.svipPriceTag }}</view>
 				</view>
 			</template>
 		</template>
@@ -101,11 +97,11 @@ export default {
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			this.goods = data
 		},
-		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
 				}
 			}

+ 1 - 0
pages/seller/remarks/add.vue

@@ -208,6 +208,7 @@ page {
 	height: auto;
 	box-sizing: border-box;
 	padding: 0 24rpx;
+	padding-bottom: 160rpx;
 	.list-view-title {
 		width: 100%;
 		height: auto;

+ 1 - 0
pages/seller/remarks/details.vue

@@ -133,6 +133,7 @@ page {
 	height: auto;
 	box-sizing: border-box;
 	padding: 0 24rpx;
+	padding-bottom: 80rpx;
 	.list-view-title {
 		width: 100%;
 		height: auto;

+ 61 - 35
pages/tabBar/user/user.vue

@@ -24,11 +24,14 @@
 						>
 						<view class="user-item">
 							<view class="user-item-tips vip" v-if="userIdentity == 2">
-								<image class="tips-icon"  :src="StaticUrl + '/icon/icon-member-svip@2x.png'" mode=""></image>
-								{{ userType }}
+								<image class="tips-icon" :src="userVipIcon" mode=""></image> {{ userType }}
 							</view>
-							<view class="user-item-tips" v-if="userIdentity == 4">
-								<image class="tips-icon"  :src="StaticUrl + '/icon/icon-member-vip@2x.png'" mode=""></image>
+							<view
+								class="user-item-tips"
+								v-if="userIdentity == 4"
+								:class="userVip.vipFlag == 0 ? 'none' : ''"
+							>
+								<image class="tips-icon" v-if="userVip.vipFlag == 1" :src="userVipIcon" mode=""></image>
 								{{ userType }}
 							</view>
 						</view>
@@ -58,21 +61,29 @@
 							<view class="main-member-none-btn">立即开通</view>
 						</view>
 						<template v-else>
-							<view class="main-member-svip"  v-if="userVip.vipFlag == 1" @click="navigator('/pages/user/member/member')">
+							<view
+								class="main-member-svip"
+								v-if="userVip.vipFlag == 1"
+								@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-icon">
-									<text class="iconfont icon-xiayibu"></text>
-								</view>
+								<view class="main-member-svip-icon"> <text class="iconfont icon-xiayibu"></text> </view>
 							</view>
-							<view class="main-member-svip" v-if="userVip.vipFlag == -1" @click="navigator('/pages/user/member/member')">
+							<view
+								class="main-member-svip"
+								v-if="userVip.vipFlag == -1"
+								@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-icon">
-									<text class="iconfont icon-xiayibu"></text>
-								</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')">
+							<view
+								class="main-member-none"
+								v-if="userVip.vipFlag == 0"
+								@click="navigator('/pages/user/member/member')"
+							>
 								<view class="main-member-none-text">开通采美·超级会员,享专属特权</view>
 								<view class="main-member-none-btn">立即开通</view>
 							</view>
@@ -85,7 +96,10 @@
 								<view class="main-account-text">我的资产</view>
 							</view>
 							<view class="main-account-ri">
-								<view class="main-account-ri-view account" @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>
@@ -100,7 +114,10 @@
 									<view class="main-account-icon none" v-else>-</view>
 									<view class="main-account-text">采美豆</view>
 								</view>
-								<view class="main-account-ri-view coupon" @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>
@@ -388,11 +405,11 @@ export default {
 			isModify: false,
 			isActivityBean: false,
 			isCmcustom: false,
-			bgImgUrl: 'https://img.caimei365.com/group1/M00/03/B0/Cmis217Z_i6ASHobAAhl69yz3SM078.png',
+			userVipIcon: '',
 			name: '',
 			userType: '',
 			headpic: '',
-			userVip:{},// 超级会员信息
+			userVip: {}, // 超级会员信息
 			userBeans: 0,
 			userMoney: '0.00',
 			couponNum: 0,
@@ -403,13 +420,13 @@ export default {
 			bindMobile: '',
 			isSvip: false,
 			isSvipType: 2,
-			clubStatus: '', 		// 机构升级资质机构审核状态1:待审核  91:审核失败
-			userIdentity: '', 		// 机构等级
-			confirmedCount: 0,  	// 待确认
-			paymentCount: 0, 		// 待付款角标
-			waitShipmentsCount: 0,  // 待收货角标
-			shipmentsCount: 0, 		// 已发货角标
-			salesReturnCount: '', 	// 退货/款角标
+			clubStatus: '', // 机构升级资质机构审核状态1:待审核  91:审核失败
+			userIdentity: '', // 机构等级
+			confirmedCount: 0, // 待确认
+			paymentCount: 0, // 待付款角标
+			waitShipmentsCount: 0, // 待收货角标
+			shipmentsCount: 0, // 已发货角标
+			salesReturnCount: '', // 退货/款角标
 			firstList: [
 				{
 					name: '运营人员管理',
@@ -455,6 +472,11 @@ export default {
 						this.userType = '个人机构'
 					}
 					this.userVip = data.vip // 超级会员信息
+					if (this.userVip.vipFlag == 1) {
+						this.userVipIcon = this.StaticUrl + '/icon/icon-member-svip@2x.png'
+					} else {
+						this.userVipIcon = this.StaticUrl + '/icon/icon-member-vip@2x.png'
+					}
 					this.userBeans = data.user.userBeans // 采美豆数量
 					this.headpic = data.user.image // 会所头像
 					this.bindMobile = data.user.bindMobile // 登录手机号
@@ -667,25 +689,29 @@ page {
 			flex: 1;
 			height: 64rpx;
 			line-height: 64rpx;
-			.user-item-tips{
+			.user-item-tips {
 				display: inline-block;
 				float: left;
 				width: 140rpx;
 				height: 34rpx;
-				background: #E7EAEF;
+				background: #e7eaef;
 				border-radius: 20rpx;
 				line-height: 34rpx;
 				font-size: $font-size-22;
 				text-align: center;
 				color: #627386;
 				box-sizing: border-box;
-				padding:0 11rpx 0 41rpx;
+				padding: 0 11rpx 0 41rpx;
 				position: relative;
-				&.vip{
-					background: #FFF2D5;
-					color: #E4AA43;
+				&.none {
+					width: 120rpx;
+					padding: 0 11rpx 0 11rpx;
+				}
+				&.vip {
+					background: #fff2d5;
+					color: #e4aa43;
 				}
-				.tips-icon{
+				.tips-icon {
 					width: 34rpx;
 					height: 34rpx;
 					display: block;
@@ -814,7 +840,7 @@ page {
 			width: 100%;
 			height: 88rpx;
 			box-sizing: border-box;
-			padding:28rpx 0 20rpx 0;
+			padding: 28rpx 0 20rpx 0;
 			line-height: 40rpx;
 			.main-member-none-text {
 				font-size: $font-size-26;
@@ -929,13 +955,13 @@ page {
 			.main-account-ri-view {
 				height: 100%;
 				float: left;
-				&.account{
+				&.account {
 					width: 40%;
 				}
-				&.beans{
+				&.beans {
 					width: 32%;
 				}
-				&.coupon{
+				&.coupon {
 					width: 28%;
 				}
 				.main-account-icon {

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

@@ -80,6 +80,7 @@ export default {
 			btnColor: '#09BB07',
 			handelPayMsg: {},
 			payType: 0,
+			isPaySwitch: true,
 			payParams: {
 				code: 0,
 				vipRecordId: 0
@@ -123,7 +124,25 @@ export default {
 			this.handelPayMsg = data
 			console.log(this.handelPayMsg)
 		},
+		PayOrderOnLineSwitch() {
+			// 线上支付开关
+			this.PayService.PayOrderOnLineSwitch()
+				.then(response => {
+					if (response.data === 0) {
+						this.isPaySwitch = true
+					} else {
+						this.isPaySwitch = false
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
 		payConfirmClick() {
+			if (this.isPaySwitch) {
+				this.$util.msg('支付系统遇到点小问题,请稍后重试')
+				return
+			}
 			// // 友盟埋点收集选择支付方式
 			// if(process.env.NODE_ENV != 'development'){
 			// 	this.$uma.trackEvent('Um_Event_ChooseWechatPay', {
@@ -134,13 +153,13 @@ export default {
 			// 	})
 			// }
 			switch (this.tabCurrentIndex) {
-				case 0:
+				case 0: // 微信小程序支付
 					this.MiniWxPayFor()
 					break
-				case 1:
+				case 1: // 生成企业网银链接
 					this.BuildCatenate()
 					break
-				case 2:
+				case 2: // 生成个人网银链接
 					this.BuildCatenate()
 					break
 			}

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

@@ -71,10 +71,10 @@ export default {
 		return {
 			StaticUrl: this.$Static,
 			isModallayer: false,
-			banner: 'https://img.caimei365.com/group1/M00/00/28/rB-lGGE4XKWADKAdAANR7wZz3OQ936.jpg',
+			banner: '',
 			listQuery: {
 				userId: 0,
-				source: 1,
+				source: 2,
 				pageNum: 1,
 				pageSize: 10
 			},

+ 30 - 15
pages/user/member/member.vue

@@ -53,7 +53,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="cm-member-main">
+		<view class="cm-member-main" v-show="productCouponList.length>0">
 			<view class="title">专属优惠券<text class="small">每月可领4个</text></view>
 			<view class="cm-member-coupon clearfix">
 				<view
@@ -61,6 +61,7 @@
 					:key="index"
 					:id="coupon.couponId"
 					class="coupon-list"
+					:class="coupon.useStatus == 2 ? 'none' : ''"
 				>
 					<view class="list-cell-tags">{{ coupon.couponType | TypeFormat }}</view>
 					<view class="list-cell-le">
@@ -82,17 +83,25 @@
 						</view>
 					</view>
 					<view class="list-cell-ri">
-						<view class="icon-used-btn receive" v-if="coupon.getFlag == 0" @click="receiveCoupon(coupon)"
-							>立即领取</view
-						>
-						<view class="icon-used-btn make" v-if="coupon.getFlag == 1" @click="toUseCoupon(coupon)"
-							>去使用</view
-						>
+						<template v-if="coupon.useStatus == 2">
+							<view class="icon-used-btn make" @click="toUseCoupon(coupon)">已使用</view>
+						</template>
+						<template v-else>
+							<view
+								class="icon-used-btn receive"
+								v-if="coupon.getFlag == 0"
+								@click="receiveCoupon(coupon)"
+								>立即领取</view
+							>
+							<view class="icon-used-btn make" v-if="coupon.getFlag == 1" @click="toUseCoupon(coupon)"
+								> 去使用</view
+							>
+						</template>
 					</view>
 				</view>
 			</view>
 		</view>
-		<view class="cm-member-main none" :style="{ paddingBottom: popupShow ? '240rpx' : '0rpx' }">
+		<view class="cm-member-main none" :style="{ paddingBottom: popupShow ? '260rpx' : '0rpx' }">
 			<view class="title">
 				优惠商品
 				<view class="more" @click="hanldPayUrl('/pages/user/member/member-product')"
@@ -131,7 +140,9 @@
 						<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
+									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>
@@ -265,7 +276,7 @@ export default {
 		this.getUserSuperPackage()
 	},
 	filters: {
-		TypeFormat: function(value) {
+		TypeFormat(value) {
 			switch (value) {
 				case 0:
 					return '活动券'
@@ -284,10 +295,10 @@ export default {
 					break
 			}
 		},
-		NumFormat: function(text) {
+		NumFormat(value) {
 			//处理金额
-			return Number(text).toFixed(2)
-		}
+			return Number(value).toFixed(2)
+		},
 	},
 	computed: {
 		...mapState(['hasLogin', 'userInfo', 'identity', 'isActivity'])
@@ -469,11 +480,11 @@ export default {
 					return true
 				}
 			}
-		}
+		},
 	},
 	onPageScroll(e) {
 		//实时获取到滚动的值
-		if(this.userVip.vipFlag == 0){
+		if (this.userVip.vipFlag == 0) {
 			if (e.scrollTop > 400) {
 				this.popupShow = true
 			} else {
@@ -723,6 +734,10 @@ page {
 			&:nth-child(2n) {
 				margin-right: 0;
 			}
+			&.none{
+				background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon-none@2x.png);
+				background-size: cover;
+			}
 			.list-cell-tags {
 				display: inline-block;
 				padding: 0 10rpx;