Browse Source

盲票购买流程完善

hwb0 3 years ago
parent
commit
e298b169de

+ 1 - 1
components/pay-popup/pay-popup.vue

@@ -5,7 +5,7 @@
 				<!-- 盲票信息 -->
 				<view class="flex goods">
 					<view class="flex image-wrap">
-						<image :src="payInfo.picUrl" mode="scaleToFill"></image>
+						<image :src="payInfo.picUrl" mode="aspectFit"></image>
 					</view>
 					<view class="info">
 						<view class="info-title">{{ payInfo.title }}</view>

+ 1 - 1
packageGoods/coupon/index.vue

@@ -123,7 +123,7 @@
 						let page = pages[pages.length - 2]
 						let payInfo = {
 							...res.data,
-							picUrl: env.filePublic + res.data.picUrl,
+							picUrl: env.filePublic + res.data.picUrl.split(',')[0],
 							couponDiscount: res.data && res.data.couponList && res.data.couponList.length &&
 								res
 								.data.couponList[0].discount,

+ 8 - 4
packageGoods/order/detail.vue

@@ -68,7 +68,7 @@
 		</view>
 		
 		<!-- 发货信息 -->
-		<view class="order">
+		<!-- <view class="order">
 			<view class="order-title">发货信息</view>
 			<view class="order-item flex">
 				<view class="order-item-title">配送方式</view>
@@ -78,13 +78,13 @@
 				<view class="order-item-title">发货时间</view>
 				<view class="order-item-content">{{ $parseTime(info.createdTime) }}</view>
 			</view>
-		</view>
+		</view> -->
 		
 		<!-- 留言 -->
 		<view class="order" v-if="info.memo != ''">
 			<view class="order-title">留言</view>
 			<view class="order-item flex">
-				<view class="order-item-content">{{ info.memo }}</view>
+				<view class="order-item-title tip">{{ info.memo }}</view>
 			</view>
 		</view>
 
@@ -268,7 +268,7 @@
 </script>
 <style lang="scss" scoped>
 	.detail {
-		padding-bottom: 100rpx;
+		padding-bottom: 200rpx;
 	}
 	
 	// 订单状态
@@ -475,6 +475,10 @@
 				line-height: 28rpx;
 			}
 			
