34 lines
770 B
JavaScript
34 lines
770 B
JavaScript
|
//app.js
|
||
|
import AppService from './utils/appService.js'
|
||
|
App({
|
||
|
AppService: AppService,
|
||
|
globalData: {
|
||
|
isIPX: false,
|
||
|
pageLen: 15, // 统一单页条数
|
||
|
loginUserInfo: null
|
||
|
},
|
||
|
onLaunch: function (options) {
|
||
|
const scene = options.scene
|
||
|
this.getSystemInfo()
|
||
|
},
|
||
|
onShow: function (options) {
|
||
|
wx.hideTabBar()
|
||
|
},
|
||
|
onHide: function () {
|
||
|
|
||
|
},
|
||
|
onUnload: function () {
|
||
|
|
||
|
},
|
||
|
// 获取手机系统相关信息
|
||
|
getSystemInfo: function () {
|
||
|
const res = wx.getSystemInfoSync()
|
||
|
const model = res.model
|
||
|
this.globalData.system = res.platform
|
||
|
this.globalData.systemHeight = res.windowHeight
|
||
|
this.globalData.systemWidth = res.windowWidth
|
||
|
if (/iPhone X/.test(model)) {
|
||
|
this.globalData.isIPX = true
|
||
|
}
|
||
|
}
|
||
|
})
|