var t = getApp(),os = t.globalData.setting;
Component({
  properties: {
      title:{
          type: String,value: '你好'
      },
      bcolor:{
          type: String,value: '#fff'
      },
      color:{
          type: String,value: '#313131'
      },
      need_cover:{
          type: Number,value: 0
      }
  },
  data: {
    iurl: os.imghost,
    height:0,
    h1:0,
    h2:0,
    user_id:0,
    is_pc:0
  },
  ready: function() {
      let height= getApp().globalData.navBarHeight;
      let menuInfo = getApp().globalData.menuInfo || {height:0};
      let user_no='';
      if(getApp().globalData.userInfo){
          user_no=getApp().globalData.userInfo.erpvipno
      }
      //-- 胶囊的高度 --
      this.setData({height,h1:menuInfo.top,h2:menuInfo.height,user_no});
      if(getApp().globalData.is_pc){
          this.setData({is_pc:1})
      }
  },
  pageLifetimes: {
        //要处理一下，游客登录后的界面的变化,主要还该是改变会员
        show: function () {
            let user_no='';
            if(getApp().globalData.userInfo){
                user_no=getApp().globalData.userInfo.erpvipno
            }
            //-- 胶囊的高度 --
            this.setData({user_no});
        }
  },

  methods: {
      go_back(){
          let pages = getCurrentPages();
          if (pages[pages.length - 2]) {
              wx.navigateBack();
          } else {
              getApp().goto('/pages/index/index/index')
          }
      }

  }

})