methods: {
adLoad: function() {
if (tt.createRewardedVideoAd) {
videoAd = tt.createRewardedVideoAd({
adUnitId: "2hw48amcx9px4j8fb1"
})
videoAd.show()
videoAd.onLoad((status) => {
if (!this.result) {
this.getResult()
}
})
videoAd.onError(err => {})
videoAd.onClose((status) => {
if (status && status.isEnded || status === undefined) {
this.end = false
} else {
this.end = true
}
})
}
},
}
}
<template>
<view>
<button @click=" ">观看广告解锁全部内容</button>
</view>
</template>
各位老哥绑定事件是填上面那个代码??
1 个回复
DCloud_uni-ad_HDX
运行到哪个平台?app平台 createRewardedVideoAd 参数是 adpid,即广告位id,可在uniad 申请 https://uniad.dcloud.net.cn/home
adUnitId 是小程序平台的广告位,在各家小程序申请
app平台如何涉及到发放奖励,应以服务器回调为准,详情 https://uniapp.dcloud.net.cn/api/a-d/rewarded-video.html#callback