com_top_nav.js 856 Bytes
var t = getApp(),os = t.globalData.setting;
Component({
  properties: {
      title:{
          type: String,value: '你好'
      },
      bcolor:{
          type: String,value: '#fff'
      },
      color:{
          type: String,value: '#313131'
      }
  },
  data: {
    iurl: os.imghost,
    height:0,
    h1:0,
    h2:0,
    user_id:0
  },
  ready: function() {
      let height= getApp().globalData.navBarHeight;
      let menuInfo = getApp().globalData.menuInfo;
      //-- 胶囊的高度 --
      this.setData({height,h1:menuInfo.top,h2:menuInfo.height,user_id:getApp().globalData.user_id});
  },
  methods: {
      go_back(){
          let pages = getCurrentPages();
          if (pages[pages.length - 2]) {
              wx.navigateBack();
          } else {
              getApp().goto('/pages/index/index/index')
          }
      }

  }

})