|
@@ -205,16 +205,10 @@ export default {
|
|
|
weightTotal: 0,
|
|
|
// 权重数组
|
|
|
weightArr: [],
|
|
|
- isSocktOut: false // 是否正在抽奖
|
|
|
+ isSocktOut: false ,// 是否正在抽奖
|
|
|
+ scene: '', // 场景
|
|
|
};
|
|
|
},
|
|
|
- watch: {
|
|
|
- showLottery(newValue, oldValue) {
|
|
|
- if(!newValue&&(this.winTypes=='win_0'||this.winTypes=='win_2'||this.winTypes=='win_3')){
|
|
|
- // this.$refs.lottery.onRotateStart()
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
// 重置
|
|
|
handleInitCanvas() {
|
|
@@ -247,6 +241,7 @@ export default {
|
|
|
title: '奖品准备中...'
|
|
|
});
|
|
|
findEnable().then(res => {
|
|
|
+ console.log(res,'getPrizeList')
|
|
|
if(res.status == 200 && res.data){
|
|
|
this.$u.vuex('vuex_LuckDraw',res.data)
|
|
|
this.luckDraw = res.data
|
|
@@ -255,6 +250,8 @@ export default {
|
|
|
if(a){
|
|
|
// 查询免费次数
|
|
|
this.getCustomerTimes()
|
|
|
+ // 查询亦获奖列表
|
|
|
+ this.getDrawList()
|
|
|
this.prizeList = this.requestPrizeList()
|
|
|
}else{
|
|
|
uni.showModal({
|
|
@@ -309,14 +306,16 @@ export default {
|
|
|
},
|
|
|
// 抽奖次数用完了
|
|
|
showPayWin(winTypes){
|
|
|
- this.showLottery = true
|
|
|
- this.winTypes = winTypes
|
|
|
- this.prizeIndex = -1
|
|
|
- // clearCacheFile()
|
|
|
+ if(this.hasLogin){
|
|
|
+ this.showLottery = true
|
|
|
+ this.winTypes = winTypes
|
|
|
+ this.prizeIndex = -1
|
|
|
+ // clearCacheFile()
|
|
|
+ }
|
|
|
},
|
|
|
// 本次抽奖开始
|
|
|
handleDrawStart() {
|
|
|
- if(this.isSocktOut){
|
|
|
+ if(this.isSocktOut||this.scene==1154){
|
|
|
return
|
|
|
}
|
|
|
this.targetName = '';
|
|
@@ -449,39 +448,35 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
- onShow() {
|
|
|
- // 查询免费抽奖次数
|
|
|
- this.getCustomerTimes()
|
|
|
- // 查询亦获奖列表
|
|
|
- this.getDrawList()
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- this.luckDraw = this.$store.state.vuex_LuckDraw
|
|
|
+ onLoad(options) {
|
|
|
+ let lopts = uni.getLaunchOptionsSync()
|
|
|
+ console.log(lopts,'aaaa')
|
|
|
+ this.scene = lopts.scene
|
|
|
|
|
|
// 判断是否登录
|
|
|
checkLogin().then(res => {
|
|
|
console.log(res,'checkLogin')
|
|
|
this.hasLogin = res.status == 200
|
|
|
- if(!this.hasLogin){
|
|
|
- uni.redirectTo({
|
|
|
- url:"/pages/login/login"
|
|
|
+ if(this.scene!=1154&&!this.hasLogin){
|
|
|
+ uni.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ title: '请先登录后再抽奖!',
|
|
|
+ success() {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/login?path=/pagesA/luckDraw/luckDraw'
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- }else{
|
|
|
- // 请求奖品数据
|
|
|
- this.getPrizeList();
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ // 请求奖品数据
|
|
|
+ this.getPrizeList();
|
|
|
+
|
|
|
// 计算转盘宽度和高度
|
|
|
const res = uni.getSystemInfoSync();
|
|
|
this.canvasData.width = res.screenWidth * 0.65
|
|
|
this.canvasData.height = res.screenWidth * 0.65
|
|
|
-
|
|
|
- // 开启分享
|
|
|
- uni.showShareMenu({
|
|
|
- withShareTicket: true,
|
|
|
- menus: ['shareAppMessage', 'shareTimeline']
|
|
|
- })
|
|
|
},
|
|
|
onUnload() {
|
|
|
uni.hideLoading();
|
|
@@ -497,7 +492,8 @@ export default {
|
|
|
onShareTimeline() {
|
|
|
return {
|
|
|
title: '[乐色管家]参与垃圾分类,让城市更美丽!好运等你转出来!',
|
|
|
- imageUrl:'/static/zpthumbr.jpg'
|
|
|
+ imageUrl:'/static/zpthumbr.jpg',
|
|
|
+ query: 'fromType=timeline'
|
|
|
}
|
|
|
}
|
|
|
};
|