lsx il y a 2 ans
Parent
commit
f2c2cc762f

+ 196 - 190
src/packageGoods/ticket/index.vue

@@ -1,190 +1,196 @@
-<template>
-	<view>
-		<!-- #ifdef MP-ALIPAY -->
-		<!-- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票列表" leftIconSize="0"> -->
-		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="商品列表" leftIconSize="0">
-		</u-navbar>
-		<!-- #endif -->
-		<!-- #ifdef MP-WEIXIN -->
-		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="商品列表"></u-navbar>
-		<!-- #endif -->
-		<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
-		<view v-if="pagesNum > 1">
-			<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="商品列表" />
-		</view>
-		<view v-else>
-			<u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :border="true" title="商品列表">
-				<view class="nav-left flex" slot="left" @click="$toIndex()">
-					<u-icon name="arrow-left" size="20" color="#333"></u-icon>
-				</view>
-			</u-navbar>
-		</view>
-		<!-- #endif -->
-		<view class="ticket-box">
-			<view class="flex ticket-box-list">
-				<!-- <navigator :url="`/pages/ticketBox/detail?boxId=${ item.boxId }`" class="flex ticket-box-list-item"
-					hover-class="navigator-hover" v-for="(item, index) in list" :key="index"> -->
-				<navigator :url="JSON.parse(item.refType).value === 'goods' ? `/packagePrize/goods/index?id=${ item.refId }&boxId=${ item.boxId }`:JSON.parse(item.refType).value === 'coin' ?`/packagePrize/goods/index?id=424&boxId=${ item.boxId }`:`/packagePrize/goods/index?id=425&boxId=${ item.boxId }`" class="flex ticket-box-list-item"
-					hover-class="navigator-hover" v-for="(item, index) in list" :key="index">
-					<image :src="item.picUrl" mode="aspectFill"></image>
-					<view class="info">
-						<!-- #ifdef MP-ALIPAY -->
-						<view class="titletwo">{{ item.title }}</view>
-						<!-- #endif -->
-						<!-- #ifndef MP-ALIPAY -->
-						<view class="titletwo">{{ item.title }}</view>
-						<!-- #endif -->
-
-						<view class="price">¥{{ $numberFormat(item.salePrice) }}</view>
-					</view>
-				</navigator>
-				<view style="width: 100%;">
-					<u-loadmore :line="true" v-if="list.length>8" :status="status" :loading-text="'努力加载中'"
-						:nomore-text="'已经到底了'" />
-				</view>
-			</view>
-			<view class="flex empty" v-if="!list.length">
-				<view class="center">
-					<image class="center-img"
-						src="https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/nodata_3.png"
-						mode="scaleToFill"></image>
-					<view class="center-font">还没有商品</view>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import env from '../../config/env.js'
-	import $http from '@/utils/request.js'
-	export default {
-		data() {
-			return {
-				status: 'nomore', //上拉刷新状态
-				pageNum: 1,
-				total: 0,
-				list: [],
-				ids: [],
-				pagesNum: '',
-			};
-		},
-		onShow() {
-			this.pagesNum = getCurrentPages().length
-		},
-		onLoad(options) {
-			if (options.ids) {
-				this.ids = JSON.parse(options.ids)
-			}
-			this.getList()
-		},
-		methods: {
-			getList() {
-				let data = {
-					categoryId: '',
-					tagId: '',
-					type: 'online',
-					noToken: true,
-					boxIds: this.ids,
-					salePriceSort: 1,
-				}
-				$http.post(`/api/v1/mp/user/mall/ticket/goods/list?pageNum=${this.pageNum}&pageSize=20`, data).then(
-					res => {
-						if (res.code == 0) {
-							res.rows.forEach(item => {
-								let picUrlArr = item.picUrl.split(',')
-								item.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/750'
-							})
-							this.total = res.total
-							this.list = this.list.concat(res.rows)
-						}
-					}).catch(() => {
-				})
-			},
-		},
-
-		onReachBottom() {
-			if (this.total < this.pageNum * 20) return;
-			this.status = 'loading';
-			++this.pageNum
-			if (this.total < this.pageNum * 20) this.status = 'nomore';
-			else this.status = 'loading';
-			this.getList()
-		},
-	}
-</script>
-
-<style lang="scss">
-	.ticket-box {
-		margin: 34rpx 0;
-
-		&-list {
-			justify-content: space-between;
-			padding: 0 34rpx;
-			flex-wrap: wrap;
-			padding-bottom: 100rpx;
-
-			&-item {
-				flex-direction: column;
-				box-sizing: border-box;
-				padding: 12rpx;
-				width: 330rpx;
-				border-radius: 22rpx;
-				margin-bottom: 34rpx;
-				background-color: #FFFFFF;
-
-				image {
-					width: 300rpx;
-					height: 240rpx;
-					border-radius: 22rpx;
-					margin-bottom: 34rpx;
-				}
-
-				.info {
-					width: 100%;
-				}
-
-				.titletwo {
-					width: 100%;
-					line-height: 40rpx;
-					height: 40rpx;
-					font-size: 36rpx;
-					font-weight: bold;
-					white-space: nowrap;
-					overflow: hidden;
-					text-overflow: ellipsis;
-				}
-
-				.price {
-					font-size: 26rpx;
-					font-weight: bold;
-					margin-top: 20rpx;
-					color: #FF4208;
-					line-height: 42rpx;
-					margin-bottom: 24rpx;
-				}
-			}
-
-		}
-
-		.empty {
-			height: 50vh;
-
-			.center {
-				text-align: center;
-
-				&-img {
-					width: 228rpx;
-					height: 320rpx;
-				}
-
-				&-font {
-					font-size: 30rpx;
-					font-weight: 400;
-					color: #999999;
-					margin-bottom: 250rpx;
-				}
-			}
-		}
-	}
-</style>
+<template>
+	<view>
+		<!-- #ifdef MP-ALIPAY -->
+		<!-- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票列表" leftIconSize="0"> -->
+		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="商品列表" leftIconSize="0">
+		</u-navbar>
+		<!-- #endif -->
+		<!-- #ifdef MP-WEIXIN -->
+		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="商品列表"></u-navbar>
+		<!-- #endif -->
+		<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
+		<view v-if="pagesNum > 1">
+			<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="商品列表" />
+		</view>
+		<view v-else>
+			<u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :border="true" title="商品列表">
+				<view class="nav-left flex" slot="left" @click="$toIndex()">
+					<u-icon name="arrow-left" size="20" color="#333"></u-icon>
+				</view>
+			</u-navbar>
+		</view>
+		<!-- #endif -->
+		<view class="ticket-box">
+			<view class="flex ticket-box-list">
+				<!-- <navigator :url="`/pages/ticketBox/detail?boxId=${ item.boxId }`" class="flex ticket-box-list-item"
+					hover-class="navigator-hover" v-for="(item, index) in list" :key="index"> -->
+				<navigator @click="couponStorage(item)"
+					:url="JSON.parse(item.refType).value === 'goods' ? `/packagePrize/goods/index?id=${ item.refId }&boxId=${ item.boxId }`:JSON.parse(item.refType).value === 'coin' ?`/packagePrize/goods/index?id=424&boxId=${ item.boxId }`:`/packagePrize/goods/index?id=425&boxId=${ item.boxId }`"
+					class="flex ticket-box-list-item" hover-class="navigator-hover" v-for="(item, index) in list" :key="index">
+					<image :src="item.picUrl" mode="aspectFill"></image>
+					<view class="info">
+						<!-- #ifdef MP-ALIPAY -->
+						<view class="titletwo">{{ item.title }}</view>
+						<!-- #endif -->
+						<!-- #ifndef MP-ALIPAY -->
+						<view class="titletwo">{{ item.title }}</view>
+						<!-- #endif -->
+
+						<view class="price">¥{{ $numberFormat(item.salePrice) }}</view>
+					</view>
+				</navigator>
+				<view style="width: 100%;">
+					<u-loadmore :line="true" v-if="list.length>8" :status="status" :loading-text="'努力加载中'"
+						:nomore-text="'已经到底了'" />
+				</view>
+			</view>
+			<view class="flex empty" v-if="!list.length">
+				<view class="center">
+					<image class="center-img" src="https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/nodata_3.png"
+						mode="scaleToFill"></image>
+					<view class="center-font">还没有商品</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import env from '../../config/env.js'
+	import $http from '@/utils/request.js'
+	export default {
+		data() {
+			return {
+				status: 'nomore', //上拉刷新状态
+				pageNum: 1,
+				total: 0,
+				list: [],
+				ids: [],
+				pagesNum: '',
+			};
+		},
+		onShow() {
+			this.pagesNum = getCurrentPages().length
+		},
+		onLoad(options) {
+			if (options.ids) {
+				this.ids = JSON.parse(options.ids)
+			}
+			this.getList()
+		},
+		methods: {
+			getList() {
+				let data = {
+					categoryId: '',
+					tagId: '',
+					type: 'online',
+					noToken: true,
+					boxIds: this.ids,
+					salePriceSort: 1,
+				}
+				$http.post(`/api/v1/mp/user/mall/ticket/goods/list?pageNum=${this.pageNum}&pageSize=20`, data).then(
+					res => {
+						if (res.code == 0) {
+							res.rows.forEach(item => {
+								let picUrlArr = item.picUrl.split(',')
+								item.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/750'
+							})
+							this.total = res.total
+							this.list = this.list.concat(res.rows)
+						}
+					}).catch(() => {})
+			},
+			couponStorage(item) {
+				if (item.refType && JSON.parse(item.refType).value === 'coupon' || JSON.parse(item.refType).value === 'coupon_pkg') {
+					if (item.couponDetail) {
+						uni.setStorageSync('couponDetail', item.couponDetail);
+					}
+				}
+			}
+		},
+
+		onReachBottom() {
+			if (this.total < this.pageNum * 20) return;
+			this.status = 'loading';
+			++this.pageNum
+			if (this.total < this.pageNum * 20) this.status = 'nomore';
+			else this.status = 'loading';
+			this.getList()
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.ticket-box {
+		margin: 34rpx 0;
+
+		&-list {
+			justify-content: space-between;
+			padding: 0 34rpx;
+			flex-wrap: wrap;
+			padding-bottom: 100rpx;
+
+			&-item {
+				flex-direction: column;
+				box-sizing: border-box;
+				padding: 12rpx;
+				width: 330rpx;
+				border-radius: 22rpx;
+				margin-bottom: 34rpx;
+				background-color: #FFFFFF;
+
+				image {
+					width: 300rpx;
+					height: 240rpx;
+					border-radius: 22rpx;
+					margin-bottom: 34rpx;
+				}
+
+				.info {
+					width: 100%;
+				}
+
+				.titletwo {
+					width: 100%;
+					line-height: 40rpx;
+					height: 40rpx;
+					font-size: 36rpx;
+					font-weight: bold;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+
+				.price {
+					font-size: 26rpx;
+					font-weight: bold;
+					margin-top: 20rpx;
+					color: #FF4208;
+					line-height: 42rpx;
+					margin-bottom: 24rpx;
+				}
+			}
+
+		}
+
+		.empty {
+			height: 50vh;
+
+			.center {
+				text-align: center;
+
+				&-img {
+					width: 228rpx;
+					height: 320rpx;
+				}
+
+				&-font {
+					font-size: 30rpx;
+					font-weight: 400;
+					color: #999999;
+					margin-bottom: 250rpx;
+				}
+			}
+		}
+	}
+</style>

+ 10 - 3
src/packageOperate/activity/index.vue

@@ -61,7 +61,7 @@
 					v-if="item.name == '一等奖'">
 					<view class="wrap-fixed-effectstwo">
 						<view class="effectsthree">
-							<navigator
+							<navigator @click="couponStorage(itemTwo)"
 								:url="itemTwo.prizeType && JSON.parse(itemTwo.prizeType).value == 'goods' ? `/packagePrize/goods/detail?id=${ itemTwo.refId }`:JSON.parse(itemTwo.prizeType).value == 'coin' ?`/packagePrize/goods/detail?id=424`:`/packagePrize/goods/detail?id=425`"
 								hover-class="none">
 								<view class="effectsthree-width">
@@ -106,7 +106,7 @@
 							<view style="padding-top: 120rpx;"></view>
 							<view class="effectsthree-positionTwo" v-for="(itemTwo,index1) in item.prizeList"
 								:key="index1">
-								<navigator
+								<navigator @click="couponStorage(itemTwo)"
 									:url="JSON.parse(itemTwo.prizeType).value == 'goods' ? `/packagePrize/goods/detail?id=${ itemTwo.refId }`:JSON.parse(itemTwo.prizeType).value == 'coin' ?`/packagePrize/goods/detail?id=424`:`/packagePrize/goods/detail?id=425`"
 									hover-class="none">
 									<view class="flex justify">
@@ -417,6 +417,13 @@
 			//跳转微信小程序
 			toWeChatProgram() {
 				// location.href = 'weixin://dl/business/?t=xxxxxx'
+			},
+			couponStorage(item) {
+				if (item.prizeType && JSON.parse(item.prizeType).value === 'coupon' || JSON.parse(item.prizeType).value === 'coupon_pkg') {
+					if (item.couponDetail) {
+						uni.setStorageSync('couponDetail', item.couponDetail);
+					}
+				}
 			},
 
 			getBaseInfo() {
@@ -428,7 +435,7 @@
 						this.userInfo = res.data
 					}
 				})
-			},
+			}
 		},
 		onShareAppMessage(res) {
 			return {

+ 263 - 0
src/packageOperate/exchange/index.vue

@@ -0,0 +1,263 @@
+<template>
+	<view>
+		<!-- #ifdef MP-ALIPAY -->
+		<u-navbar title="兑换码" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff"  leftIconSize="0" />
+		<!-- #endif -->
+		<!-- #ifndef MP-ALIPAY -->
+		<u-navbar title="兑换码" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
+		<!-- #endif -->
+		
+		<view class="wrap">
+			<view class="wrap-code">
+				<view class="wrap-code-input">
+					<u-input :placeholder="placeholder" v-model="code" border="none" maxlength="16" placeholderStyle="color:#333" inputAlign="center" @focus="setPlaceholder" @blur = "setPlaceholder2"/>
+				</view>
+				<view class="wrap-code-text">
+					兑换规则说明:<br>
+					1、兑换码有有限期限制,具体以盲票科技为准。<br>
+					2、兑换码不找零不兑现。
+				</view>
+			</view>
+			<button @click="submit" type="button">提交兑换</button>
+		</view>
+
+		<u-overlay :show="exchangeShow" mask-click-able="false" >
+			<view class="rect">
+				<view class="rect-popup">
+					<view class="rect-popup-top">
+						<view class="image1">
+							<image src="../static/image1.png" mode="aspectFit"></image>
+						</view>
+						<view class="text">~恭喜您得到奖品~</view>
+						<view class="title">{{ info.type == 'coin' ? (info.goodsName + ' x' + info.value): info.goodsName }}</view>
+						<view class="image2">
+							<image :src="info.picUrl" mode="aspectFit"></image>
+						</view>
+						<view class="btn" v-if="info.type != 'coin'">
+							<button @click="toPrize(info.type)">去查看我的奖品</button>
+						</view>
+						<view class="btn" v-if="info.type == 'coin'">
+							<button @click="toPrize(info.type)">去商城兑换商品</button>
+						</view>
+						<view class="tip">温馨提示:实物商品需前往提货才可提交订单</view>
+					</view>
+					<view class="rect-popup-bottom" @click="close">
+						<u-icon name="close" size="24"></u-icon>
+					</view>
+				</view>
+			</view>
+		</u-overlay>
+	</view>
+</template>
+
+<script>
+	import env from '../../config/env.js'
+	import $http from '@/utils/request.js'
+	export default {
+		data() {
+			return {
+				code: '',
+				info: {},
+				placeholder: '请输入兑换码',
+				loading: false,
+				exchangeShow: false,
+			}
+		},
+
+		methods: {
+			setPlaceholder() {
+				if(this.code == '' &&  this.placeholder ==  '请输入兑换码'){
+					this.placeholder = ''
+				}
+			},
+			setPlaceholder2() {
+				if(this.code == '' &&  this.placeholder ==  ''){
+					this.placeholder = '请输入兑换码'
+				}
+			},
+			submit() {
+				if(this.loading) return
+				this.loading = true
+				
+				let _this = this
+				if(_this.code == '') {
+					_this.loading = false
+					uni.$u.toast('请输入兑换码');
+					return
+				}
+				if(_this.code.length != 16) {
+					_this.loading = false
+					uni.$u.toast('兑换码错误');
+					return
+				}
+				const rule = /^[a-zA-Z0-9]+$/
+				if (!rule.test(_this.code)) {
+					_this.loading = false
+					uni.$u.toast('兑换码错误');
+					return
+				}
+				let data = {
+					cdKey: _this.code
+				}
+				$http.post('/api/v1/mp/user/mine/cdKey/exchange', data).then(res => {
+					if (res.code == 0) {
+						res.data.picUrl = env.filePublic + res.data.picUrl.split(',')[0] + '?imageView2/2/w/170'
+						_this.info = res.data
+						_this.exchangeShow = true
+						_this.loading = false
+					}else {
+						_this.loading = false
+					}
+				})
+			},
+			
+			toPrize(data) {
+				if (data == 'goods') {
+					uni.redirectTo({
+						url: '/packagePrize/prize/index'
+					})
+				}
+				if (data == 'coupon') {
+					uni.redirectTo({
+						url: '/packagePrize/prize/index?coupon=1'
+					})
+				}
+				if (data == 'coupon_pkg') {
+					uni.redirectTo({
+						url: '/packagePrize/prize/index?coupon=1'
+					})
+				}
+				if (data == 'coin') {
+					uni.switchTab({
+						url: '/pages/core/index'
+					})
+				}
+			},
+			
+			close() {
+				this.exchangeShow = false
+			}
+		},
+	}
+</script>
+<style lang="scss" scoped>
+.wrap {
+	padding: 30rpx;
+	&-code {
+		background-color: #fff;
+		padding: 40rpx;
+		margin-bottom: 80rpx;
+		&-input {
+			margin-top: 28rpx;
+			margin-bottom: 50rpx;
+			height: 88rpx;
+			border: 1px solid #FD7A21;
+			background-color: rgba(253,122,33,0.12);
+			display: flex;
+			flex-direction: row;
+			align-items: center;
+			justify-content: space-between;
+			flex: 1;
+		}
+		&-text {
+			font-size: 24rpx;
+			color: #666666;
+			line-height: 56rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			font-weight: 400;
+		}
+	}
+	
+	button {
+		margin: 0 auto;
+		width: 666rpx;
+		height: 98rpx;
+		line-height: 98rpx;
+		background: linear-gradient(180deg, #FEA052 0%, #FF8D2F 100%);
+		border-radius: 56rpx;
+		color: #fff;
+	}
+}
+
+.rect {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	height: 100%;
+	&-popup {
+		width: 85vw;
+		text-align: center;
+		&-top {
+			background-color: #fff;
+			margin-bottom: 80rpx;
+			padding: 0 80rpx 40rpx;
+			.image1 {
+				display: inline-block;
+				width: 374rpx;
+				height: 148rpx;
+				margin-top: -74rpx;
+				image {
+					width: 374rpx;
+					height: 148rpx;
+				}
+			}
+			.text {
+				margin-top: 20rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC-Medium, PingFang SC;
+				font-weight: 500;
+				color: #FF9056;
+				line-height: 36rpx;
+			}
+			.title {
+				margin: 8rpx 0 15rpx;
+				font-size: 26rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				font-weight: 400;
+				color: #666666;
+				line-height: 50rpx;
+			}
+			.image2 {
+				margin: 0 auto;
+				width: 218rpx;
+				height: 218rpx;
+				image {
+					width: 218rpx;
+					height: 218rpx;
+				}
+			}
+			.btn {
+				margin: 40rpx 0 12rpx;
+				button {
+					height: 68rpx;
+					line-height: 68rpx;
+					background: #FF9056;
+					border-radius: 50rpx;
+					color: #fff;
+					font-size: 26rpx;
+					font-family: PingFang SC-Medium, PingFang SC;
+					font-weight: 500;
+				}
+			}
+			
+			.tip {
+				font-size: 24rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				font-weight: 400;
+				color: #999999;
+				line-height: 50rpx;
+			}
+		}
+		&-bottom {
+			width: 80rpx;
+			height: 80rpx;
+			background: rgba(255,255,255,0.5);
+			margin: 0 auto;
+			border-radius: 50%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+		}
+	}
+}
+</style>

BIN
src/packageOperate/static/image1.png


+ 37 - 16
src/packagePrize/goods/index.vue

@@ -88,12 +88,14 @@
 				payInfo: {},
 				purchasePopupShow: false,
 				pagesNum: '',
+				couponDetail: '',
 			};
 		},
 		onShow() {
 			this.pagesNum = getCurrentPages().length
 		},
 		onLoad(opthios) {
+			this.couponDetail = uni.getStorageSync('couponDetail') ? uni.getStorageSync('couponDetail') : ''
 			this.getDetail(opthios.id)
 			this.goodsId = opthios.id
 			this.boxId = opthios.boxId
@@ -114,21 +116,37 @@
 						picUrlArr.forEach(item => {
 							this.picUrlArr.push(env.filePublic + item + '?imageView2/2/w/750')
 						})
-						// 处理富文本
-						// #ifndef MP-ALIPAY
-						const description = res.data.description.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"")
-							.replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",
-								".png?imageView2/2/w/750\"");
-						this.description = formatRichText(description);
-						// #endif
-
-						// #ifdef MP-ALIPAY
-						res.data.description.split(".jpg\"").join(".jpg?imageView2/2/w/750\"")
-						res.data.description.split(".jpeg\"").join(".jpeg?imageView2/2/w/750\"")
-						res.data.description.split(".png\"").join(".png?imageView2/2/w/750\"")
-						this.description = formatRichText(res.data.description);
-						// #endif
-
+						if(this.couponDetail && this.couponDetail != ''){
+							// 处理富文本
+							// #ifndef MP-ALIPAY
+							const description = this.couponDetail.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"")
+								.replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",
+									".png?imageView2/2/w/750\"");
+							this.description = formatRichText(description);
+							// #endif
+							
+							// #ifdef MP-ALIPAY
+							this.couponDetail.split(".jpg\"").join(".jpg?imageView2/2/w/750\"")
+							this.couponDetail.split(".jpeg\"").join(".jpeg?imageView2/2/w/750\"")
+							this.couponDetail.split(".png\"").join(".png?imageView2/2/w/750\"")
+							this.description = formatRichText(this.couponDetail);
+							// #endif
+						}else {
+							// 处理富文本
+							// #ifndef MP-ALIPAY
+							const description = res.data.description.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"")
+								.replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",
+									".png?imageView2/2/w/750\"");
+							this.description = formatRichText(description);
+							// #endif
+							
+							// #ifdef MP-ALIPAY
+							res.data.description.split(".jpg\"").join(".jpg?imageView2/2/w/750\"")
+							res.data.description.split(".jpeg\"").join(".jpeg?imageView2/2/w/750\"")
+							res.data.description.split(".png\"").join(".png?imageView2/2/w/750\"")
+							this.description = formatRichText(res.data.description);
+							// #endif
+						}
 					}
 				}).catch(() => {
 					uni.hideLoading();
@@ -177,7 +195,10 @@
 					url: `/packageGoods/goods/company?goodsId=${ this.goodsId }`
 				})
 			},
