yfape 2 rokov pred
rodič
commit
959b868f4f

+ 1 - 1
pages.json

xqd
@@ -331,7 +331,7 @@
 		"list": [{
 			"name": "goood-lucky", //模式名称
 			"path": "pages/goods/goods-lucky/index", //启动页面,必选
-			"query": "draw_no=UBGsSWflawlc" //启动参数,在页面的onLoad函数里面得到
+			"query": "draw_no=JqgtkNtFcoAT" //启动参数,在页面的onLoad函数里面得到
 		}]
 	}
 }

+ 22 - 8
pages/goods/goods-detail/index.vue

xqd xqd
@@ -405,14 +405,6 @@
 								img: item
 							}
 						})
-						//跳转h5和小程序
-						this.jump_type = res.data.jump_type,
-							this.jump_config = res.data.jump_config
-						//banner展示视频或者图片
-						this.resource_type = res.data.resource_type
-						this.video_url = res.data.video_url
-						//视频自动播放
-						this.openVideoPlay()
 						//规格对接
 						this.attr_groups = JSON.parse(res.data.attr_group)
 						//获取默认酒店
@@ -431,7 +423,29 @@
 								this.flavorchecked(item.attr_list[0]?.attr_name, item.attr_group_name)
 							})
 						}
+						
+						//跳转h5和小程序
+						this.jump_type = res.data.jump_type,
+						this.jump_config = res.data.jump_config
+						//banner展示视频或者图片
+						this.resource_type = res.data.resource_type
+						this.video_url = res.data.video_url
+						//视频自动播放
+						new Promise((resolve,reject)=>{
+							this.openVideoPlay()
+							resolve(true)
+						}) 
+					}else{
+						uni.showToast({
+							icon: 'error',
+							title: res.msg?res.msg:"网络繁忙",
+						})
 					}
+				}).catch(err => {
+					uni.showToast({
+						icon: 'none',
+						title: err.msg?err.msg:"服务器繁忙",
+					})
 				})
 			},
 			// 获取酒店详情

+ 17 - 5
pages/goods/goods-lucky/index.vue

xqd xqd xqd
@@ -56,7 +56,9 @@
 					</view>
 					<view v-if="!item.integral" :class="item.status==1 ? 'prize-main-rightSelect' : 'prize-main-right' ">
 						<text v-if="item.status==1" @click="goExchangePhy(item.id)">立即兑换</text>
-						<text v-if="item.status==2">已兑换</text>
+						<text v-else-if="item.status==2">已兑换</text>
+						<text v-else-if="item.status==3">已过期</text>
+						<text v-else-if="item.status==4">未开始</text>
 					</view>
 				</view>
 			</view>
@@ -208,10 +210,12 @@
 						this.$refs.dialogError.open()
 					}
 				}).catch(err=>{
-					uni.showToast({
-						icon: 'error',
-						title: "网络繁忙"
-					})
+					// uni.showToast({
+					// 	icon: 'error',
+					// 	title: "网络繁忙"
+					// })
+					this.error.info = "网络繁忙";
+					this.$refs.dialogError.open()
 				})
 			},
 			getDrawRecord(page = 1){
@@ -293,6 +297,14 @@
 							break;
 						}
 					}
+				}).catch(err => {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg?res.msg:"网络繁忙",
+					})
+					this.$refs.turntable.end(0).then(_=>{
+						this.$refs.turntable.reset();
+					});
 				});
 			},
 

+ 3 - 0
pages/index/active-detail/index.vue

xqd
@@ -968,6 +968,9 @@
 					background-color: transparent;
 					color: rgba(0,0,0,0.7);
 					transform: translateX(-11px);
+				}
+				&:first-child::before{
+					content: "";
 				}
 			}
 		}

+ 32 - 27
pages/index/vote-detail/index.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -243,7 +243,8 @@
 				},
 				//指示点显示位置
 				current1: 0,
-				mode: 'dot'
+				mode: 'dot',
+				throttle:false
 
 			}
 		},
@@ -333,15 +334,7 @@
 				}).then(res => {
 					if (res.code == 0) {
 						this.voteDetail = res.data
-						uni.getStorage({
-							key: `is_vip_${this.voteDetail.id}`,
-							success: (data)=> {
-								this.is_vip = data.data === 1 ? true : false
-							},
-							fail:()=>{
-								this.is_vip = false;
-							}
-						});
+						
 						
 						this.startTime = res.data.activity.start_time.replace(/-/g, "/")
 						// “yyyy-MM-dd-hh-mm-ss”.replace(/-/g,"/")
@@ -354,7 +347,7 @@
 						} else {
 							this.isVoteNum = false
 						}
-						callback && callback()
+						
 						this.sourceId = res.data.id
 						//跳转vip小程序获得投票数
 						this.vipRewardTicketNum = res.data.activity.vip_reward_ticket_num
@@ -369,7 +362,17 @@
 							this.jump_config = res.data.jump_config
 						//banner展示视频或者图片
 						this.resource_type = res.data.resource_type
-						this.video_url = res.data.video_url
+						this.video_url = res.data.video_url
+						uni.getStorage({
+							key: `is_vip_${this.voteDetail.id}`,
+							success: (data)=> {
+								this.is_vip = data.data === 1 ? true : false;
+								!this.is_vip && callback && callback();
+							},
+							fail:()=>{
+								this.is_vip = false;
+							}
+						});
 						//视频自动播放
 						this.openVideoPlay()
 						// //海报图片
@@ -496,13 +499,14 @@
 								source_type: 1,
 								source_id: _this.sourceId
 							}).then(res => {
-								console.log(res)
-								uni.setStorage({
-									key: `is_vip_${_this.voteDetail.id}`,
-									data: 1,
-								});
-								_this.is_vip = true
-								_this.closeVote()
+								if(res.code == 0){
+									uni.setStorage({
+										key: `is_vip_${_this.voteDetail.id}`,
+										data: 1,
+									});
+									_this.is_vip = true
+									_this.closeVote()
+								}
 							})
 							// 打开成功
 						},
@@ -552,20 +556,21 @@
 			// 	})
 			// },
 			// 投票
-			goVote(id, again = false) {
+			goVote(id, again = false) {
+				if(this.throttle) return;
+				this.throttle = true;
 				again && this.closeVote();
 				this.$api.active.vote({
 					activity_project_id: id
-				}).then(res => {
-					console.log(res, '投票')
-					if (res.code == 0) {			   
+				}).then(res => {
+					this.throttle =false
+					if (res.code == 0) {
 						this.is_prize = res.data.is_prize
 						if (this.is_prize == 1) {
 							this.prizeProduct = res.data?.product?.name ? res.data.product.name : `${res.data.integral}积分`
 						}
 						this.getDetail(this.activity_project_id, this.openVote())
-					}  else if(res.code === 2){
-						console.log(this.is_vip)
+					}  else if(res.code === 2){
 						if(!this.is_vip){
 							this.openVote(false)
 						}else{
@@ -580,8 +585,8 @@
 							title: res.msg?res.msg:"暂无权限"
 						})
 					}
-				}).catch(err => {
-					console.log(err)
+				}).catch(err => {
+					this.throttle =false
 					uni.showToast({
 						icon: 'error',
 						title: '投票失败'