<script>
export default {
  onLaunch: function () {
    var _this = this;
    if (!uni.getStorageSync('isLogin')) {
      uni.redirectTo({
        url: '/pages/login/login'
      })
    } else {
      this.$isResolve()
    }
    //获取系统信息
    uni.getSystemInfo({
      success: function (res) {
        var data = res;
        let modelmes = res.model; //手机品牌
        if (modelmes.indexOf('iPhone X') != -1 || modelmes.indexOf('iPhone XS') != -1 || modelmes.indexOf('iPhone XR') != -1 || modelmes.indexOf('iPhone XS Max') != -1 || modelmes.indexOf('iPhone 11') != -1 || modelmes.indexOf('iPhone 11 Pro') != -1 || modelmes.indexOf('iPhone 11 Pro Max') != -1) {
          data.isIpx = true
        }
        data.safeAreaTop = data.statusBarHeight + 40;//statusBarHeight为状态栏的高度，safeAreaTop为内容区距离顶部位置
        _this.$store.commit('setSystemInfo', data)
      }
    });
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  },
}
</script>

<style lang="scss">
page {
  background: #fff;
  height: 100%;
  color: #0F161E;
}

/*每个页面公共css */
/* 解决小程序和app滚动条的问题 */
/* #ifdef MP-WEIXIN || APP-PLUS */
 ::-webkit-scrollbar {
   display: none;
   width: 0 !important;
   height: 0 !important;
   -webkit-appearance: none;
   background: transparent;
   color: transparent;
 }
/* #endif */

/* 解决H5 的问题 */
/* #ifdef H5 */
uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  /* 隐藏滚动条，但依旧具备可以滚动的功能 */
  display: none;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
  background: transparent;
  color: transparent;
}
/* #endif */


</style>
