From f0f0f8ba28723bf15aec8e02c4ae3986f518a287 Mon Sep 17 00:00:00 2001 From: zhangjing1 Date: Thu, 19 Mar 2026 20:59:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(home):=20=E5=90=B8=E9=A1=B6=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=20top=20=E4=B8=8E=20navSticky=20=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - content-partition / location-module:sticky 时 top 用 navBarHeight,改为依赖 base.navSticky 而非 immersive - location-module:删除 console.log - navStyle useMemo 依赖去掉已无用的 immersive Made-with: Cursor --- src/pages/home/wgts/content-partition/index.jsx | 4 ++-- src/pages/home/wgts/location-module/index.jsx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/home/wgts/content-partition/index.jsx b/src/pages/home/wgts/content-partition/index.jsx index 7b014d09e..69c100571 100644 --- a/src/pages/home/wgts/content-partition/index.jsx +++ b/src/pages/home/wgts/content-partition/index.jsx @@ -129,9 +129,9 @@ export default function WgtContentPartition(props) { return { ...getGlobalBaseStyle(base.outerMargin), position: base.navSticky ? 'sticky' : 'relative', - top: immersive ? `${navBarHeight}px` : 0 + top: base.navSticky ? `${navBarHeight}px` : 0 } - }, [base.outerMargin, base.navSticky, immersive, navBarHeight]) + }, [base.outerMargin, base.navSticky, navBarHeight]) // 获取导航项区域样式(navitemarea) const navItemAreaStyle = useMemo(() => { diff --git a/src/pages/home/wgts/location-module/index.jsx b/src/pages/home/wgts/location-module/index.jsx index 7bbb86872..de8e488d0 100644 --- a/src/pages/home/wgts/location-module/index.jsx +++ b/src/pages/home/wgts/location-module/index.jsx @@ -51,13 +51,12 @@ export default function WgtLocationModule(props) { // 获取导航栏样式 const navStyle = useMemo(() => { - console.log(immersive, navBarHeight, 'immersive,navBarHeight') return { ...getGlobalBaseStyle(base.outerMargin), position: base.navSticky ? 'sticky' : 'relative', - top: immersive ? `${navBarHeight}px` : 0 + top: base.navSticky ? `${navBarHeight}px` : 0 } - }, [base.outerMargin, base.navSticky, immersive, navBarHeight]) + }, [base.outerMargin, base.navSticky, navBarHeight]) // 获取导航项区域样式(navitemarea) const navItemAreaStyle = useMemo(() => {