mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-13 06:35:41 +08:00
refactor: 首页 body 高度改为 calc(100vh - 导航栏 - 底栏) (ECX-8066)
Made-with: Cursor
This commit is contained in:
5
docs/records/2026-03-06-ECX-8066.md
Normal file
5
docs/records/2026-03-06-ECX-8066.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# 2026-03-06 | ECX-8066 | 首页 body 高度计算方式调整
|
||||
|
||||
- **说明**:首页 onReady 中 body 高度由直接使用 SpPage 传入的 height 改为使用 `calc(100vh - gNavbarH - footerHeight)` 计算,与导航栏、底栏高度对齐,避免高度偏差。
|
||||
- **涉及**:`src/pages/index.js`
|
||||
- **类型**:refactor
|
||||
@@ -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
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user