广告加载失败触发提醒
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
<!-- 激励视频广告 -->
|
||||
<view style="width: 0;height: 0;overflow: hidden;">
|
||||
<!-- 激励视频广告 -->
|
||||
<ad-rewarded-video v-if="datas.adRewardedShow" ref="adRewarded" :adpid="datas.adpid" :loadnext="true"
|
||||
<ad-rewarded-video ref="adRewarded" :adpid="datas.adpid" :loadnext="true"
|
||||
:url-callback="datas.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
|
||||
</ad-rewarded-video>
|
||||
</view>
|
||||
@@ -104,7 +104,7 @@
|
||||
list: [],
|
||||
urlCallback: {},
|
||||
adpid: null,
|
||||
adRewardedShow: true,
|
||||
adRewardedShow: false,
|
||||
adRewardedVideoloadNum: 0,
|
||||
|
||||
})
|
||||
@@ -247,7 +247,6 @@
|
||||
*/
|
||||
function onaderror(e) {
|
||||
if (datas.adRewardedVideoloadNum >= 3) {
|
||||
datas.adRewardedShow = false;
|
||||
return
|
||||
}
|
||||
datas.adRewardedVideoloadNum++
|
||||
@@ -316,6 +315,13 @@
|
||||
}
|
||||
} else if (item.buttonTitle.indexOf("观看视频") != -1) {
|
||||
// 首次加载广告
|
||||
if(!datas.adRewardedShow){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '广告加载失败,请稍后重试'
|
||||
});
|
||||
return
|
||||
}
|
||||
datas.urlCallback = {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
extra: uni.getStorageSync('userId') + "" + new Date().getTime(),
|
||||
|
||||
Reference in New Issue
Block a user