点击显示广告 提示组件有错误 没有tap事件
- 发布:2022-09-20 08:50
- 更新:2022-09-20 13:27
- 阅读:435
没有复现你的问题,提供下广告相关代码
-
jackbon (作者)
<ad-rewarded-video adpid="xxxxxxxxxxx" :loadnext="true" v-slot:default="{loading, error}">
<button :disabled="loading" :loading="loading">显示广告</button>
<view v-if="error">{{error}}</view>
</ad-rewarded-video>
2022-09-20 15:34
-
jackbon (作者)
还有下面的代码都试过了 都不显示不出来 node-modules/@dcloudio/uni-cli-shared/components/ad-rewarded-video does not have a method "__e" to handle event "tap"
2022-09-20 15:35
jackbon (作者)
<template>
<view style="margin-top: 150px;" class="content">
<ad-rewarded-video :adpid="adpids" :loadnext="true" v-slot:default="{loading, error}" @load="onadload" @close="onadclose" @error="onaderror">
<button :disabled="loading" :loading="loading">显示广告{{error}}{{loading}}</button>
<view v-if="error">{{error}}{{loading}}</view>
</ad-rewarded-video>
</view>
</template>
<script>
export default {
data() {
return {
adpids: ["xxxxxxxxxxxx"]
}
},
methods: {
onadload(e) {
console.log('广告数据加载成功');
},
onadclose(e) {
const detail = e.detail
// 用户点击了【关闭广告】按钮
if (detail && detail.isEnded) {
// 正常播放结束
console.log("onadclose " + detail.isEnded);
} else {
// 播放中途退出
console.log("onadclose " + detail.isEnded);
}
},
onaderror(e) {
// 广告加载失败
console.log("onaderror: ", e.detail);
}
}
}
</script>
-
jackbon (作者)
回复 DCloud_uni-ad_HDX: <ad-rewarded-video adpid="xxxxxxxxxxx" :loadnext="true" v-slot:default="{loading, error}">
<button :disabled="loading" :loading="loading">显示广告</button>
<view v-if="error">{{error}}</view>
</ad-rewarded-video>
这样写有问题吗2022-09-21 08:31