| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | import {  ApiModel} from "./utils/api";const _Http = new ApiModel();App({  onLaunch() {    /* 计算tabbar+iphone安全距离  tabbar页面+100rpx*/    let safeAreaBottom = 0,      capsule = wx.getMenuButtonBoundingClientRect(),      height = 200,      that = this;    //获取轮播图    this.getBanner();    wx.getSystemInfo({      success(res) {        //计算底部安全距离高度        safeAreaBottom += res.screenHeight - res.safeArea.bottom;        //计算自定义导航的高度        height = capsule.height + res.statusBarHeight + (capsule.top - res.statusBarHeight) + 8;        that.globalData.safeAreaBottom = safeAreaBottom;        //判断是否为平板        if (res.model.slice(0, 4) == "iPad") return that.globalData.myNavBorHeight = height;        that.globalData.myNavBorHeight = height * 2;      }    })  },  getBanner() {    //轮播图    _Http.basic({      "classname": "publicmethod.bannermag.bannermag",      "method": "query_bannerlocationlist",      "content": {        "siteid": "BWJ",        "fclienttype": "MOBILE"      }    }).then(res => {      if (res.msg != '成功') return this.getBanner();      this.globalData.bannerDataList = res.data;    })  },  globalData: {    myNavBorHeight: 0, //自定义头部导航高度    safeAreaBottom: 0, //底部安全距离    account_list: [], //用户列表    bannerDataList: [], //轮播图列表    servicehotline: '', //客服手机号    msgFcount: "", //徽标数量  }})
 |