diff --git a/docs/records/2026-03-06-ECX-8066.md b/docs/records/2026-03-06-ECX-8066.md new file mode 100644 index 000000000..83ddb9fb5 --- /dev/null +++ b/docs/records/2026-03-06-ECX-8066.md @@ -0,0 +1,5 @@ +# 2026-03-06 | ECX-8066 | 首页 body 高度计算方式调整 + +- **说明**:首页 onReady 中 body 高度由直接使用 SpPage 传入的 height 改为使用 `calc(100vh - gNavbarH - footerHeight)` 计算,与导航栏、底栏高度对齐,避免高度偏差。 +- **涉及**:`src/pages/index.js` +- **类型**:refactor diff --git a/src/pages/index.js b/src/pages/index.js index 20d9239be..6b805a569 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -301,9 +301,9 @@ function Home() { }} ref={pageRef} navigateMantle={navigateMantle} - onReady={({ height, gNavbarH }) => { + onReady={({ gNavbarH,footerHeight }) => { setState((draft) => { - draft.bodyHeight = height + draft.bodyHeight = `calc(100vh - ${gNavbarH}px - ${footerHeight})` draft.navbarHeight = gNavbarH }) }} @@ -315,7 +315,7 @@ function Home() { pageRef.current.handlePageScroll(e?.detail) }} scrollIntoView={scrollIntoView} - style={{ height: state.bodyHeight }} + style={{ height: state.bodyHeight}} className={classNames('home-body', { 'has-home-header': isShowHomeHeader && isWeixin })}