@@ -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}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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)}>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user