1
This commit is contained in:
@@ -186,4 +186,30 @@
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
// 标题导航样式(用于"我的"页面等)
|
||||
.titleNavContainer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.titleNavContent {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 0 16px;
|
||||
|
||||
.titleNavText {
|
||||
font-family: "PingFang SC";
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
line-height: 1.4;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,12 @@ import { CityPicker as PopupPicker } from "@/components/Picker";
|
||||
|
||||
interface IProps {
|
||||
config?: {
|
||||
showInput: boolean;
|
||||
showInput?: boolean;
|
||||
inputLeftIcon?: string;
|
||||
iconPath?: string;
|
||||
leftIconClick?: () => void;
|
||||
title?: string; // 显示标题(用于"我的"页面等)
|
||||
showTitle?: boolean; // 是否显示标题模式
|
||||
};
|
||||
onCityPickerVisibleChange?: (visible: boolean) => void; // 城市选择器显示/隐藏回调
|
||||
onScrollToTop?: () => void; // 滚动到顶部回调
|
||||
@@ -52,7 +54,7 @@ function CityPicker(props) {
|
||||
|
||||
const ListHeader = (props: IProps) => {
|
||||
const { config, onCityPickerVisibleChange, onScrollToTop } = props;
|
||||
const { showInput = false, inputLeftIcon, leftIconClick } = config || {};
|
||||
const { showInput = false, inputLeftIcon, leftIconClick, title, showTitle = false } = config || {};
|
||||
const { getLocationLoading, statusNavbarHeightInfo } = useGlobalState();
|
||||
const { gamesNum, searchValue, cities, area, updateArea, getMatchesData, fetchGetGamesCount, refreshBothLists } = useListState();
|
||||
const { navBarHeight } = statusNavbarHeightInfo;
|
||||
@@ -139,12 +141,22 @@ const ListHeader = (props: IProps) => {
|
||||
return (
|
||||
<CustomNavbar backgroundColor="#fafafa">
|
||||
<View className="listNavWrapper">
|
||||
{/* 标题模式(用于"我的"页面等) */}
|
||||
{showTitle && (
|
||||
<View className="titleNavContainer" style={navbarStyle}>
|
||||
<View className="titleNavContent">
|
||||
<Text className="titleNavText">{title || "我的"}</Text>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* 首页logo 导航*/}
|
||||
<View
|
||||
className={`listNavContainer toggleElement firstElement hidden
|
||||
${!showInput ? "visible" : ""}`}
|
||||
style={navbarStyle}
|
||||
>
|
||||
{!showTitle && (
|
||||
<View
|
||||
className={`listNavContainer toggleElement firstElement hidden
|
||||
${!showInput ? "visible" : ""}`}
|
||||
style={navbarStyle}
|
||||
>
|
||||
<View className="listNavContentWrapper">
|
||||
{/* logo */}
|
||||
<Image
|
||||
@@ -167,13 +179,16 @@ const ListHeader = (props: IProps) => {
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* 搜索导航 */}
|
||||
<View
|
||||
className={`inputCustomerNavbarContainer toggleElement secondElement hidden ${
|
||||
showInput && "visible"
|
||||
} ${showInput ? "inputCustomerNavbarShowInput" : ""}`}
|
||||
style={navbarStyle}
|
||||
>
|
||||
{!showTitle && (
|
||||
<View
|
||||
className={`inputCustomerNavbarContainer toggleElement secondElement hidden ${
|
||||
showInput && "visible"
|
||||
} ${showInput ? "inputCustomerNavbarShowInput" : ""}`}
|
||||
style={navbarStyle}
|
||||
>
|
||||
<View className="navContent">
|
||||
{/* logo */}
|
||||
<Image
|
||||
@@ -198,8 +213,9 @@ const ListHeader = (props: IProps) => {
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
{cityPopupVisible && (
|
||||
{cityPopupVisible && !showTitle && (
|
||||
<CityPicker
|
||||
visible={cityPopupVisible}
|
||||
setVisible={setCityPopupVisible}
|
||||
|
||||
Reference in New Issue
Block a user