增加日历
This commit is contained in:
@@ -18,9 +18,10 @@ import dateRangeUtils from '@/utils/dateRange'
|
||||
// 完整的 Store 类型
|
||||
type TennisStore = ListState & ListActions;
|
||||
|
||||
const toDate = dateRangeUtils?.formatDate(new Date())
|
||||
|
||||
const defaultFilterOptions: IFilterOptions = {
|
||||
dateRange: [new Date(), new Date()], // 日期区间
|
||||
dateRangeQuick: '',
|
||||
dateRange: [toDate, toDate], // 日期区间
|
||||
timeSlot: "", // 时间段
|
||||
ntrp: [1, 5], // NTRP 水平区间
|
||||
venueType: "", // 场地类型
|
||||
@@ -124,7 +125,6 @@ export const useListStore = create<TennisStore>()((set, get) => ({
|
||||
getSearchParams: () => {
|
||||
const state = get();
|
||||
const filterOptions = state?.filterOptions || {};
|
||||
console.log('===1111filterOptions', filterOptions)
|
||||
const distanceQuickFilter = state?.distanceQuickFilter || {};
|
||||
const params = {
|
||||
pageOption: state.pageOption,
|
||||
@@ -133,10 +133,7 @@ export const useListStore = create<TennisStore>()((set, get) => ({
|
||||
title: state.searchValue,
|
||||
ntrpMin: filterOptions?.ntrp?.[0],
|
||||
ntrpMax: filterOptions?.ntrp?.[1],
|
||||
dateRange: [
|
||||
dateRangeUtils.formatDate(filterOptions?.dateRange?.[0]),
|
||||
dateRangeUtils.formatDate(filterOptions?.dateRange?.[1])
|
||||
],
|
||||
dateRange: filterOptions?.dateRange,
|
||||
},
|
||||
order: distanceQuickFilter?.quick,
|
||||
lat: state?.location?.latitude,
|
||||
@@ -152,7 +149,8 @@ export const useListStore = create<TennisStore>()((set, get) => ({
|
||||
const { error, data, loading, gamesNum } = payload;
|
||||
const saveKey = isSearchResult ? "searchResultData" : "matches";
|
||||
const saveData = { error, loading, gamesNum, [saveKey]: data };
|
||||
set(saveData);
|
||||
console.log('===saveData', saveData)
|
||||
set({...saveData});
|
||||
},
|
||||
|
||||
// 获取列表数据(常规搜索)
|
||||
|
||||
Reference in New Issue
Block a user