Browse Source

首页试玩与刮开盲票在盲票列表为空时提醒

DELL 3 years ago
parent
commit
931fcb62bb

+ 21 - 2
src/packageGoods/ticket/index.vue

@@ -29,7 +29,10 @@
 				</view>
 			</view>
 			<view class="flex empty" v-if="!list.length">
-				<u-empty text="数据为空" mode="order" />
+				<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>
@@ -156,7 +159,23 @@
 		}
 
 		.empty {
-			height: 60vh;
+			height: 50vh;
+			
+			.center {
+				text-align: center;
+			
+				&-img {
+					width: 228rpx;
+					height: 320rpx;
+				}
+			
+				&-font {
+					font-size: 30rpx;
+					font-weight: 400;
+					color: #999999;
+					margin-bottom: 250rpx;
+				}
+			}
 		}
 	}
 </style>

+ 4 - 5
src/packagePrize/rolling/index.vue

@@ -160,17 +160,16 @@
 			const res = uni.getMenuButtonBoundingClientRect()
 			this.statusHeight = res.top //胶囊距离顶部
 			// #endif
+			
+			if(this.boxId) {
+				this.getList()
+			}
 		},
 
 		onUnload() {
 			// 移除动画
 			this.animationData = {}
 		},
-
-		mounted() {
-			this.getList()
-		},
-
 		methods: {
 			getList() {
 				let _this = this

+ 35 - 25
src/pages/index/index.vue

@@ -410,29 +410,34 @@
 			// 立即开刮
 			payment() {
 				this.payInfo = this.ticketList[this.ticketIndex]
-				let data = {
-					userCouponIds: [],
-					autoCoupon: 1,
-					boxId: this.payInfo.boxId,
-					orderNum: 1
-				}
-				$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
-					if (res.code == 0) {
-						let info = {
-							...res.data,
-							...this.payInfo,
-							picUrl: this.payInfo.picUrl[0],
-							couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
-								.data.couponList[0].title,
-							couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
-								.couponList[0].id
-						}
-						this.payInfo = info
-						this.payShow = true
+				if(this.payInfo) {
+					let data = {
+						userCouponIds: [],
+						autoCoupon: 1,
+						boxId: this.payInfo.boxId,
+						orderNum: 1
 					}
-				}).catch(() => {
-					uni.$u.toast('开刮失败,请重试!');
-				})
+					$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
+						if (res.code == 0) {
+							let info = {
+								...res.data,
+								...this.payInfo,
+								picUrl: this.payInfo.picUrl[0],
+								couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
+									.data.couponList[0].title,
+								couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
+									.couponList[0].id
+							}
+							this.payInfo = info
+							this.payShow = true
+						}
+					}).catch(() => {
+						uni.$u.toast('开刮失败,请重试!');
+					})
+				}else {
+					uni.$u.toast('盲票正在准备中');
+				}
+				
 			},
 
 			// 关闭支付弹框
@@ -487,9 +492,14 @@
 					})
 					return
 				}
-				uni.navigateTo({
-					url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&isTry=1`
-				})
+				if(this.ticketInfo && this.ticketInfo.boxId){
+					uni.navigateTo({
+						url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&isTry=1`
+					})
+				}else{
+					uni.$u.toast('盲票正在准备中');
+				}
+				
 			},
 
 			// 线上立即刮票成功,跳转到刮奖过程

+ 2 - 0
src/pages/ticketBox/detail.vue

@@ -31,10 +31,12 @@
 		<view class="prize">
 			<!-- 查看规则 -->
 			<view class="prize-rule" @click="toRule">
+				<!-- #ifndef MP-ALIPAY -->
 				<view class="prize-rule-content flex">
 					<image src="../../static/index/index_tip.png" mode="scaleToFill"></image>
 					<text>查看规则</text>
 				</view>
+			<!-- #endif -->
 			</view>
 			
 			<!-- 奖品 -->