From 62c934e7c5dd66ca2316c7fd24a0edd782364305 Mon Sep 17 00:00:00 2001 From: Anne_LXM <54163582+anne-lxm@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/uni-ad/ad-weixin-native.md | 51 ++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/docs/uni-ad/ad-weixin-native.md b/docs/uni-ad/ad-weixin-native.md index aa58bf392..feab94280 100644 --- a/docs/uni-ad/ad-weixin-native.md +++ b/docs/uni-ad/ad-weixin-native.md @@ -34,10 +34,25 @@ ```html - - - - + + + + + + + + + + + + + ``` @@ -45,11 +60,27 @@ ```js Page({ - data: { - }, - showAd: function (e) { - this._uniAd = this.selectComponent('.uni-ad'); - this._uniAd.show(); - } + data: {}, + showRewardedVideoAd: function (e) { + this.selectComponent('.uni-rewarded-video-ad').show(); + }, + showInterstitialAd: function (e) { + this.selectComponent('.uni-interstitial-ad').show(); + }, + onadclose: function(e) { + const detail = e.detail + // 用户点击了【关闭广告】按钮 + if (detail && detail.isEnded) { + // 正常播放结束 + console.log("onClose-正常播放结束:" + detail.isEnded); + } else { + // 播放中途退出 + console.log("onClose-播放中途退出:" + detail.isEnded); + } + }, + onaderror: function(e) { + // 广告加载失败 + console.log('广告加载失败:', e.detail) + } }) ``` -- GitLab