refactor: 首页 body 高度改为 calc(100vh - 导航栏 - 底栏) (ECX-8066)

Made-with: Cursor
This commit is contained in:
zhangjing1
2026-03-06 15:44:41 +08:00
parent 19547182f0
commit 48c0f1ad09
2 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
# 2026-03-06 | ECX-8066 | 首页 body 高度计算方式调整
- **说明**:首页 onReady 中 body 高度由直接使用 SpPage 传入的 height 改为使用 `calc(100vh - gNavbarH - footerHeight)` 计算,与导航栏、底栏高度对齐,避免高度偏差。
- **涉及**`src/pages/index.js`
- **类型**refactor

View File

@@ -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
})}