diff --git a/miniprogram/src/components/TopInset.jsx b/miniprogram/src/components/TopInset.jsx index bcabd31..164de29 100644 --- a/miniprogram/src/components/TopInset.jsx +++ b/miniprogram/src/components/TopInset.jsx @@ -26,11 +26,12 @@ export function getTopInset() { /** 统一固定标题区(fixed 不随滚动):像素字 kicker + 彩虹渐变标题 + 像素字注脚。 * back:传入函数=自定义返回;true=自动返回(无上一页则回首页 Tab)。 + * shift:内容整体上移量(rpx),默认 65;底部占位高度不受影响。 * 占位高度由 createSelectorQuery 实测 navbar 真实高度,绝无空白/覆盖/重复。 */ -export function PageHeader({ no, title, en, sub, back }) { +export function PageHeader({ no, title, en, sub, back, shift = 65 }) { const { navH, windowWidth } = getTopInset(); - // 标题区整体上移 65rpx:从状态栏让位空间中扣除(不是容器偏移,占位实测自动跟随,无空白) - const SHIFT_PX = Math.round((65 * (windowWidth || 375)) / 750); + // 标题区整体上移 shift rpx:从状态栏让位空间中扣除(不是容器偏移,占位实测自动跟随,无空白) + const SHIFT_PX = Math.round((shift * (windowWidth || 375)) / 750); const topPad = Math.max(navH - SHIFT_PX, 24); // 下限:至少给状态栏留 24px // 默认占位高度 = 状态栏+导航区+标题内容,避免异步测量前内容被遮挡 const defaultH = navH + 80; diff --git a/miniprogram/src/pages/hall/index.jsx b/miniprogram/src/pages/hall/index.jsx index e613013..7b93892 100644 --- a/miniprogram/src/pages/hall/index.jsx +++ b/miniprogram/src/pages/hall/index.jsx @@ -78,7 +78,7 @@ export default function Hall() { return ( - + {/* 两级 Tab:位于滚动区之外,完全固定不被下拉 */}