//app.js import {GetQueryString} from 'utils/util' App({ onLaunch: function (options) { // 判断设备是否为 iPhone X this.checkIsIPhoneX() }, globalData: { isIPX: false, // 当前设备是否为 iPhone X }, checkIsIPhoneX: function() { const self = this wx.getSystemInfo({ success: function (res) { // 根据 model 进行判断 if (res.model.search('iPhone X') != -1) { self.globalData.isIPX = true } } }) } })