Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
zhiliang-light-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a3892636
authored
2019-08-15 16:53:18 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
cee15072
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
23 deletions
src/app.json
src/pages/webview/webview.js
src/pages/webview/webview.wxml
src/app.json
View file @
a389263
...
...
@@ -20,6 +20,7 @@
"pages/sign-in-record/sign-in-record"
,
"pages/rank/rank"
,
"pages/rank-gift/rank-gift"
,
"pages/webview/webview"
,
"pages/example/example"
,
"pages/more/more"
],
...
...
src/pages/webview/webview.js
View file @
a389263
let
app
=
getApp
();
Page
({
data
:
{
isShow
:
false
,
// 控制组件显示隐藏
url
:
''
},
onLoad
:
function
(
options
=
{})
{
let
url
=
options
.
url
;
if
(
url
)
{
this
.
setData
({
url
:
url
,
isShow
:
true
})
}
else
{
wx
.
showToast
({
title
:
'未找到页面地址'
,
title
:
'none'
,
});
}
}
data
:
{
isShow
:
false
,
// 控制组件显示隐藏
url
:
''
},
onLoad
(
options
=
{})
{
let
url
=
options
.
url
;
if
(
url
)
{
this
.
setData
({
url
:
url
,
isShow
:
true
})
}
else
{
wx
.
showToast
({
title
:
'未找到页面地址'
,
title
:
'none'
,
});
}
},
onBindMessage
(
e
)
{
console
.
log
(
"webview message:"
,
e
);
}
})
...
...
src/pages/webview/webview.wxml
View file @
a389263
<view class="loading-wrap">
<view class="loading">
<view class="icon"></view>
<view class="text">加载中...</view>
</view>
<view class="loading">
<view class="icon"></view>
<view class="text">加载中...</view>
</view>
</view>
<web-view
wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc"
/>
<web-view
wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc" bindmessage="onBindMessage"
/>
...
...
Please
register
or
sign in
to post a comment