提交
This commit is contained in:
1 parent
a0da6427ef
commit
86694f739f
471 files changed
+62075
-44805
No files matched your search
@@ -7,9 +7,21 @@ const DEFAULT_GAP = 8
|
||||
const DEFAULT_HORIZONTAL_PADDING = 8
|
||||
|
||||
function getSystemInfo() {
|
||||
// 微信基础库 3.x 起 getSystemInfoSync 已弃用,优先拆分 API
|
||||
try {
|
||||
if (typeof uni.getWindowInfo === 'function') {
|
||||
const win = uni.getWindowInfo() || {}
|
||||
return {
|
||||
statusBarHeight: win.statusBarHeight,
|
||||
windowWidth: win.windowWidth
|
||||
}
|
||||
}
|
||||
} catch (_) {
|
||||
/* fall through */
|
||||
}
|
||||
try {
|
||||
return uni.getSystemInfoSync() || {}
|
||||
} catch (error) {
|
||||
} catch (_) {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user