fix: 替换已弃用的 getSystemInfoSync API 并优化移动端布局

- 将所有 uni.getSystemInfoSync() 替换为新的推荐 API
  - uni.getDeviceInfo() 获取设备信息
  - uni.getWindowInfo() 获取窗口信息
  - uni.getAppBaseInfo() 获取应用基础信息
- 优化页面布局适配移动端小程序
  - page 添加 height: 100% 和 overflow: hidden
  - 主页面使用 height: 100vh 替代 min-height
  - 移除滚动条显示(::-webkit-scrollbar)
  - 添加 flex-shrink: 0 防止卡片收缩
- 修复隐藏滚动条,提升移动端体验

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 18:27:04 +08:00
parent 130f532116
commit b9473d5059
10 changed files with 49 additions and 29 deletions
+3 -2
View File
@@ -57,8 +57,9 @@ const toggleMusic = async () => {
}
onMounted(() => {
const systemInfo = uni.getSystemInfoSync()
const safeAreaBottom = systemInfo.safeAreaInsets?.bottom || 0
// 使用新的推荐 API 替代已弃用的 getSystemInfoSync
const windowInfo = uni.getWindowInfo()
const safeAreaBottom = windowInfo.safeAreaInsets?.bottom || 0
bottomPosition.value = `${safeAreaBottom + 96}px`
})