| | |
| | | import * as orderServices from '@12333/services/api/Order'; |
| | | import _ from 'lodash'; |
| | | import { trim } from '@12333/utils'; |
| | | import { MaybeRef } from 'vue'; |
| | | |
| | | export enum HomeOrderType { |
| | | Recommend = 'Recommend', |
| | | LastShelfTime = 'LastShelfTime', |
| | | } |
| | | |
| | | export function useTaskList() { |
| | | type UseTaskListOptions = { |
| | | cityName?: MaybeRef<string>; |
| | | }; |
| | | |
| | | export function useTaskList(options: UseTaskListOptions = {}) { |
| | | const { cityName = '' } = options; |
| | | |
| | | const searchValue = ref(''); |
| | | |
| | | const queryMenuState = reactive({ |
| | | gender: '' as any as Gender, |
| | | }); |
| | | |
| | | const queryState = reactive({ |
| | | searchValueTrim: '', |
| | | orderType: HomeOrderType.Recommend, |
| | | gender: '' as any as Gender, |
| | | companyId: '', |
| | | }); |
| | | |
| | |
| | | }); |
| | | }, |
| | | { |
| | | queryKey: ['orderServices/getFrontOrderList', queryState], |
| | | queryKey: ['orderServices/getFrontOrderList', queryState, queryMenuState, cityName], |
| | | } |
| | | ); |
| | | |
| | | return { |
| | | searchValue, |
| | | queryState, |
| | | queryMenuState, |
| | | handleSearch, |
| | | infiniteLoadingProps, |
| | | }; |