页面:wx.navigateTo({
url: '/pages/webview/webview?url=' + encodeURIComponent(url),
})
webView的json配置:
{
"usingComponents": {},
"homeButton":true
}
app.json:
{
"pages": [
"pages/index/index",
"pages/sxService/sxService",
"pages/hall/hall",
"pages/mine/mine",
"pages/logs/logs",
"pages/webview/webview",
"pages/search/search",
"pages/search_result/search_result",
"pages/login/login",
"pages/messageList/messageList",
"pages/messageDetail/messageDetail",
"pages/jumpWebView/jumpWebView"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Weixin",
"navigationBarBackgroundColor": "#ffffff"
},
"usingComponents": {
"footTab": "./components/footTab/footTab"
},
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents",
"requiredPrivateInfos": [
"getLocation"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
web-view的页面里自定义返回home的图标,调用wx.miniProgram.switchTab打开小程序的首页。
加上"navigationStyle":"default"