Files
fire_goal/app/src/utils/systemInfo.ts
T
ilaandClaude Sonnet 4.6 a8fa0c0753 add unibest app skeleton with checkin and progress pages
- init unibest v4.4.0 base template
- tabbar: 4 tabs (打卡/进度/测算/持仓) with carbon icons
- pages/checkin: daily checklist, streak counter, monthly rate
- pages/progress: asset snapshot, progress bar to 71万 target
- pages/calculator, holdings: placeholder pages (stage 2)
- store/checkin.ts + store/progress.ts with pinia persist
- vite: host 0.0.0.0 for WSL2→Windows browser access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 10:46:43 +08:00

39 lines
1.0 KiB
TypeScript

/* eslint-disable import/no-mutable-exports */
// 获取屏幕边界到安全区域距离
let systemInfo
let safeAreaInsets
// #ifdef MP-WEIXIN
// 微信小程序使用新的API
systemInfo = uni.getWindowInfo()
safeAreaInsets = systemInfo.safeArea
? {
top: systemInfo.safeArea.top,
right: systemInfo.windowWidth - systemInfo.safeArea.right,
bottom: systemInfo.windowHeight - systemInfo.safeArea.bottom,
left: systemInfo.safeArea.left,
}
: null
// #endif
// #ifndef MP-WEIXIN
// 其他平台继续使用uni API
systemInfo = uni.getSystemInfoSync()
safeAreaInsets = systemInfo.safeAreaInsets
// #endif
console.log('systemInfo', systemInfo)
// 微信里面打印
// pixelRatio: 3
// safeArea: {top: 47, left: 0, right: 390, bottom: 810, width: 390, …}
// safeAreaInsets: {top: 47, left: 0, right: 0, bottom: 34}
// screenHeight: 844
// screenTop: 91
// screenWidth: 390
// statusBarHeight: 47
// windowBottom: 0
// windowHeight: 753
// windowTop: 0
// windowWidth: 390
export { safeAreaInsets, systemInfo }