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路径 }) } }) } })