xiazai: function(t) {
var url = t.currentTarget.dataset.url; // 获取全局广告数据 const globalAdData = getApp().globalData.adData;
console.log('globalAdData',globalAdData)
// 然后继续处理广告数据
const adData = globalAdData.find(item => item.name === '**********');
if (adData) {
console.log(adData.adstate);
if (adData.adstate) {
wx.showModal({
title: '提示',
content: '需要观看广告才能获取哦,是否继续?',
success: function(res) {
if (res.confirm) {
let rewardedVideoAd = wx.createRewardedVideoAd({ adUnitId: 'adunit-************' });
rewardedVideoAd.onLoad(() => {
console.log('激励广告加载完成');
});
rewardedVideoAd.onError((err) => {
console.log('激励广告错误', err);
wx.showModal({
title: '提示',
content: '激励广告加载失败',
showCancel: false
});
rewardedVideoAd.offError();
});
rewardedVideoAd.onClose((res) => {
if (res && res.isEnded) {
wx.setClipboardData({
data: url,
success: function() {
wx.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
}
});
} else {
wx.showModal({
title: '提示',
content: '观看完整广告才能下载哦',
showCancel: false
});
}
});
rewardedVideoAd.load().then(() => {
rewardedVideoAd.show().catch(() => {
wx.showModal({
title: '提示',
content: '广告展示失败,请稍后重试。电脑端无法获取广告',
showCancel: false
});
});
}).catch(() => {
wx.showModal({
title: '提示',
content: '广告展示失败,请稍后重试。电脑端无法获取广告',
showCancel: false
});
});
}
}
});
} else {
wx.setClipboardData({
data: url,
success: function() {
wx.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
}
});
}
}
},
你好,麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点