diff --git a/docs/records/2026-03-06-ECX-8066.md b/docs/records/2026-03-06-ECX-8066.md index 83ddb9fb5..04277fc6e 100644 --- a/docs/records/2026-03-06-ECX-8066.md +++ b/docs/records/2026-03-06-ECX-8066.md @@ -1,5 +1,5 @@ -# 2026-03-06 | ECX-8066 | 首页 body 高度计算方式调整 +# 2026-03-06 | ECX-8066 | 自定义导航左侧可配置显隐及分类页隐藏左侧 -- **说明**:首页 onReady 中 body 高度由直接使用 SpPage 传入的 height 改为使用 `calc(100vh - gNavbarH - footerHeight)` 计算,与导航栏、底栏高度对齐,避免高度偏差。 -- **涉及**:`src/pages/index.js` -- **类型**:refactor +- **说明**:SpPage 支持通过 `showNavitionLeft` 控制自定义导航左侧区域(返回/首页/功能区)是否展示;分类页、分类加购页传入 `showNavitionLeft={false}` 隐藏左侧,标题区无左侧时增加左内边距;导航区 padding 微调(左 30→20px,右 10→20px)。 +- **涉及**:`src/components/sp-page/header.js`、`src/components/sp-page/index.js`、`src/components/sp-page/index.scss`、`src/pages/category/index.js`、`src/pages/category/comps/comps-category-addCart.js` +- **类型**:feat diff --git a/src/components/sp-page/header.js b/src/components/sp-page/header.js index 8aa498051..fa5c59a83 100644 --- a/src/components/sp-page/header.js +++ b/src/components/sp-page/header.js @@ -26,7 +26,8 @@ const CustomNavigationHeader = memo((props) => { onNearbyClick, onSearchConfirm, nearbyText, - navigationRSpace + navigationRSpace, + showNavitionLeft } = props const value = pageConfig @@ -202,7 +203,7 @@ const CustomNavigationHeader = memo((props) => { className={classNames('header-container', { 'has-nearby': hasNearby })} style={styleNames({ width: `calc(100% - ${navigationRSpace}px)`,...(showHeaderContent ? containerStyle() : {})})} > - + {showNavitionLeft && {/* 左侧:返回、首页、功能区三者只显示一个 */} {showHeaderContent && showFunctionArea ? ( <> @@ -224,8 +225,8 @@ const CustomNavigationHeader = memo((props) => { )} )} - - + } + {/* 标题区:搜索 */} {showHeaderContent && titleStyle === '3' && renderSearch()} {/* 标题区:页面名称 */} diff --git a/src/components/sp-page/index.js b/src/components/sp-page/index.js index 137f61b58..0e0b0db0f 100644 --- a/src/components/sp-page/index.js +++ b/src/components/sp-page/index.js @@ -321,6 +321,7 @@ const SpPage = memo( nearbyText={props.nearbyText} onSearchConfirm={props.onSearchConfirm} navigationRSpace={state.navigationRSpace} + showNavitionLeft={props.showNavitionLeft} /> )} {props.isDefault && diff --git a/src/components/sp-page/index.scss b/src/components/sp-page/index.scss index dc5e54f76..f1ffc05fd 100644 --- a/src/components/sp-page/index.scss +++ b/src/components/sp-page/index.scss @@ -9,7 +9,7 @@ display: flex; align-items: center; box-sizing: border-box; - padding-left: 30px; + padding-left: 20px; padding-right: 20px; } .title-container { @@ -203,7 +203,7 @@ margin-left: 0; position: relative; z-index: 2; - padding-right: 10px; + padding-right: 20px; box-sizing: border-box; .search-container { diff --git a/src/pages/category/comps/comps-category-addCart.js b/src/pages/category/comps/comps-category-addCart.js index 5ea942548..e90ae8a24 100644 --- a/src/pages/category/comps/comps-category-addCart.js +++ b/src/pages/category/comps/comps-category-addCart.js @@ -374,6 +374,7 @@ function CompsCategoryAddCart(props) { { console.log('onReady', e) diff --git a/src/pages/category/index.js b/src/pages/category/index.js index f801a1b3a..c413d7d86 100644 --- a/src/pages/category/index.js +++ b/src/pages/category/index.js @@ -68,6 +68,7 @@ function StoreItemList(props) { renderFooter={} onReady={handlePageReady} showpoweredBy={false} + showNavitionLeft={false} >