diff --git a/docs/api/a-d/interactive.md b/docs/api/a-d/interactive.md index 8cd95c038adbcf42539c63bc745ca86bb83518f5..52fecf6ee229ef1d54aa31655b896e045f72dea9 100644 --- a/docs/api/a-d/interactive.md +++ b/docs/api/a-d/interactive.md @@ -91,17 +91,20 @@ CreateInteractiveAd.show().catch((err) => { ```js CreateInteractiveAd.onLoad(res => { console.log('图片素材地址', res.imgUrl); - console.log('广告加载成功') + console.log('广告加载成功'); }) ``` +HBuilder基座的测试广告位 adpid: `1042956255` (游戏); `1620839118` (抽奖); `1064042976` (养成) + + 示例代码 ```html @@ -109,14 +112,15 @@ CreateInteractiveAd.onLoad(res => { export default { data() { return { - title: '场景广告', - loading: false + title: '互动广告', + loading: false, + imgUrl: "" } }, onReady() { this.adOption = { - adpid: '1111111113' // HBuilder基座的测试广告位 - provider: "" + adpid: '1042956255' + provider: "BXM-AD" }; // 创建广告实例 @@ -127,6 +131,7 @@ CreateInteractiveAd.onLoad(res => { var interactiveAd = this.interactiveAd = uni.createInteractiveAd(this.adOption); interactiveAd.onLoad((e) => { this.loading = false; + this.imgUrl = e.imgUrl; console.log("广告加载成功"); // 如果有广告图片素材, 通过 e.imgUrl 获取 }); @@ -161,6 +166,14 @@ CreateInteractiveAd.onLoad(res => { } } + ``` @@ -198,11 +211,3 @@ CreateInteractiveAd.onLoad(res => { 取消监听错误事件 -`CreateInteractiveAd.onClose(function callback)` - -监听广告关闭事件。 - -`CreateInteractiveAd.offClose(function callback)` - -取消监听广告关闭事件 -