app.js 560 B

123456789101112131415161718192021222324
  1. //app.js
  2. import {GetQueryString} from 'utils/util'
  3. const Towxml = require('/towxml/main');
  4. App({
  5. onLaunch: function (options) {
  6. // 判断设备是否为 iPhone X
  7. this.checkIsIPhoneX()
  8. },
  9. globalData: {
  10. isIPX: false, // 当前设备是否为 iPhone X
  11. },
  12. checkIsIPhoneX: function() {
  13. const self = this
  14. wx.getSystemInfo({
  15. success: function (res) {
  16. // 根据 model 进行判断
  17. if (res.model.search('iPhone X') != -1) {
  18. self.globalData.isIPX = true
  19. }
  20. }
  21. })
  22. },
  23. towxml: new Towxml()
  24. })