任务列表广告加载优化

This commit is contained in:
GaoHao 2024-12-27 16:09:15 +08:00
parent 36d8f2fd39
commit da80801e8c
1 changed files with 15 additions and 9 deletions

View File

@ -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