This commit is contained in:
李瑞
2025-09-14 01:18:23 +08:00
parent c44bd01613
commit 01aad920ad
17 changed files with 569 additions and 352 deletions

View File

@@ -7,14 +7,13 @@ import CustomNavbar from "@/components/CustomNavbar";
import { Input } from "@nutui/nutui-react-taro";
import Taro from "@tarojs/taro";
import "./index.scss";
import { useMemo } from "react";
interface IProps {
config?: {
showInput: boolean;
inputLeftIcon: string;
inputLeftIcon?: string;
iconPath?: string;
leftIconClick: () => void;
leftIconClick?: () => void;
};
}
@@ -29,10 +28,12 @@ const ListHeader = (props: IProps) => {
getLocationLoading,
statusNavbarHeightInfo,
} = useGlobalState();
const { gamesNum, searchValue, isShowInputCustomerNavBar } = useListState();
const { navbarHeight } = statusNavbarHeightInfo;
const { gamesNum, searchValue } = useListState();
const { navBarHeight } = statusNavbarHeightInfo;
const { city,district } = useUserInfo()
const userInfo = useUserInfo()
const city = (userInfo as any)?.city || ''
const district = (userInfo as any)?.district || ''
console.log("useUserInfo",city,district )
@@ -67,23 +68,17 @@ const ListHeader = (props: IProps) => {
};
const navbarStyle = {
height: `${navbarHeight}px`,
paddingTop: `4px`,
height: `${navBarHeight}px`,
};
const showInputNavBar = useMemo(() => {
return isShowInputCustomerNavBar || showInput;
}, [isShowInputCustomerNavBar, showInput]);
console.log("===showInputNavBar",showInputNavBar)
return (
<CustomNavbar>
<View className="listNavWrapper">
{/* 首页logo 导航*/}
<View
className={`listNavContainer toggleElement firstElement hidden ${(!showInputNavBar && !showInput) && "visible"
}`}
className={`listNavContainer toggleElement firstElement hidden
${!showInput ? "visible" : ""}`}
style={navbarStyle}
>
<View className="listNavContentWrapper">
@@ -110,8 +105,8 @@ const ListHeader = (props: IProps) => {
</View>
{/* 搜索导航 */}
<View
className={`inputCustomerNavbarContainer toggleElement secondElement hidden ${(showInputNavBar || showInput) && "visible"
} ${showInput && "inputCustomerNavbarShowInput"}`}
className={`inputCustomerNavbarContainer toggleElement secondElement hidden ${showInput && "visible"
} ${showInput ? "inputCustomerNavbarShowInput" : ""}`}
style={navbarStyle}
>
<View className="navContent">
@@ -128,8 +123,9 @@ const ListHeader = (props: IProps) => {
src={img.ICON_LIST_SEARCH_SEARCH}
/>
<Input
placeholder="搜索上海的球局和场地"
clearable={false}
placeholder="搜索上球局和场地"
// clearable={false}
disabled
value={searchValue}
onClick={handleInputClick}
/>