报错内容:
VM346 WAService.js:2
ReferenceError: rewardedVideoAd is not defined
at se.onLoad (shejiweb.js? [sm]:39)
at se.<anonymous> (VM346 WAService.js:2)
at se.c.__callPageLifeTime__ (VM346 WAService.js:2)
at Le (VM346 WAService.js:2)
at Ye (VM346 WAService.js:2)
at Function.<anonymous> (VM346 WAService.js:2)
at i.<anonymous> (VM346 WAService.js:2)
at i.emit (VM346 WAService.js:2)
at Object.emit (VM346 WAService.js:2)
at i.<anonymous> (VM346 WAService.js:2)
代码:
onLoad:function(options){
console.log(options)
var that = this
var wangye_id = options.wangye_id;
const db = wx.cloud.database()
db.collection('sheji').doc(wangye_id).get({
success:function(res){
console.log(res.data)
that.setData({
listshuzu:res.data
})
}
})
if (wx.createRewardedVideoAd) {
videoAd = wx.createRewardedVideoAd({
adUnitId: 'adunit-2ff83af25aca3842'
})
videoAd.onLoad(() => {})
videoAd.onError((err) => {})
videoAd.onClose((res) => {})
}
rewardedVideoAd.onClose(res => {
if (res && res.isEnded) {
this.setData({
view:true
})
} else {
}
})
},
请问各位大神,广告关闭无法识别具体关闭的情况,太难了。