fix(miniprogram): adapt bx topbar for WeChat capsule safe area

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-09-12 18:54:21 +08:00
1 parent 8505115f05
commit f0d64379a7
13 files changed
+51 -37

No files matched your search

+6 -3
View File
@@ -1,6 +1,6 @@
<template>
<view class="bx-page">
<view class="topbar">
<view class="topbar" :style="safeAreaStyle">
<view class="topbar-left">
<view class="topbar-back" @click="onBack">
<text class="topbar-back-icon">‹</text>
@@ -216,6 +216,9 @@ import { ref, reactive, computed, onMounted } from 'vue'
import { expenseItemApi } from '@/api/bx'
import { statusLabel, adminStatusTagClass } from '@/utils/bxFormat'
import { PAGE_PATHS } from '@/config/api'
import { getSafeAreaStyle, getGlobalSafeArea } from '@/utils/safeArea'
const safeAreaStyle = getSafeAreaStyle()
const expenseTree = ref([])
const loading = ref(false)
@@ -258,7 +261,7 @@ const dialogTitle = computed(() => {
function measureListHeight() {
try {
const sys = uni.getSystemInfoSync()
const topbar = 44 + (sys.statusBarHeight || 0)
const topbar = getGlobalSafeArea().headerHeight
listHeight.value = `${Math.max(320, (sys.windowHeight || 600) - topbar)}px`
} catch (e) {
listHeight.value = '70vh'
@@ -417,7 +420,7 @@ function handleDelete(item) {
}
function onBack() {
uni.navigateBack({ fail: () => uni.switchTab({ url: PAGE_PATHS.workbench }) })
uni.navigateBack({ fail: () => uni.reLaunch({ url: PAGE_PATHS.workbench }) })
}
onMounted(() => {