function testUA(str) {
return navigator.userAgent.indexOf(str) > -1
}
function isIPhoneX() {
if (isH5()) {
return window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 375 && testUA('iPhone')
}
const { model } = Taro.getSystemInfoSync()
return model.search('iPhone X') != -1
}
网友评论