wupengfei
2 天以前 5e06f2f05feab4d0e4bae091a7154a0ec3a8cf65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
  <LoadingLayout>
    <!-- <ContentView>
      <ChunkTitle :title="title" />
    </ContentView> -->
    <InfiniteLoading
      scrollViewClassName="common-infinite-scroll-list"
      v-bind="infiniteLoadingProps"
    >
      <template #renderItem="{ item }">
        <TaskCheckHistoryCard
          :avatar="setOSSLink(item.avatar)"
          :name="item.name"
          :gender="item.gender"
          :isReal="item.isReal"
          :contactPhoneNumber="item.contactPhoneNumber"
          :type="item.type"
          :checkTime="item.checkTime"
        />
      </template>
    </InfiniteLoading>
  </LoadingLayout>
</template>
 
<script setup lang="ts">
import Taro from '@tarojs/taro';
import * as taskCheckReceiveServices from '@12333/services/apiV2/taskCheckReceive';
import { useInfiniteLoading } from '@12333/hooks';
import { TaskCheckHistoryCard } from '@12333/components';
import { EnumTaskUserSubmitCheckHistoryType, WeekCN } from '@12333/constants';
import { Message, setOSSLink } from '@12333/utils';
import dayjs from 'dayjs';
 
defineOptions({
  name: 'InnerPage',
});
 
const router = Taro.useRouter();
const id = router.params?.id ?? '';
const date = router.params?.date ?? '';
 
const title = `${dayjs(date).format('YYYY年MM月DD日')} 星期${WeekCN[dayjs(date).day()]}`;
 
const queryState = reactive({
  type: 0 as any as EnumTaskUserSubmitCheckHistoryType,
});
 
const { infiniteLoadingProps } = useInfiniteLoading(
  async ({ pageParam }) => {
    let params: API.GetCheckReceiveTaskUserSubmitCheckHistoriesQuery = {
      pageModel: {
        rows: 20,
        page: pageParam,
      },
      taskInfoId: id,
      date: dayjs(date).format('YYYY-MM-DD'),
    };
 
    if (Number(queryState.type) !== 0) {
      params.type = queryState.type;
    }
 
    let res = await taskCheckReceiveServices.getCheckReceiveTaskUserSubmitCheckHistories(params, {
      showLoading: false,
    });
    return res;
  },
  {
    queryKey: ['taskCheckReceiveServices/getCheckReceiveTaskUserSubmitCheckHistories', queryState],
  }
);
</script>