瀏覽代碼

新增选择奖品再来一张

hwb0 3 年之前
父節點
當前提交
2397a0b65c
共有 4 個文件被更改,包括 48 次插入18 次删除
  1. 44 12
      pages/choice/index.vue
  2. 1 3
      pages/lucky/index.vue
  3. 2 2
      pages/process/index.vue
  4. 1 1
      pages/ticket/index.vue

+ 44 - 12
pages/choice/index.vue

@@ -26,10 +26,10 @@
 				<view class="confirm" @click="confirmPrize" v-if="!tipShow">确认</view>
 			</view> -->
 		</view>
-		
+
 		<view class="footer-fixed" v-if="!tipShow">
 			<view class="flex btn">
-				<button type="default"  @click="confirmPrize">确认</button>
+				<button type="default" @click="confirmPrize">确认</button>
 			</view>
 		</view>
 
@@ -50,11 +50,11 @@
 					<view class="title" v-else>盲豆x {{ actionInfo.value }}</view>
 				</view>
 				<view class="confirm-prize-tip" v-if="actionInfo.prizeType && actionInfo.prizeType.value != 'coin'">
-					已放入我的奖品库</view>
-				<view class="confirm-prize-tip" v-else>已放入“我的盲豆”</view>
+					已放入我的奖品库<text @click="toPrize">前往查看</text></view>
+				<view class="confirm-prize-tip" v-else>已放入“我的盲豆”<text @click="toPrize">前往查看</text></view>
 				<view class="flex confirm-prize-btn">
 					<view class="back" @click="back">返回</view>
-					<view class="confirm" @click="toPrize">前往查看</view>
+					<view class="confirm" @click="again">再来一张</view>
 				</view>
 			</view>
 		</u-popup>
@@ -73,11 +73,13 @@
 				actionIndex: 0,
 				tipShow: false,
 				comfirmShow: false,
-				actionInfo: {}
+				actionInfo: {},
+				type: ''
 			};
 		},
 		onLoad(options) {
 			this.ticketId = options.id
+			this.type = options.type
 		},
 		onShow() {
 			this.getPrizeList()
@@ -177,7 +179,32 @@
 				uni.switchTab({
 					url: '/pages/user/index'
 				})
-			}
+			},
+
+			again() {
+				let _this = this
+				if (_this.type == 'onLine') {
+					uni.navigateBack({
+						delta: 1
+					})
+				} else if (_this.type == 'offLine') {
+					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('请扫二维码');
+						}
+					});
+				} else {
+					_this.toIndex()
+				}
+			},
 		}
 	}
 </script>
@@ -296,7 +323,7 @@
 			}
 		}
 	}
-	
+
 	.footer-fixed {
 		position: fixed;
 		bottom: var(--window-bottom);
@@ -308,10 +335,10 @@
 		// 设置ios刘海屏底部横线安全区域
 		padding-bottom: constant(safe-area-inset-bottom);
 		padding-bottom: env(safe-area-inset-bottom);
-	
+
 		.btn {
 			padding: 20rpx 0;
-	
+
 			/deep/ button {
 				width: 640rpx;
 				height: 90rpx;
@@ -365,8 +392,8 @@
 				width: 150rpx;
 				height: 200rpx;
 			}
-				
-			.title{
+
+			.title {
 				flex: 1;
 				padding-left: 40rpx;
 			}
@@ -375,6 +402,11 @@
 		&-tip {
 			text-align: center;
 			margin-bottom: 60rpx;
+
+			text {
+				padding-left: 24rpx;
+				color: rgba(32, 163, 242, 100);
+			}
 		}
 
 		&-btn {

+ 1 - 3
pages/lucky/index.vue

@@ -130,13 +130,11 @@
 
 		onLoad(options) {
 			if (options.id) {
-				console.log(options.id);
 				this.serialNo = options.id
 			}
 
 			if (options.q) {
 				let url = JSON.stringify(options.q)
-				console.log(url);
 				this.serialNo = url.substring(url.length - 22, url.length - 1)
 			}
 		},
@@ -179,7 +177,7 @@
 							this.info = res.data
 							if (uni.getStorageSync('token')) {
 								uni.redirectTo({
-									url: `/pages/choice/index?id=${ res.data.ticketId }`
+									url: `/pages/choice/index?id=${ res.data.ticketId }&type=offLine`
 								})
 							} else {
 								uni.showModal({

+ 2 - 2
pages/process/index.vue

@@ -13,7 +13,7 @@
 			</view>
 			<view class="flex btn-wrap">
 				<view class="btn" @click="toChoice">立即刮开兑奖</view>
-				<view class="btn" @click="put">暂不兑奖</view>
+				<!-- <view class="btn" @click="put">暂不兑奖</view> -->
 			</view>
 		</view>
 	</view>
@@ -82,7 +82,7 @@
 
 			toChoice() {
 				uni.redirectTo({
-					url: `/pages/choice/index?id=${ this.info.ticketId }`
+					url: `/pages/choice/index?id=${ this.info.ticketId }&type=onLine`
 				})
 			},
 		}

+ 1 - 1
pages/ticket/index.vue

@@ -86,7 +86,7 @@
 
 			toChoice(item) {
 				uni.navigateTo({
-					url: `/pages/choice/index?id=${ item.ticketId }`
+					url: `/pages/choice/index?id=${ item.ticketId }&type=onLine`
 				})
 			},