自定列表导航栏

This commit is contained in:
juguohong
2025-08-24 23:56:03 +08:00
parent 58bacb3a47
commit 01d3acb6d9
20 changed files with 393 additions and 85 deletions

View File

@@ -9,8 +9,8 @@ const defaultFilterOptions: IFilterOptions = {
location: '', // 位置
time: '', // 时间
ntrp: [1.0, 5.0], // NTRP 水平区间
site: '', // 场地类型
wanfa: '', // 玩法
court_type: '', // 场地类型
game_play: '', // 玩法
};
const defaultDistance = 'all'; // 默认距离
@@ -65,6 +65,16 @@ export const useListStore = create<TennisStore>()((set, get) => ({
{ id: 2, label: "室外", value: "2" },
{ id: 3, label: "半室外", value: "3" },
],
// 玩法数据
gamePlayOptions: [
{ id: 1, label: "不限", value: "不限" },
{ id: 2, label: "单打", value: "单打" },
{ id: 3, label: "双打", value: "双打" },
{ id: 4, label: "娱乐", value: "娱乐" },
{ id: 5, label: "拉球", value: "拉球" },
],
// 球局数量
gamesNum: 124,
// 获取比赛数据
fetchMatches: async (params) => {
@@ -106,6 +116,7 @@ export const useListStore = create<TennisStore>()((set, get) => ({
// 更新综合筛选项
updateFilterOptions: (payload: Record<string, any>) => {
console.log('===更新综合筛选项', payload)
const preFilterOptions = get()?.filterOptions || {}
const filterOptions = { ...preFilterOptions, ...payload }
const filterCount = Object.values(filterOptions).filter(Boolean).length