fix(miniprogram): adapt bx topbar for WeChat capsule safe area
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8505115f05
commit
f0d64379a7
13 files changed
+51
-37
No files matched your search
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user