-		}
+		},
+		onUnload() {
+			uni.removeStorageSync('couponDetail')
+		},
 	}
 </script>
 

+ 3 - 0
src/pages.json

@@ -168,6 +168,9 @@
 				},
 				{
 					"path": "store/index"
+				},
+				{
+					"path": "exchange/index"
 				}
 			]
 		},

+ 4 - 1
src/pages/index/index.vue

@@ -538,7 +538,10 @@
 						url: `/packagePrize/goods/index?id=424&boxId=${ this.ticketInfo.boxId }`
 					})
 				} else if (item.refType && JSON.parse(item.refType).value === 'coupon' || JSON.parse(item.refType)
-					.value === 'coupon_pkg') {
+					.value === 'coupon_pkg') {
+					if (item.couponDetail) {
+						uni.setStorageSync('couponDetail', item.couponDetail);
+					}
 					uni.navigateTo({
 						url: `/packagePrize/goods/index?id=425&boxId=${ this.ticketInfo.boxId }`
 					})

+ 18 - 0
src/pages/user/index.vue

@@ -56,6 +56,13 @@
 				</view>
 				<u-icon name="arrow-right" color="#666" size="16"></u-icon>
 			</view>
+			<view class="action-item flex" @click="toExchange">
+				<view class="action-item-left flex">
+					<image src="../../static/user/user_exchange.png" mode="scaleToFill"></image>
+					<view class="title">兑换码</view>
+				</view>
+				<u-icon name="arrow-right" color="#666" size="16"></u-icon>
+			</view>
 			<view class="action-item flex" @click="toAddress">
 				<view class="action-item-left flex">
 					<image src="../../static/user/user_addr.png" mode="scaleToFill"></image>
@@ -187,6 +194,17 @@
 					url: '/packageGoods/order/index'
 				})
 			},
+			
+			//兑换专区
+			toExchange() {
+				if (!this.loginState) {
+					uni.$u.toast('请登录');
+					return
+				}
+				uni.navigateTo({
+					url: '/packageOperate/exchange/index'
+				})
+			},
 
 			// 我的地址
 			toAddress() {

BIN
src/static/user/user_exchange.png