提交 eb3f640c 编写于 作者: Q qiang

fix: H5 修复 PC 端获取屏幕宽高错误的问题

上级 3d0a248f
......@@ -18,8 +18,8 @@ export function getSystemInfoSync () {
var pixelRatio = window.devicePixelRatio
// 横屏时 iOS 获取的屏幕宽高颠倒,进行纠正
var landscape = Math.abs(window.orientation) === 90
var screenWidth = Math[landscape ? 'max' : 'min'](screen.width, screen.height)
var screenHeight = Math[landscape ? 'min' : 'max'](screen.height, screen.width)
var screenWidth = typeof window.orientation === 'number' ? Math[landscape ? 'max' : 'min'](screen.width, screen.height) : screen.width
var screenHeight = typeof window.orientation === 'number' ? Math[landscape ? 'min' : 'max'](screen.height, screen.width) : screen.height
var windowWidth = Math.min(window.innerWidth, document.documentElement.clientWidth, screenWidth)
var windowHeight = window.innerHeight
var language = navigator.language
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册