import { View, Image } from "@tarojs/components"; import img from "@/config/images"; import { getCurrentLocation } from "@/utils/locationUtils"; import "./index.scss"; import { useEffect } from "react"; import { useGlobalState } from "@/store/global"; import { useListState } from "@/store/listStore"; import CustomNavbar from "@/components/CustomNavbar"; import { Input } from "@nutui/nutui-react-taro"; import Taro from "@tarojs/taro"; interface IProps { icon: string; } const ListHeader = (props: IProps) => { const { icon } = props; const { updateState, statusNavbarHeightInfo } = useGlobalState(); const { searchValue } = useListState(); const { statusBarHeight, navbarHeight } = statusNavbarHeightInfo; // 获取位置信息 const getCurrentLocal = () => { updateState({ getLocationLoading: true, }); getCurrentLocation().then((res) => { updateState({ getLocationLoading: false, location: res || {}, }); }); }; useEffect(() => { getCurrentLocal(); }, []); const handleInputClick = () => { Taro.navigateTo({ url: "/pages/search/index", }); } return ( {/* logo */} {/* 搜索框 */} ); }; export default ListHeader;