Sfoglia il codice sorgente

订单 购物车优惠价修改

zhengjinyi 3 anni fa
parent
commit
91da79c809

+ 5 - 8
components/cm-module/cart-components/index.vue

@@ -140,6 +140,11 @@
 														{{ pros.promotions.name }}
 													</view>
 												</template>
+												<template v-if="pros.actStatus == null && pros.ladderFlag == 1">
+													<view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
+														>阶梯价格</view
+													>
+												</template>
 												<template v-if="pros.svipProductFlag == 1">
 													<view class="svip-tags">
 														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
@@ -151,14 +156,6 @@
 													</view>
 												</template>
 											</view>
-											<view
-												v-if="pros.actStatus == null && pros.ladderFlag == 1"
-												class="floor-item-act"
-											>
-												<view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
-													>阶梯价格</view
-												>
-											</view>
 										</view>
 									</view>
 								</view>

+ 39 - 30
pages/seller/cart/cart.vue

@@ -97,36 +97,45 @@
 													</view>
 												</view>
 											</view>
-											<view v-show="pros.actStatus == 1" class="floor-item-act">
-												<view
-													v-if="PromotionsFormat(pros.promotions)"
-													class="floor-tags"
-													@click.stop="clickPopupShow(pros, 1)"
-												>
-													{{ pros.promotions.name }}
-													<text v-if="pros.promotions != null && pros.promotions.type != 3">
-														:¥{{
-															pros.promotions == null
-																? '0.00'
-																: pros.promotions.touchPrice | NumFormat
-														}}
-													</text>
-												</view>
-												<view
-													v-else-if="pros.promotions.type != 3"
-													class="floor-tags"
-													@click.stop="clickPopupShow(pros, 2)"
-												>
-													{{ pros.promotions.name }}
-												</view>
-											</view>
-											<view
-												v-if="pros.actStatus == null && pros.ladderFlag == 1"
-												class="floor-item-act"
-											>
-												<view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
-													>阶梯价格</view
-												>
+											<view class="floor-item-act">
+												<template v-if="pros.actStatus == 1 && pros.promotions">
+													<view
+														v-if="PromotionsFormat(pros.promotions)"
+														class="floor-tags"
+														@click.stop="clickPopupShow(pros, 1)"
+													>
+														{{ pros.promotions.name }}
+														<text v-if="pros.promotions != null && pros.promotions.type != 3">
+															:¥{{
+																pros.promotions == null
+																	? '0.00'
+																	: pros.promotions.touchPrice | NumFormat
+															}}
+														</text>
+													</view>
+													<view
+														v-else-if="pros.promotions.type != 3"
+														class="floor-tags"
+														@click.stop="clickPopupShow(pros, 2)"
+													>
+														{{ pros.promotions.name }}
+													</view>
+												</template>
+												<template v-if="pros.actStatus == null && pros.ladderFlag == 1">
+													<view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
+														>阶梯价格</view
+													>
+												</template>
+												<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>
+												</template>
 											</view>
 										</view>
 									</view>

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

@@ -5,7 +5,7 @@
 				<view class="pay-content">
 					<view class="pay-p"><text>待付金额</text></view>
 					<view class="pay-money">
-						<text class="pay-sm">¥</text> <text class="pay-bg">{{ handelPayMsg.money | NumFormat }}</text>
+						<text class="pay-sm">¥</text> <text class="pay-bg">{{ handelPayMsg.price | NumFormat }}</text>
 					</view>
 					<view class="pay-mouth">套餐:{{ handelPayMsg.month }}</view>
 				</view>
