任务列表广告加载优化
This commit is contained in:
parent
36d8f2fd39
commit
da80801e8c
|
|
@ -118,6 +118,7 @@
|
|||
isIos: false,
|
||||
isAndroid: false,
|
||||
adRewardedVideo: true,
|
||||
adRewardedVideoloadNum: 0,
|
||||
urlCallback: null,
|
||||
isTooltipVisible: false,
|
||||
tooltipTimeout: null,
|
||||
|
|
@ -138,7 +139,11 @@
|
|||
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.$nextTick(()=>{
|
||||
this.adRewardedVideoloadNum = 0
|
||||
this.$refs.adRewardedVideo.load();
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
|
@ -167,9 +172,15 @@
|
|||
* 广告加载失败回调
|
||||
* @param {Object} e
|
||||
*/
|
||||
onaderror(e) { // 广告加载失败
|
||||
this.$refs.adRewardedVideo.load();
|
||||
// this.adRewardedVideo = false;
|
||||
onaderror(e) {
|
||||
if ( this.adRewardedVideoloadNum >=3 ) {
|
||||
this.adRewardedVideo = false;
|
||||
return
|
||||
}
|
||||
this.adRewardedVideoloadNum++
|
||||
setTimeout(() => {
|
||||
this.$refs.adRewardedVideo.load();
|
||||
}, 1000); // 10
|
||||
console.log("广告加载失败")
|
||||
},
|
||||
|
||||
|
|
@ -247,10 +258,6 @@
|
|||
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
|
||||
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
|
||||
// buttonUrl
|
||||
uni.showToast({
|
||||
title: this.adRewardedVideo,
|
||||
icon: 'none'
|
||||
})
|
||||
if (item.jumpType == 0) {
|
||||
if (item.buttonTitle.indexOf("领取") != -1) {
|
||||
this.taskReceive(item.id)
|
||||
|
|
@ -333,7 +340,6 @@
|
|||
this.list.map(item=>{
|
||||
item.show = true
|
||||
})
|
||||
console.log(this.adRewardedVideo)
|
||||
this.list.map(item=>{
|
||||
if(item.title.indexOf("观看视频") != -1&&!this.adRewardedVideo) {
|
||||
item.show = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue