From b1b86bb80db3346e4e141c1119ad77126db84334 Mon Sep 17 00:00:00 2001 From: Pine Date: Tue, 8 Sep 2026 23:48:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=EF=BC=9A=E5=A4=A7?= =?UTF-8?q?=E5=8E=85=E9=A1=B6=E9=83=A8=E6=A0=87=E9=A2=98=E5=8C=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=86=8D=E4=B8=8A=E7=A7=BB=2030rpx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PageHeader 新增 shift 参数(默认 65rpx,其他页面不变) - 大厅传 95rpx:标题文本整体上移,底部占位高度不变 --- miniprogram/src/components/TopInset.jsx | 7 ++++--- miniprogram/src/pages/hall/index.jsx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) 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:位于滚动区之外,完全固定不被下拉 */}