@@ -79,7 +79,7 @@ export default {
 			buttonText: '使用微信支付',
 			btnColor: '#09BB07',
 			handelPayMsg: {},
-			payType:0,
+			payType: 0,
 			payParams: {
 				vipId: 0,
 				code: 0,
@@ -123,7 +123,7 @@ export default {
 			this.payParams.vipId = data.packageId
 			this.payParams.userId = userInfo.userId ? userInfo.userId : 0
 			this.handelPayMsg = data
-			console.log(this.payParams.code)
+			console.log(this.handelPayMsg)
 		},
 		payConfirmClick() {
 			// // 友盟埋点收集选择支付方式

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

@@ -26,12 +26,12 @@
 					@click="handleCheckedPay(index, pay)"
 				>
 					<view class="hot" v-if="index == 0">推荐</view> <view class="text-1">{{ pay.month }}</view>
-					<view class="text-2"> <text>¥</text>{{ pay.money }}</view>
-					<view class="text-3">{{ pay.text }}</view>
+					<view class="text-2"> <text>¥</text>{{ pay.price }}</view>
+					<view class="text-3" v-if="index == 0 || index == 1">{{ pay.price / pay.duration }}/月</view>
 				</view>
 			</view>
 			<view class="cm-member-button">
-				<view class="pay-btn pay" @click="hanldWechatPay">立即支付{{ handelPayMsg.money }}元开通</view>
+				<view class="pay-btn pay" @click="hanldWechatPay">立即支付{{ handelPayMsg.price }}元开通</view>
 				<view class="pay-btn none" @click="hanldeShowBeans">抵扣{{ handelPayMsg.beans }}个采美豆开通</view>
 			</view>
 		</view>
@@ -66,17 +66,13 @@ export default {
 	data() {
 		return {
 			StaticUrl: this.$Static,
-			isRequest:false,
-			isShowBeansModal:false,
-			payList: [
-				{ month: '12个月', money: 4800, packageId: 1, text: '400元/月', beans: 480000 },
-				{ month: '3个月', money: 1500, packageId: 2, text: '500元/月', beans: 150000 },
-				{ month: '1个月', money: 600, packageId: 3, text: '', beans: 60000 }
-			],
+			isRequest: false,
+			isShowBeansModal: false,
+			payList: [],
 			userVip: {},
 			handelPayMsg: {
 				beans: 480000,
-				money: 4800,
+				price: 4800,
 				month: '12个月',
 				packageId: 1
 			},
@@ -84,12 +80,14 @@ export default {
 				userId: 0,
 				packageId: 1
 			},
-			tabCurrent: 0,
+			tabCurrent: 0
 		}
 	},
-	onLoad() {},
+	onLoad() {
+		
+	},
 	filters: {
-		TypeFormat: function(value) {
+		TypeFormat(value) {
 			switch (value) {
 				case 0:
 					return '活动券'
@@ -117,8 +115,26 @@ export default {
 			const userInfo = await this.$api.getStorage()
 			this.payParam.userId = userInfo.userId ? userInfo.userId : 0
 			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
+			this.getUserSuperPackage()
 			this.getUserSuperCenter()
 		},
+		getUserSuperPackage() {
+			//获取会员中心套餐
+			this.UserService.getUserSuperPackage()
+				.then(response => {
+					let data = response.data
+					data.forEach(el => {
+						let index = el.name.lastIndexOf('-')
+						el.month = el.name.substring(index + 1, el.name.length)
+						el.beans = el.price * el.proportion
+						el.packageId = el.id
+					})
+					this.payList = data
+				})
+				.catch(error => {
+					console.log('获取会员套餐异常~')
+				})
+		},
 		getUserSuperCenter() {
 			// 获取会员中心数据
 			this.UserService.getUserSuperCenter({ userId: this.payParam.userId })
@@ -145,9 +161,9 @@ export default {
 				.then(response => {
 					this.isShowBeansModal = false
 					this.$util.msg('续费成功', 2000, true, 'success')
-					setTimeout(()=>{
+					setTimeout(() => {
 						this.$api.navigateTo('/pages/user/member/member')
-					},2000)
+					}, 2000)
 				})
 				.catch(error => {
 					this.$util.msg(error.msg, 2000)

+ 21 - 24
pages/user/member/member.vue

@@ -34,13 +34,13 @@
 					:class="{ current: tabCurrent === index }"
 					@click="handleCheckedPay(index, pay)"
 				>
-					<view class="hot" v-if="index == 0">推荐</view> <view class="text-1">{{ pay.month }}</view>
-					<view class="text-2"> <text>¥</text>{{ pay.money }}</view>
-					<view class="text-3">{{ pay.text }}</view>
+					<view class="hot" v-if="index == 0">推荐</view> <view class="text-1">{{ pay.duration }}个月</view>
+					<view class="text-2"> <text>¥</text>{{ pay.price }}</view>
+					<view class="text-3" v-if="index == 0 || index == 1">{{ pay.price / pay.duration }}/月</view>
 				</view>
 			</view>
 			<view class="cm-member-button">
-				<view class="pay-btn pay" @click="hanldWechatPay">立即支付{{ handelPayMsg.money }}元开通</view>
+				<view class="pay-btn pay" @click="hanldWechatPay">立即支付{{ handelPayMsg.price }}元开通</view>
 				<view class="pay-btn none" @click="hanldeShowBeans">抵扣{{ handelPayMsg.beans }}个采美豆开通</view>
 			</view>
 		</view>
@@ -123,16 +123,11 @@
 									<template v-if="pro.priceFlag != 1 && userIdentity == 2">
 										<view class="svip-tags">
 											<view class="tags">SVIP</view>
-											<view
-												class="price"
-												>{{ pro.svipPriceTag }}</view
-											>
+											<view class="price">{{ pro.svipPriceTag }}</view>
 										</view>
 									</template>
 									<template v-else>
-										<view class="svip-tags">
-											<view class="tags none">SVIP</view>
-										</view>
+										<view class="svip-tags"> <view class="tags none">SVIP</view> </view>
 									</template>
 								</template>
 							</view>
@@ -140,7 +135,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">¥价格仅会员可见</view>
+								<view class="list-none" v-if="pro.priceFlag == 2 && userIdentity == 4"
+									>¥价格仅会员可见</view
+								>
 								<view class="list-none-price" v-else>¥{{ pro.price | NumFormat }}</view>
 							</template>
 						</view>
@@ -184,16 +181,16 @@ export default {
 	data() {
 		return {
 			StaticUrl: this.$Static,
-			isRequest:false,
+			isRequest: false,
 			isModallayer: false,
 			isShowBeansModal: false,
 			memberType: 0,
 			tabCurrent: 0,
-			userIdentity:0,
+			userIdentity: 0,
 			userVip: {},
 			handelPayMsg: {
 				beans: 480000,
-				money: 4800,
+				price: 4800,
 				month: '12个月',
 				packageId: 1
 			},
@@ -201,11 +198,7 @@ export default {
 				userId: 0,
 				packageId: 1
 			},
-			payList: [
-				{ month: '12个月', money: 4800, packageId: 1, text: '400元/月', beans: 480000 },
-				{ month: '3个月', money: 1500, packageId: 2, text: '500元/月', beans: 150000 },
-				{ month: '1个月', money: 600, packageId: 3, text: '', beans: 60000 }
-			],
+			payList: [],
 			privilegeList: [
 				{
 					icon: 'https://static.caimei365.com/app/img/icon/icon-member-prer1@2x.png',
@@ -290,7 +283,7 @@ export default {
 	methods: {
 		async initGetStotage() {
 			const userInfo = await this.$api.getStorage()
-			this.payParam.userId = this.listQuery.userId =userInfo.userId ? userInfo.userId : 0
+			this.payParam.userId = this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
 			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
 			this.getUserSuperCenter()
 		},
@@ -319,15 +312,19 @@ export default {
 					this.$util.msg(error.msg, 2000)
 				})
 		},
-		getUserSuperPackage(){
+		getUserSuperPackage() {
 			//获取会员中心套餐
 			this.UserService.getUserSuperPackage()
 				.then(response => {
 					let data = response.data
-					
+					data.forEach(el => {
+						el.beans = el.price * el.proportion
+						el.packageId = el.id
+					})
+					this.payList = data
 				})
 				.catch(error => {
-					this.$util.msg(error.msg, 2000)
+					console.log('获取会员套餐异常~')
 				})
 		},
 		hanldeShowBeans() {