页面头部的白色留白去掉
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-07-16 11:38:44 +08:00
parent 4de570f5f4
commit fd5427c7ea
11 changed files with 97 additions and 43 deletions
@@ -13,6 +13,11 @@ const isH5 = process.env.TARO_ENV === 'h5';
export default function TabMainHeader({ title, extra }: TabMainHeaderProps) {
const metrics = useNavBarMetrics();
// H5:系统标题已展示;无右侧内容时整栏不渲染,避免顶部留白
if (isH5 && !extra) {
return null;
}
return (
<View className="tab-main-header" style={navBarStyle(metrics)} aria-label={title}>
{!isH5 ? <Text className="tab-main-header__title">{title}</Text> : null}
+4 -1
View File
@@ -65,7 +65,10 @@ export default function HomePage() {
const onSale = tab === 'QINGXIANG';
return (
<PageShell variant="tab" className="home-page">
<PageShell
variant="tab"
className={`home-page${process.env.TARO_ENV === 'h5' ? ' h5-no-tab-header' : ''}`}
>
<TabMainHeader title="杜康好客" />
<View className="home-aroma-nav">
+8 -2
View File
@@ -210,7 +210,10 @@ export default function MinePage() {
if (!authed) {
return (
<PageShell variant="tab" className="mine-page">
<PageShell
variant="tab"
className={`mine-page${process.env.TARO_ENV === 'h5' ? ' h5-no-tab-header' : ''}`}
>
<TabMainHeader title="我的" />
<View className="mine-header">
<View className="mine-header-texture" />
@@ -247,7 +250,10 @@ export default function MinePage() {
const memberLabel = hasWechat ? '好客会员' : canWxBind ? '微信未授权' : '未授权微信';
return (
<PageShell variant="tab" className="mine-page">
<PageShell
variant="tab"
className={`mine-page${process.env.TARO_ENV === 'h5' ? ' h5-no-tab-header' : ''}`}
>
<TabMainHeader title="我的" />
<View className="mine-header">
<View className="mine-header-texture" />
+4 -1
View File
@@ -73,7 +73,10 @@ export default function StoresPage() {
}
return (
<PageShell variant="tab" className="store-page">
<PageShell
variant="tab"
className={`store-page${process.env.TARO_ENV === 'h5' ? ' h5-no-tab-header' : ''}`}
>
<TabMainHeader title="门店" />
<View className="store-toolbar">
<View className="store-location" onClick={() => setRegionOpen(true)}>
+6 -7
View File
@@ -20,14 +20,13 @@
padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
/* ── Tab 主页面顶栏(实底 sticky ── */
.tab-main-header {
position: sticky;
/* H5 无 Tab 顶栏:贴顶,去掉标题栏留白 */
.page-shell.h5-no-tab-header {
--nav-bar-height: 0px;
}
.page-shell.h5-no-tab-header .home-aroma-nav {
top: 0;
z-index: 50;
background: var(--color-background);
box-shadow: var(--shadow-card);
box-sizing: border-box;
}
.tab-main-header__content {