From 07c41e7fa9740cc813fa8d70927b8e5b9cab6331 Mon Sep 17 00:00:00 2001
From: Ultrame <1019265060@qq.com>
Date: Wed, 19 Nov 2025 16:53:40 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9F=8E=E5=B8=82=E9=80=89?=
=?UTF-8?q?=E6=8B=A9=E6=AD=BB=E5=BE=AA=E7=8E=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/HomeNavbar/index.tsx | 115 ++++++++++++++++------------
1 file changed, 65 insertions(+), 50 deletions(-)
diff --git a/src/components/HomeNavbar/index.tsx b/src/components/HomeNavbar/index.tsx
index 6857f21..7c739ac 100644
--- a/src/components/HomeNavbar/index.tsx
+++ b/src/components/HomeNavbar/index.tsx
@@ -60,17 +60,32 @@ function CityPicker(props) {
*/
const HomeNavbar = (props: IProps) => {
const { config, onCityPickerVisibleChange, onScrollToTop } = props;
- const { showInput = false, inputLeftIcon, leftIconClick, title, showTitle = false } = config || {};
+ const {
+ showInput = false,
+ inputLeftIcon,
+ leftIconClick,
+ title,
+ showTitle = false,
+ } = config || {};
const { getLocationLoading, statusNavbarHeightInfo } = useGlobalState();
- const { gamesNum, searchValue, cities, area, updateArea, fetchGetGamesCount, refreshBothLists } = useListState();
- const { statusBarHeight = 0, navBarHeight = 44 } = statusNavbarHeightInfo || {};
+ const {
+ gamesNum,
+ searchValue,
+ cities,
+ area,
+ updateArea,
+ fetchGetGamesCount,
+ refreshBothLists,
+ } = useListState();
+ const { statusBarHeight = 0, navBarHeight = 44 } =
+ statusNavbarHeightInfo || {};
const [cityPopupVisible, setCityPopupVisible] = useState(false);
-
+
// 监听城市选择器状态变化,通知父组件
useEffect(() => {
onCityPickerVisibleChange?.(cityPopupVisible);
- }, [cityPopupVisible, onCityPickerVisibleChange]);
+ }, [cityPopupVisible]);
const userInfo = useUserInfo();
const province = (userInfo as any)?.province || "";
@@ -148,13 +163,13 @@ const HomeNavbar = (props: IProps) => {
@@ -167,7 +182,7 @@ const HomeNavbar = (props: IProps) => {
)}
-
+
{/* 首页logo 导航*/}
{!showTitle && (
{
${!showInput ? "visible" : ""}`}
style={navbarStyle}
>
-
- {/* logo */}
-
-
-
-
- {/* 位置 */}
- {area_city}
- {!getLocationLoading && area_city && (
-
- )}
-
-
- 附近{gamesNum}场球局
+
+ {/* logo */}
+
+
+
+
+ {/* 位置 */}
+ {area_city}
+ {!getLocationLoading && area_city && (
+
+ )}
+
+
+ 附近{gamesNum}场球局
+
-
)}
-
+
{/* 搜索导航 */}
{!showTitle && (
{
} ${showInput ? "inputCustomerNavbarShowInput" : ""}`}
style={navbarStyle}
>
-
- {/* logo */}
-
- {/* 搜索框 */}
-
+
+ {/* logo */}
-
+ {/* 搜索框 */}
+
+
+
+
-
)}
{cityPopupVisible && !showTitle && (