代码:

{
  "pages":[
    "pages/index/index",
    "pages/swipe/swipe",
    "pages/movies/movies",
    "pages/swipe/swipe-detail/swipe-detail",
    "pages/logs/logs"
  ],
  "requiredBackgroundModes": [
    "audio"
  ],
  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#405f80",
    "navigationBarTitleText": "WeChat",
    "navigationBarTextStyle":"black"
  },
  "tabBar": {
    "borderStyle": "white",
    "position": "bottom",
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath": "images/tab/ciwei.png",
        "selectedIconPath": "images/tab/ciwei_hl.png"
      },
      {
        "pagePath": "pages/swipe/swipe",
        "text": "阅读",
        "iconPath": "images/tab/yuedu.png",
        "selectedIconPath": "images/tab/yuedu_hl.png"
      },
      {
        "pagePath": "pages/movies/movies",
        "text": "电影",
        "iconPath": "images/tab/dianying.png",
        "selectedIconPath": "images/tab/dianying_hl.png"
      }
    ]
  }
}

注意:

pages/index/index   这个路径 跟 list 的 第一个对象的路径相同

跳转到tabar 选项页面:

 //打开一个新页面
    wx.switchTab({
      url: '../swipe/swipe',
    })

 

越努力越幸运