| | |
| | | <template> |
| | | <ProTabs |
| | | v-model="queryState.status" |
| | | v-model="queryState.appointmentStatus" |
| | | name="home-tab" |
| | | :showPaneContent="false" |
| | | class="home-tabs" |
| | |
| | | <ProTabPane :title="`全部`" :pane-key="0"></ProTabPane> |
| | | <ProTabPane |
| | | :title="`待确认`" |
| | | :pane-key="GetPersonalApplyTaskInfosQueryStatus.WaitHire" |
| | | :pane-key="EnumStandardOrderAppointmentStatus.WaitSure" |
| | | ></ProTabPane> |
| | | <ProTabPane |
| | | :title="`待服务`" |
| | | :pane-key="GetPersonalApplyTaskInfosQueryStatus.WaitSignContract" |
| | | :pane-key="EnumStandardOrderAppointmentStatus.WaitServe" |
| | | ></ProTabPane> |
| | | <ProTabPane |
| | | :title="`已完成`" |
| | | :pane-key="GetPersonalApplyTaskInfosQueryStatus.HireRefuse" |
| | | :pane-key="EnumStandardOrderAppointmentStatus.Completed" |
| | | ></ProTabPane> |
| | | <ProTabPane :title="`已取消`" :pane-key="40"></ProTabPane> |
| | | <ProTabPane |
| | | :title="`已取消`" |
| | | :pane-key="EnumStandardOrderAppointmentStatus.Cancelled" |
| | | ></ProTabPane> |
| | | </ProTabs> |
| | | <InfiniteLoading |
| | | scrollViewClassName="common-infinite-scroll-list home-list" |
| | | v-bind="infiniteLoadingProps" |
| | | :key="queryState.status" |
| | | :key="queryState.appointmentStatus" |
| | | > |
| | | <template #renderItem="{ item }"> |
| | | <ReserveServiceCard |
| | | :name="item.name" |
| | | :serviceName="item.serviceName" |
| | | :begin-time="item.beginTime" |
| | | :end-time="item.endTime" |
| | | :billing-method="item.billingMethod" |
| | | :benefits="item.benefits" |
| | | :service-fee="item.serviceFee" |
| | | :settlement-cycle="item.settlementCycle" |
| | | :address-name="item.addressName" |
| | | :addressDetail="item.addressDetail" |
| | | :appointmentStatus="item.appointmentStatus" |
| | | :supplierEnterpriseName="item.supplierEnterpriseName" |
| | | :payAmount="item.payAmount" |
| | | @click="goSerciceDetail(item)" |
| | | > |
| | | </ReserveServiceCard> |
| | |
| | | import { ProTabs, ProTabPane, ReserveServiceCard } from '@12333/components'; |
| | | import { useUserStore } from '@/stores/modules/user'; |
| | | import { useInfiniteLoading } from '@12333/hooks'; |
| | | import { EnumPagedListOrder, GetPersonalApplyTaskInfosQueryStatus } from '@12333/constants'; |
| | | import * as taskServices from '@12333/services/apiV2/task'; |
| | | import { |
| | | EnumGetStandardOrdersQueryScene, |
| | | EnumPagedListOrder, |
| | | EnumStandardOrderAppointmentStatus, |
| | | } from '@12333/constants'; |
| | | import * as standardOrderServices from '@12333/services/apiV2/standardOrder'; |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | defineOptions({ |
| | | name: 'InnerPage', |
| | | }); |
| | | |
| | | const route = Taro.useRouter(); |
| | | const status = route.params?.status as any as EnumStandardOrderAppointmentStatus; |
| | | |
| | | const queryState = reactive({ |
| | | status: 0 as any as GetPersonalApplyTaskInfosQueryStatus, |
| | | scene: EnumGetStandardOrdersQueryScene.PartAEnterpriseOrder, |
| | | appointmentStatus: status ? Number(status) : 0, |
| | | }); |
| | | |
| | | const userStore = useUserStore(); |
| | | |
| | | // onMounted(() => { |
| | | // standardOrderServices.checkPayStandardOrder({ |
| | | // id: 'ca8c17a1-6c44-446e-2e88-08de443f2678', |
| | | // }); |
| | | // }); |
| | | |
| | | const { infiniteLoadingProps } = useInfiniteLoading( |
| | | ({ pageParam }) => { |
| | | let params: API.GetTaskInfosQuery = { |
| | | let params: API.GetStandardOrdersQuery = { |
| | | pageModel: { |
| | | rows: 20, |
| | | page: pageParam, |
| | | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], |
| | | }, |
| | | scene: queryState.scene, |
| | | }; |
| | | |
| | | return taskServices.getOpenTaskInfos(params, { |
| | | if (!!Number(queryState.appointmentStatus)) { |
| | | params.appointmentStatus = queryState.appointmentStatus; |
| | | } |
| | | |
| | | return standardOrderServices.getStandardOrders(params, { |
| | | showLoading: false, |
| | | }); |
| | | }, |
| | | { |
| | | queryKey: ['taskServices/getOpenTaskInfos', queryState], |
| | | queryKey: ['standardOrderServices/getStandardOrders', queryState], |
| | | } |
| | | ); |
| | | |
| | | function goSerciceDetail(item: any) { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.serciceDetail}?id=${item.id}`, |
| | | url: `${RouterPath.mineReserveServiceDetail}?id=${item.id}`, |
| | | }); |
| | | } |
| | | </script> |