//app.js

const HttpSever = require('./utils/http.js').HttpSever;
const $api = require('./config/api.js').$api;

App({
  onLaunch: function() {
    let _self = this
    wx.getSystemInfo({
      success(res) {
        if (res.model.indexOf('iPhone') !== -1 && res.system.indexOf('iOS') !== -1 && res.screenHeight >= 812) { // iphoneX及以上机型适配
          _self.globalData.ScreenBottomHeight = 30
        }
      }
    })

    HttpSever.Ajax({
      url: $api.dict.list.url,
      method: $api.dict.list.method,
    }).then((data) => {
      _self.globalData.Dict = data.data
    })
  },
  globalData: {
    UserInfo: {
      UserIcon: '/assets/images/img4.jpg',
      UserName: '用户名',
      UserPhone: '18267901393'
    },
    ScreenBottomHeight: 0,
    Dict: []
  }
})