no message
Showing
3 changed files
with
7 additions
and
2 deletions
... | @@ -20,6 +20,7 @@ | ... | @@ -20,6 +20,7 @@ |
20 | "pages/sign-in-record/sign-in-record", | 20 | "pages/sign-in-record/sign-in-record", |
21 | "pages/rank/rank", | 21 | "pages/rank/rank", |
22 | "pages/rank-gift/rank-gift", | 22 | "pages/rank-gift/rank-gift", |
23 | "pages/webview/webview", | ||
23 | "pages/example/example", | 24 | "pages/example/example", |
24 | "pages/more/more" | 25 | "pages/more/more" |
25 | ], | 26 | ], | ... | ... |
... | @@ -4,7 +4,7 @@ Page({ | ... | @@ -4,7 +4,7 @@ Page({ |
4 | isShow: false, // 控制组件显示隐藏 | 4 | isShow: false, // 控制组件显示隐藏 |
5 | url: '' | 5 | url: '' |
6 | }, | 6 | }, |
7 | onLoad: function (options = {}) { | 7 | onLoad(options = {}) { |
8 | let url = options.url; | 8 | let url = options.url; |
9 | if (url) { | 9 | if (url) { |
10 | this.setData({ | 10 | this.setData({ |
... | @@ -17,5 +17,9 @@ Page({ | ... | @@ -17,5 +17,9 @@ Page({ |
17 | title: 'none', | 17 | title: 'none', |
18 | }); | 18 | }); |
19 | } | 19 | } |
20 | }, | ||
21 | |||
22 | onBindMessage(e) { | ||
23 | console.log("webview message:", e); | ||
20 | } | 24 | } |
21 | }) | 25 | }) | ... | ... |
... | @@ -4,4 +4,4 @@ | ... | @@ -4,4 +4,4 @@ |
4 | <view class="text">加载中...</view> | 4 | <view class="text">加载中...</view> |
5 | </view> | 5 | </view> |
6 | </view> | 6 | </view> |
7 | <web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc"/> | 7 | <web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc" bindmessage="onBindMessage" /> | ... | ... |
-
Please register or sign in to post a comment