Skip to content

Commit 3ae7d07

Browse files
committed
udpate: <ad> 增加错误提示信息
1 parent 9620a32 commit 3ae7d07

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pages/component/ad/ad.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<view>
33
<page-head :title="title"></page-head>
44
<view class="ad-view">
5-
<ad adpid="1111111111" :unit-id="unitId" type="feed" @load="adload"></ad>
5+
<ad adpid="1111111111" :unit-id="unitId" type="feed" @load="adload" @error="aderror"></ad>
66
<!-- #ifdef APP-PLUS -->
77
<view class="ad-tips" v-if="!isLoad">
8-
<text>广告加载中...</text>
8+
<text>{{adMessage}}</text>
99
</view>
1010
<!-- #endif -->
1111
<!-- #ifndef APP-PLUS -->
@@ -26,7 +26,8 @@
2626
return {
2727
title: 'AD组件',
2828
unitId: '',
29-
isLoad: false
29+
isLoad: false,
30+
adMessage: "广告加载中..."
3031
}
3132
},
3233
onLoad() {
@@ -44,6 +45,9 @@
4445
adload() {
4546
this.isLoad = true;
4647
},
48+
aderror(e) {
49+
this.adMessage = e.detail.errMsg;
50+
},
4751
gotoapi() {
4852
uni.navigateTo({
4953
url: "/pages/API/rewarded-video-ad/rewarded-video-ad"

0 commit comments

Comments
 (0)