zoukankan      html  css  js  c++  java
  • 微信小程序tabBar底部导航 不显示问题解析

    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路径
                          })
                      }
                  })
              }
          })
    
    
    
  • 相关阅读:
    C# 隐式转换 显示转换
    C# 枚举几种写法细节
    C# System.Int32 与 int 区别
    JavaScript中的闭包
    JS Arguments对象
    分页存储过程 sql
    JS Select 选项清空
    WebGL学习笔记三
    WebGL学习笔记二
    WebGL学习笔记一
  • 原文地址:https://www.cnblogs.com/zxyun/p/11633689.html
Copyright © 2011-2022 走看看