|
@@ -203,13 +203,14 @@ export default {
|
|
// 权重随机数的最大值
|
|
// 权重随机数的最大值
|
|
weightTotal: 0,
|
|
weightTotal: 0,
|
|
// 权重数组
|
|
// 权重数组
|
|
- weightArr: []
|
|
|
|
|
|
+ weightArr: [],
|
|
|
|
+ isFirstLoad: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
showLottery(newValue, oldValue) {
|
|
showLottery(newValue, oldValue) {
|
|
- if(!newValue){
|
|
|
|
- // this.handleInitCanvas()
|
|
|
|
|
|
+ if(!newValue&&(this.winTypes=='win_0'||this.winTypes=='win_2'||this.winTypes=='win_3')){
|
|
|
|
+ this.$refs.lottery.resetAngle()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -240,9 +241,12 @@ export default {
|
|
},
|
|
},
|
|
// 获取奖品列表
|
|
// 获取奖品列表
|
|
getPrizeList() {
|
|
getPrizeList() {
|
|
- uni.showLoading({
|
|
|
|
- title: '奖品准备中...'
|
|
|
|
- });
|
|
|
|
|
|
+ if(!this.isFirstLoad){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '奖品准备中...'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
findEnable().then(res => {
|
|
findEnable().then(res => {
|
|
if(res.status == 200 && res.data){
|
|
if(res.status == 200 && res.data){
|
|
this.$u.vuex('vuex_LuckDraw',res.data)
|
|
this.$u.vuex('vuex_LuckDraw',res.data)
|
|
@@ -253,6 +257,7 @@ export default {
|
|
// 查询免费次数
|
|
// 查询免费次数
|
|
this.getCustomerTimes()
|
|
this.getCustomerTimes()
|
|
this.prizeList = this.requestPrizeList()
|
|
this.prizeList = this.requestPrizeList()
|
|
|
|
+ this.isFirstLoad = true
|
|
}else{
|
|
}else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -261,7 +266,11 @@ export default {
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.$u.vuex('vuex_LuckDraw',null)
|
|
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '活动已结束'
|
|
|
|
+ })
|
|
|
|
+ uni.navigateBack()
|
|
}
|
|
}
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
})
|
|
})
|
|
@@ -372,12 +381,14 @@ export default {
|
|
// 抽奖转盘绘制完成
|
|
// 抽奖转盘绘制完成
|
|
handleDrawFinish(res) {
|
|
handleDrawFinish(res) {
|
|
console.log('抽奖转盘绘制完成', res);
|
|
console.log('抽奖转盘绘制完成', res);
|
|
- uni.showToast({
|
|
|
|
- title: res.msg,
|
|
|
|
- duration: 2000,
|
|
|
|
- mask: true,
|
|
|
|
- icon: 'none'
|
|
|
|
- });
|
|
|
|
|
|
+ if(!this.isFirstLoad){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.msg,
|
|
|
|
+ duration: 2000,
|
|
|
|
+ mask: true,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 支付确定
|
|
// 支付确定
|
|
toPaySubmit(){
|
|
toPaySubmit(){
|