h5中:
function isIphonex () {
if (typeof window !== 'undefined' && window) {
return /iphone/gi.test(window.navigator.userAgent) && window.screen.height >= 812;
}
return false;
};
小程序中
wx.getSystemInfo({
success: res => {
if (res.model.indexOf('iPhone X') > -1) { //iphonex,xr,xs
that.isIos = true
}else{
that.isIos = false
}
},
})