+			.tip {
+				line-height: 40rpx;
+			}
+			
 			&-content {
 				.copy {
 					height: 100%;

+ 1 - 1
packageGoods/order/index.vue

@@ -23,7 +23,7 @@
 					<view class="order-list-item__state">
 						<text class="success">{{ item.status && item.status.desc }}</text>
 					</view>
-					<view class="order-list-item__goods">
+					<view class="order-list-item__goods" @click="toDetail(item)">
 						<view class="order-list-item__goods-item" v-for="(items, indexs) in item.items" :key="indexs">
 							<image :src="items.picUrl" mode="aspectFit"></image>
 							<view class="info">

+ 31 - 3
packageGoods/order/settlement.vue

@@ -73,12 +73,16 @@
 				<text>运费</text>
 				<text>¥{{ $numberFormat(info.freightAmt) }}</text>
 			</view>
+			<view class="settlement-tip">
+				<view class="settlement-tip-title">尊敬的用户您好!</view>
+				<view class="settlement-tip-content">您提交的商品订单将会在第一时间为您处理,正常产品都会48小时内出货,由于因疫情原因可能导致都到货时间延后,我们深表歉意,有任何问题可以进盲票公众号和我们客服联系。</view>
+			</view>
 		</view>
 		
 		<view class="footer-fixed">
 			<view class="content">
 				<view class="content-not flex" v-if="info.freightType == 2">
-					<icon type="warn"  style="vertical-align: bottom; margin-right: 20rpx; " size="20"/>
+					<icon type="warn" color="#F9832E" style="vertical-align: bottom; margin-right: 20rpx; " size="20"/>
 					<text>当前收货地址暂不支持发货</text>
 				</view>	
 				<view class="content-btn flex">
@@ -483,6 +487,27 @@
 			padding: 34rpx;
 			border-radius: 22rpx;
 		}
+		
+		// 留言、运费
+		&-tip {
+			font-size: 30rpx;
+			margin-bottom: 34rpx;
+			background-color: #fff;
+			justify-content: space-between;
+			padding: 34rpx;
+			border-radius: 22rpx;
+			
+			&-title {
+				font-size: 26rpx;
+				line-height: 24rpx;
+				margin-bottom: 24rpx;
+			}
+			
+			&-content {
+				font-size: 24rpx;
+				line-height: 40rpx;
+			}
+		}
 	}
 
 	.footer-fixed {
@@ -498,18 +523,21 @@
 		padding-bottom: env(safe-area-inset-bottom);
 
 		.content {
-			padding: 20rpx 40rpx;
+			padding: 20rpx 0;
 			font-size: 30rpx;
 			// 不发货提示
 			&-not {
 				justify-content: flex-start;
 				font-size: 30rpx;
-				color: #FF4208;
+				color: #F9832E;
 				margin: 0 0 30rpx;
+				padding: 0 40rpx 24rpx;
+				border-bottom: 1px solid #eee;
 			}
 			// 提交按钮
 			&-btn {
 				justify-content: space-between;
+				padding: 0 40rpx;
 				
 				&-left {
 					.value {

+ 22 - 15
packagePrize/choice/index.vue

@@ -111,7 +111,8 @@
 					<view class="choice-info-content-title" v-if="actionInfo.prizeType && actionInfo.prizeType.value != 'coin'">{{ actionInfo.title }}</view>
 					<view class="choice-info-content-title" v-else>盲豆</view>
 					<view class="choice-info-content-tip flex"  @click="toPrize(actionInfo.prizeType)">
-						<view class="txt">哇,去瞅瞅我的宝贝</view>
+						<view class="txt" v-if="actionInfo.prizeType && actionInfo.prizeType.value != 'coin'">哇,去瞅瞅我的宝贝</view>
+						<view class="txt" v-else>哇,去商城兑换商品</view>
 					</view>
 				</view>
 			</view>
@@ -329,19 +330,25 @@
 			
 			again() {
 				let _this = this
-				uni.scanCode({
-					scanType: ['qrCode'],
-					success(res) {
-						const url = res.result
-						let serialNo = url.substring(url.length - 21, url.length)
-						uni.redirectTo({
-							url: `/pages/lucky/index?id=${ serialNo }&type=offLine`
-						})
-					},
-					fail() {
-						uni.$u.toast('请扫二维码');
-					}
-				});
+				if(this.type == 'onLine') {
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+				} else {
+					uni.scanCode({
+						scanType: ['qrCode'],
+						success(res) {
+							const url = res.result
+							let serialNo = url.substring(url.length - 21, url.length)
+							uni.redirectTo({
+								url: `/pages/lucky/index?id=${ serialNo }&type=offLine`
+							})
+						},
+						fail() {
+							uni.$u.toast('请扫二维码');
+						}
+					});
+				}
 			},
 		}
 	}
@@ -466,7 +473,6 @@
 				&__image {
 					width: 65%;
 					height: 65%;
-					margin-bottom: 30rpx;
 					
 					image {
 						width: 100%;
@@ -603,6 +609,7 @@
 		}
 		
 		&-content {
+			width: 100vw;
 			flex: 1;
 			overflow-y: auto;
 		}

+ 39 - 29
packagePrize/rolling/index.vue

@@ -67,7 +67,8 @@
 					<view class="prize-info-content-title" v-if="prizeInfo.prizeType && prizeInfo.prizeType.value != 'coin'">{{ prizeInfo.title }}</view>
 					<view class="prize-info-content-title" v-else>盲豆</view>
 					<view class="prize-info-content-tip flex" v-if="isTry == 0" @click="toPrize(prizeInfo.prizeType)">
-						<view class="txt">哇,去瞅瞅我的宝贝</view>
+						<view class="txt" v-if="prizeInfo.prizeType && prizeInfo.prizeType.value != 'coin'">哇,去瞅瞅我的宝贝</view>
+						<view class="txt" v-else>哇,去商城兑换商品</view>
 					</view>
 				</view>
 			</view>
@@ -102,7 +103,7 @@
 				
 				boxId: '',
 				isTry: null,
-				ticketId: '',
+				orderId: '',
 			}
 		},
 		
@@ -117,6 +118,7 @@
 			if(options) {
 				this.boxId = options.boxId
 				this.isTry = Number(options.isTry)
+				this.orderId = options.orderId
 			}
 		},
 		
@@ -131,38 +133,47 @@
 		
 		methods: {
 			getList() {
-				uni.showLoading({
-					title: '加载中'
-				});
+				let _this = this
 				let data = {
-					boxId: this.boxId,
-					isTry: this.isTry,
-					ticketId: this.ticketId
+					boxId: _this.boxId,
+					isTry: _this.isTry,
+					orderId: _this.orderId
 				}
 				
-				$http.post('/api/v1/mp/user/ticket/autoCashPrize', data).then(res => {
-					if(res.code == 0) {
-						this.list = res.data.ticketAwardsPrizeList
-						this.list.forEach(item => {
-							item.forEach(ele => {
-								ele.picUrl = env.filePublic + ele.picUrl
-								ele.prizeType = JSON.parse(ele.prizeType)
+				let num = 0
+				let time = setInterval(() => {
+					num ++
+					uni.showLoading({
+						title: '加载中'
+					});
+					$http.post('/api/v1/mp/user/ticket/autoCashPrize', data).then(res => {
+						if(res.code == 0) {
+							clearInterval(time)
+							_this.list = res.data.ticketAwardsPrizeList
+							_this.list.forEach(item => {
+								item.forEach(ele => {
+									ele.picUrl = env.filePublic + ele.picUrl.split(',')[0] + '?imageView2/2/w/170'
+									ele.prizeType = JSON.parse(ele.prizeType)
+								})
 							})
-						})
-						this.prizeInfo = { 
-							...res.data,
-							picUrl: env.filePublic + res.data.picUrl,
-							prizeType: JSON.parse(res.data.prizeType)
+							_this.prizeInfo = { 
+								...res.data,
+								picUrl: env.filePublic + res.data.picUrl.split(',')[0] + '?imageView2/2/w/340',
+								prizeType: JSON.parse(res.data.prizeType)
+							}
+							setTimeout(()=> {
+								uni.hideLoading();
+								_this.btnShow = true
+								_this.running()
+							},500)
 						}
-						setTimeout(()=> {
+						
+						if (num == 10) {
 							uni.hideLoading();
-							this.btnShow = true
-							this.running()
-						},500)
-					}
-				}).catch(() => {
-					uni.hideLoading();
-				})
+							clearInterval(time)
+						}
+					})
+				}, 1000)
 			},
 			
 			// 动画开始
@@ -514,7 +525,6 @@
 				&__image {
 					width: 65%;
 					height: 65%;
-					margin-bottom: 30rpx;
 					
 					image {
 						width: 100%;

+ 1 - 1
packagePrize/ticket/index.vue

@@ -78,7 +78,7 @@
 					uni.hideLoading();
 					if (res.code == 0) {
 						res.rows.forEach(item => {
-							item.picUrl = env.filePublic + item.picUrl + '?imageView2/2/w/170'
+							item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/170'
 						})
 						this.total = res.total
 						this.list = this.list.concat(res.rows)

+ 4 - 4
pages/index/index.vue

@@ -101,9 +101,9 @@
 				
 				<!-- 盲票价格 -->
 				<view class="ticket-price flex">
-					<view class="ticket-price-checkbox flex">
+					<!-- <view class="ticket-price-checkbox flex">
 						<image src="../../static/index/index_price_checkout.png" mode="scaleToFill"></image>
-					</view>
+					</view> -->
 					<view class="ticket-price-amt flex">
 						<view class="num">{{ $numberFormat(ticketInfo.salePrice) }}</view>
 						<view class="txt">元/个</view>
@@ -270,7 +270,7 @@
 					res => {
 						uni.hideLoading();
 						if (res.code == 0) {
-							res.rows.forEach(item => item.picUrl = item.picUrl.split(',').map(item => env.filePublic + item + '?imageView2/2/w/375'))
+							res.rows.forEach(item => item.picUrl = item.picUrl.split(',').map(item => env.filePublic + item + '?imageView2/2/w/750'))
 							this.ticketList = res.rows
 							this.getTicketDetail(this.ticketList[0].boxId)
 						}
@@ -408,7 +408,7 @@
 			toProcess(id) {
 				this.payShow = false
 				uni.navigateTo({
-					url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&isTry=0`
+					url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&orderId=${ id }&isTry=0`
 				})
 			},
 

+ 8 - 8
pages/ticketBox/detail.vue

@@ -47,7 +47,7 @@
 				<image class="ticket-btn-game" src="../../static/ticketBox/ticket_game.png" mode="scaleToFill" @click="toRollingGame"></image>
 				<view class="ticket-btn-center flex" @click="exchange">
 					<image src="../../static/ticketBox/ticket_btn_center.png" mode="scaleToFill"></image>
-					<view class="ticket-btn-center-txt">开盲票</view>
+					<view class="ticket-btn-center-txt">开盲票</view>
 				</view>
 				<image class="ticket-btn-share" src="../../static/ticketBox/ticket_share.png" mode="scaleToFill"></image>
 			</view>
@@ -62,7 +62,7 @@
 		
 		<!-- 盲票奖品数量、概率 -->
 		<view class="prize-total">
-			<view class="prize-total-num">共90款</view>
+			<view class="prize-total-num">共{{ prizeList.length }}款</view>
 			<!-- 中奖概率 -->
 			<view class="prize-total-chance flex">
 				<view class="prize-total-chance-content flex" v-for="(item, index) in info.ticketAwardsLabelList">
@@ -93,7 +93,7 @@
 			<view class="footer-fixed-btn flex">
 				<view class="footer-fixed-btn-center flex" @click="exchange">
 					<image src="../../static/ticketBox/ticket_btn_center.png" mode="scaleToFill"></image>
-					<view class="footer-fixed-btn-center-txt">开盲票</view>
+					<view class="footer-fixed-btn-center-txt">开盲票</view>
 				</view>
 			</view>
 		</view>
@@ -197,7 +197,7 @@
 						}
 						let prizeList = res.data.prizeList
 						prizeList.forEach(item => {
-							item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/170'
+							item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/375'
 							item.awardsLabelPicUrl = env.filePublic + item.awardsLabelPicUrl
 						})
 						this.prizeList = prizeList
@@ -219,7 +219,7 @@
 			toProcess(id) {
 				this.payShow = false
 				uni.navigateTo({
-					url: `/packagePrize/rolling/index?boxId=${ this.info.boxId }&isTry=0`
+					url: `/packagePrize/rolling/index?boxId=${ this.info.boxId }&orderId=${ id }&isTry=0`
 				})
 			},
 
@@ -365,7 +365,7 @@
 				.img {
 					position: absolute;
 	
-					width: 58vw;
+					width: 100%;
 					height: 80%;
 					animation: prizeBig .3s;
 				}
@@ -624,7 +624,7 @@
 	@keyframes prizeMini
 	{
 		from {
-			width: 60vw;
+			width: 100%;
 			height: 80%;
 		}
 		to {
@@ -641,7 +641,7 @@
 			height: 60%;
 		}
 		to {
-			width: 60vw;
+			width: 100%;
 			height: 80%;
 		}
 	}