fix: iOS16.4之前版本无法进入的问题

This commit is contained in:
kuaifan 2023-05-10 19:48:56 +08:00
parent a680538f80
commit 385abae741
3 changed files with 17 additions and 2 deletions

View File

@ -233,7 +233,7 @@ export default {
windowSizeListener() {
const windowWidth = $A(window).width(),
windowHeight = $A(window).height(),
windowOrientation = $A.strExists(window.screen.orientation.type, 'portrait') ? 'portrait' : 'landscape'
windowOrientation = $A.screenOrientation()
this.$store.state.windowTouch = "ontouchend" in document

View File

@ -547,6 +547,21 @@ const localforage = require("localforage");
}, 250);
},
/**
* 获取屏幕方向
* @returns {string}
*/
screenOrientation() {
try {
if (typeof window.screen.orientation === "object") {
return $A.strExists(window.screen.orientation.type, 'portrait') ? 'portrait' : 'landscape'
}
} catch (e) {
//
}
return $A(window).width() > $A(window).height() ? "landscape" : "portrait"
},
/**
* 是否IOS
* @returns {boolean|string}

View File

@ -1,6 +1,6 @@
const windowWidth = $A(window).width(),
windowHeight = $A(window).height(),
windowOrientation = $A.strExists(window.screen.orientation.type, 'portrait') ? 'portrait' : 'landscape'
windowOrientation = $A.screenOrientation()
export default {
// 客户端ID希望不变的除非清除浏览器缓存或者卸载应用