2019年十月八號
轉藏:
版權聲明:本文為博主原創文章,遵循 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
{
"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 就可以了;(簡單說就是有底部導航欄的那個稱為主頁,主頁就應該放到第一個位置上,初始值也是第一個)
方案二:完美解決方案 (這個是界面跳轉模式)
在wxml里 加入 open-type="switchTab"
<navigator url="../zhuye/zhuye" open-type="switchTab" >
<button class="btn" bindtap="start" wx:if="{{index == movies.length - 1}}" >立即體驗</button>
</navigator>
方案三:
js里面用這個跳轉帶bar的頁面 (一般這個比較常用:)
//兼容詳情返回首頁底部消失的問題
wx.switchTab({
url : self.indexPagePath,//url路徑
success(res){
},
fail(){ //容錯處理
wx.navigateBack({
delta: 1,
fail:function(){
wx.reLaunch({
url: self.indexPagePath //url路徑
})
}
})
}
})
