Commit e8fd367725c5fd5fb86c022e4f44222a1e5bf4d3

Authored by yvan.ni
1 parent 5423d1e4

判断一下手机品牌

Showing 1 changed file with 2 additions and 2 deletions
@@ -113,9 +113,9 @@ App({ @@ -113,9 +113,9 @@ App({
113 wx.getSystemInfo({ 113 wx.getSystemInfo({
114 success: (res) => { 114 success: (res) => {
115 // console.log(res) 115 // console.log(res)
116 - let modelmes = res.model; //手机品牌 116 + let modelmes = res?res.model:null; //手机品牌
117 console.log('手机品牌', modelmes) 117 console.log('手机品牌', modelmes)
118 - if (modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来 118 + if (modelmes && modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来
119 this.globalData.isIpx = true 119 this.globalData.isIpx = true
120 } 120 }
121 }, 121 },