2019年十月八號url
轉藏:
版權聲明:本文爲博主原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連接和本聲明。
本文連接:https://blog.csdn.net/wy_Blog/article/details/64919874
————————————————
版權聲明:本文爲CSDN博主「wy_Blog」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連接及本聲明。
原文連接:https://blog.csdn.net/wy_Blog/article/details/64919874.net
{ "pages": [ "pages/splash/splash", "pages/zhuye/zhuye", "pages/list/list", "pages/item/item", "pages/search/search", "pages/profile/profile" ], "window": { "navigationBarBackgroundColor": "#35495e", "navigationBarTextStyle": "white", "navigationBarTitleText": "電影 « 豆瓣", "backgroundColor": "#fff", "backgroundTextStyle": "dark", "enablePullDownRefresh": true }, "tabBar": { "list": [ { "pagePath": "pages/zhuye/zhuye", "iconPath": "images/board.png", "selectedIconPath": "images/board-actived.png", "text": "榜單" }, { "pagePath": "pages/search/search", "iconPath": "images/search.png", "selectedIconPath": "images/search-actived.png", "text": "搜索" }, { "pagePath": "pages/profile/profile", "iconPath": "images/profile.png", "selectedIconPath": "images/profile-actived.png", "text": "個人" } ] },
解決方案一:把 tabBar配置中的 "pagePath": "pages/zhuye/zhuye", 換成 配置爲首頁的pages/splash/splash 就能夠了;(簡單說就是有底部導航欄的那個稱爲主頁,主頁就應該放到第一個位置上,初始值也是第一個)code
方案二:完美解決方案 (這個是界面跳轉模式)xml
在wxml裏 加入 open-type="switchTab"blog
<navigator url="../zhuye/zhuye" open-type="switchTab" > <button class="btn" bindtap="start" wx:if="{{index == movies.length - 1}}" >當即體驗</button> </navigator>
方案三:
js裏面用這個跳轉帶bar的頁面 (通常這個比較經常使用:)get
//兼容詳情返回首頁底部消失的問題 wx.switchTab({ url : self.indexPagePath,//url路徑 success(res){ }, fail(){ //容錯處理 wx.navigateBack({ delta: 1, fail:function(){ wx.reLaunch({ url: self.indexPagePath //url路徑 }) } }) } })