diff --git a/pages/task/index.vue b/pages/task/index.vue index d6b764e..40d25d3 100644 --- a/pages/task/index.vue +++ b/pages/task/index.vue @@ -4,7 +4,8 @@ - + 任务大厅 @@ -32,12 +33,12 @@ v-for="(item,index) in signInList" :key="index"> - - - - {{item.showText}} + + + + {{item.showText}} @@ -79,14 +80,12 @@ - - - {{error}} - - + + + {{error}} + @@ -127,13 +126,11 @@ signInBtn: '点击签到', isShowMoneyPay: true, isIos: false, - isLoading: false, - isAndroid: false, + isAndroid: true, urlCallback: null, } }, onShow() { - this.getTaskdata() this.getsignIn() this.$Request.getT("app/common/type/919", {}).then(res => { @@ -145,34 +142,14 @@ // #ifdef APP this.isAndroid = sysInfo.platform === 'android' // #endif - + this.isShowMoneyPay = !(res.data.value == '1' && isIos) } }); - - }, - async onReady() { - this.urlCallback = { - userId: uni.getStorageSync('userId'), - extra: uni.getStorageSync('userId')+""+new Date().getTime(), - } - - this.isLoading = true; - // 首次加载广告 - setTimeout(() => { - this.$refs.adRewardedVideo.load(); - }, 1000) - + }, methods: { - showAd() { - if (this.isLoading) { - return - } - this.$refs.adRewardedVideo.show(); - }, onadload(e) { - this.isLoading = false; console.log('广告数据加载成功'); }, async onadclose(e) { @@ -180,7 +157,6 @@ if (detail && detail.isEnded) { // 正常播放结束 // /sqx_fast/app/ad/state - console.log(this.urlCallback.extra) let res = await this.$Request.getT('app/ad/state', { extraKey: this.urlCallback.extra }) @@ -188,7 +164,7 @@ if (res.code == 0) { console.log(res) uni.showToast({ - title: '获得'+res.data.value+'分钟免费时长', + title: '获得' + res.data.value + '分钟免费时长', icon: 'none' }) } @@ -196,13 +172,9 @@ } else { // 播放中途退出 } - //this.isLoading = true; - //this.$refs.adRewardedVideo.load(); }, - onaderror(e) { - // 广告加载失败 + onaderror(e) { // 广告加载失败 console.log("广告加载失败") - this.isLoading = false; }, /** * 获取签到数据 @@ -251,12 +223,18 @@ // jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 , // type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 , // buttonUrl - + if (item.jumpType == 0) { if (item.buttonTitle.indexOf("领取") != -1) { this.taskReceive(item.id) - }if (item.buttonTitle.indexOf("观看视频") != -1) { - this.showAd() + } + if (item.buttonTitle.indexOf("观看视频") != -1) { + // 首次加载广告 + this.urlCallback = { + userId: uni.getStorageSync('userId'), + extra: uni.getStorageSync('userId') + "" + new Date().getTime(), + } + this.$refs.adRewardedVideo.show(); } else { uni.switchTab({ url: "/pages/index/index"