fix(miniprogram): adapt mp-header for WeChat capsule safe area

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-09-12 18:54:57 +08:00
1 parent f0d64379a7
commit 1a97ec954b
7 files changed
+93 -15

No files matched your search

@@ -2,6 +2,9 @@
import { computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { PAGE_PATHS } from '@/config/api'
import { getSafeAreaStyle } from '@/utils/safeArea'
const safeAreaStyle = getSafeAreaStyle()
const props = defineProps({
defaultTitle: { type: String, default: '报销业务' }
@@ -11,7 +14,7 @@ const title = computed(() => props.defaultTitle)
const goBack = () => {
uni.navigateBack({
fail: () => uni.switchTab({ url: PAGE_PATHS.workbench })
fail: () => uni.reLaunch({ url: PAGE_PATHS.workbench })
})
}
@@ -20,7 +23,7 @@ onLoad(() => {})
<template>
<view class="mp-page">
<view class="mp-header">
<view class="mp-header" :style="safeAreaStyle">
<view class="bx-ph__nav" @click="goBack">
<text class="bx-ph__back">← 工作台</text>
</view>