diff --git a/src/components/sp-page/header.js b/src/components/sp-page/header.js index 5f53897c9..6a1b38a8b 100644 --- a/src/components/sp-page/header.js +++ b/src/components/sp-page/header.js @@ -41,7 +41,7 @@ const CustomNavigationHeader = memo((props) => { backgroundPosition: 'center', paddingTop: `${gStatusBarHeight}px`, } - if (value?.navigateBackgroundColorr) { + if (value?.navigateBackgroundColor) { style.backgroundColor = value?.navigateBackgroundColor } if (value?.navigateBackgroundImage) { @@ -149,19 +149,15 @@ const CustomNavigationHeader = memo((props) => { }, [handleNearbyClick, nearbyText]) const renderSearch = useCallback(() => { - if (titleStyle !== '3' || !value?.showSearchButton) return null return ( - + Taro.navigateTo({ url: '/subpages/search/index' })}> - onSearchConfirm && onSearchConfirm(e.detail?.value)} - /> - - 搜索 - + {value?.showSearchButton && ( + + 搜索 + + )} ) diff --git a/src/components/sp-page/index.scss b/src/components/sp-page/index.scss index 28d12b679..d6c1a6cd9 100644 --- a/src/components/sp-page/index.scss +++ b/src/components/sp-page/index.scss @@ -218,17 +218,9 @@ border-radius: 8px; overflow: hidden; position: relative; - - .search-input { - flex: 1; - height: 64px; - padding: 0 24px 0 40px; - border: 1px solid #e0e0e0; - border-right: none; - border-radius: 8px 0 0 8px; - background-color: #fff; - font-size: 28px; - } + border: 1PX solid #e0e0e0; + background-color: #fff; + height: 64px; .search-icon { position: absolute; @@ -252,6 +244,8 @@ justify-content: center; white-space: nowrap; flex-shrink: 0; + position: absolute; + right: 0; } } } diff --git a/src/pages/category/index.js b/src/pages/category/index.js index 2f4097d3f..7280132e6 100644 --- a/src/pages/category/index.js +++ b/src/pages/category/index.js @@ -59,7 +59,10 @@ function StoreItemList(props) { return ( } + pageConfig={{ + titleStyle:'3', + navigateBackgroundColor:'#fff' + }} ref={pageRef} showLive renderFooter={} diff --git a/src/pages/custom/custom-page.js b/src/pages/custom/custom-page.js index 2b427f6a4..45e08461a 100644 --- a/src/pages/custom/custom-page.js +++ b/src/pages/custom/custom-page.js @@ -36,9 +36,6 @@ const initialState = { function CustomPage(props) { const $instance = getCurrentInstance() const [state, setState] = useImmer(initialState) - const { setNavigationBarTitle } = useNavigation() - const { address, location } = useSelector((s) => s.user) - const nearbyText = address?.city || location?.city || '' const { wgts, loading, shareInfo, skuPanelOpen, selectType, info, isShowTabBar } = state const MSpSkuSelect = React.memo(SpSkuSelect) const pageRef = useRef() @@ -137,11 +134,8 @@ function CustomPage(props) { return ( } title='会员中心' >