格式化日期

This commit is contained in:
2025-10-20 16:32:48 +08:00
parent 9297263dbb
commit 801dfb2963
4 changed files with 227 additions and 196 deletions

View File

@@ -1,58 +1,58 @@
// 网球比赛数据接口
export interface TennisMatch {
id: number
title: string
dateTime: string
location: string
distance: string
registeredCount: number
maxCount: number
skillLevel: string
matchType: string
images: string[]
shinei: string,
end_time: string,
id: number;
title: string;
dateTime: string;
location: string;
distance: string;
registeredCount: number;
maxCount: number;
skillLevel: string;
matchType: string;
images: string[];
shinei: string;
end_time: string;
}
export interface IFilterOptions {
dateRange: [string, string], // 日期区间
timeSlot?: string, // 时间段
ntrp?: [number, number], // NTRP 水平区间
venueType?: string, // 场地类型
playType?: string, // 玩法
distanceFilter?: string
dateRange: [string, string]; // 日期区间
timeSlot?: string; // 时间段
ntrp?: [number, number]; // NTRP 水平区间
venueType?: string; // 场地类型
playType?: string; // 玩法
distanceFilter?: string;
}
// 页面状态接口
export interface PageState {
data: TennisMatch[]
recommendList: TennisMatch[]
isShowFilterPopup: boolean
filterOptions: IFilterOptions
data: TennisMatch[];
recommendList: TennisMatch[];
isShowFilterPopup: boolean;
filterOptions: IFilterOptions;
distanceQuickFilter: {
distanceFilter: string
order: string
}
filterCount: number
distanceFilter: string;
order: string;
};
filterCount: number;
pageOption: {
page: number
pageSize: number
}
gamesNum: number
isHasMoreData: boolean
isShowNoData: boolean
page: number;
pageSize: number;
};
gamesNum: number;
isHasMoreData: boolean;
isShowNoData: boolean;
}
// 列表页状态
export interface ListPageState extends PageState {
isShowInputCustomerNavBar: boolean
isShowInputCustomerNavBar: boolean;
}
// 搜索页状态
export interface SearchPageState extends PageState {
data: TennisMatch[]
suggestionList: string[]
isShowSuggestion: boolean
searchHistory: { id: number, title: string }[]
searchHistoryParams: Record<string, any>
data: TennisMatch[];
suggestionList: string[];
isShowSuggestion: boolean;
searchHistory: { id: number; title: string }[];
searchHistoryParams: Record<string, any>;
}
export interface CityTree {
@@ -62,60 +62,64 @@ export interface CityTree {
}
export interface CityQrCodeItem {
id: number,
city_name: string,
qr_code_url: string,
description: string,
sort_order: number
id: number;
city_name: string;
qr_code_url: string;
description: string;
sort_order: number;
}
// 主状态接口
export interface ListState {
currentPage: string
isSearchResult: boolean
listPageState: ListPageState
searchPageState: SearchPageState
currentPage: string;
isSearchResult: boolean;
listPageState: ListPageState;
searchPageState: SearchPageState;
location: {
latitude: number
longitude: number
}
loading: boolean
error: string | null
searchValue: string
distanceData: any[]
quickFilterData: any[]
timeBubbleData: BubbleOption[]
dateRangeOptions: BubbleOption[]
gamesNum: number
cities: CityTree[]
cityQrCode: CityQrCodeItem[]
area: [string, string, string]
latitude: number;
longitude: number;
};
loading: boolean;
error: string | null;
searchValue: string;
distanceData: any[];
quickFilterData: any[];
timeBubbleData: BubbleOption[];
dateRangeOptions: BubbleOption[];
gamesNum: number;
cities: CityTree[];
cityQrCode: CityQrCodeItem[];
area: [string, string, string];
}
export interface ListActions {
fetchMatches: (params?: Record<string, any>, isFirstLoad?: Boolean, isAppend?: boolean) => Promise<void>
fetchMatches: (
params?: Record<string, any>,
isFirstLoad?: Boolean,
isAppend?: boolean
) => Promise<void>;
// getIntegrateListData: (params?: Record<string, any>) => Promise<void>
getMatchesData: () => void
clearError: () => void
updateState: (payload: Record<string, any>) => void
updateListPageState: (payload: Record<string, any>) => void
updateSearchPageState: (payload: Record<string, any>) => void
updateFilterOptions: (payload: Record<string, any>) => void
clearFilterOptions: () => void
getSearchHistory: () => Promise<void>
clearHistory: () => void
searchSuggestion: (val: string) => Promise<void>
getSearchParams: () => Record<string, any>
loadMoreMatches: () => void
initialFilterSearch: (isSearchData?: boolean) => void
setListData: (payload: IPayload) => void
fetchGetGamesCount: () => Promise<void>
getCurrentPageState: () => { currentPageState: any; currentPageKey: string }
updateCurrentPageState: (payload: Record<string, any>) => void
updateDistanceQuickFilter: (payload: Record<string, any>) => void
getCities: () => Promise<void>
getCityQrCode: () => Promise<void>
updateArea: (payload: [string, string, string]) => void
getMatchesData: () => void;
clearError: () => void;
updateState: (payload: Record<string, any>) => void;
updateListPageState: (payload: Record<string, any>) => void;
updateSearchPageState: (payload: Record<string, any>) => void;
updateFilterOptions: (payload: Record<string, any>) => void;
clearFilterOptions: () => void;
getSearchHistory: () => Promise<void>;
clearHistory: () => void;
searchSuggestion: (val: string) => Promise<void>;
getSearchParams: () => Record<string, any>;
loadMoreMatches: () => void;
initialFilterSearch: (isSearchData?: boolean) => void;
setListData: (payload: IPayload) => void;
fetchGetGamesCount: () => Promise<void>;
getCurrentPageState: () => { currentPageState: any; currentPageKey: string };
updateCurrentPageState: (payload: Record<string, any>) => void;
updateDistanceQuickFilter: (payload: Record<string, any>) => void;
getCities: () => Promise<void>;
getCityQrCode: () => Promise<void>;
updateArea: (payload: [string, string, string]) => void;
}
export interface IPayload {
@@ -182,7 +186,7 @@ export interface BubbleProps {
export interface BubbleItemProps {
option: BubbleOption;
isSelected: boolean;
size: 'small' | 'medium' | 'large';
size: "small" | "medium" | "large";
disabled: boolean;
onClick: (option: BubbleOption) => void;
itemClassName?: string;
@@ -198,29 +202,29 @@ export interface FilterPopupProps {
onClear: () => void;
visible: boolean;
onClose: () => void;
statusNavbarHeigh: number
statusNavbarHeigh: number;
}
// 列表卡片
export interface ListCardProps {
id: string | number,
title: string,
start_time: string,
end_time?: string, // 结束时间
location: string,
distance_km: number,
current_players: number,
max_players: number,
skill_level_min: number,
skill_level_max: number,
play_type: string,
image_list: string[],
court_type: string,
id: string | number;
title: string;
original_start_time?: string;
start_time: string;
end_time?: string; // 结束时间
location: string;
distance_km: number;
current_players: number;
max_players: number;
skill_level_min: number;
skill_level_max: number;
play_type: string;
image_list: string[];
court_type: string;
matchType: string;
shinei: string;
showSkeleton?: boolean;
key?: string
key?: string;
participants: {
user: {
avatar_url: string;
@@ -232,4 +236,4 @@ export interface ListCardProps {
venue_description: string;
game_type: string;
type: string;
}
}