wupengfei
2025-03-21 1bbd7061dac79cacf5513234a04cac8ba0be5c6f
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
73
<template>
  <InfiniteLoading
    scrollViewClassName="common-infinite-scroll-list home-list"
    v-bind="infiniteLoadingProps"
  >
    <template #renderItem="{ item }">
      <FlexJobCard
        :name="item.name"
        :age="item.age"
        :genderType="item.genderType"
        :workExperience="item.workExperience"
        :isRealName="item.isRealName"
        :arrangeCount="item.arrangeCount"
        :educationalLevel="item.educationalLevel"
        @contact="handleContact"
        @cancel-collection="handleCancelCollection(item)"
      >
      </FlexJobCard>
    </template>
  </InfiniteLoading>
</template>
 
<script setup lang="ts">
import { FlexJobCard } from '@12333/components';
import { useUserStore } from '@/stores/modules/user';
import { useInfiniteLoading } from '@12333/hooks';
import { OrderInputType } from '@12333/constants';
import * as flexWorkerServices from '@12333/services/api/FlexWorker';
import { Message } from '@12333/utils';
 
defineOptions({
  name: 'InnerPage',
});
 
const userStore = useUserStore();
 
const { infiniteLoadingProps, invalidateQueries } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.PageInput = {
      pageModel: {
        rows: 20,
        page: pageParam,
        orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
      },
    };
 
    return flexWorkerServices.getWorkerResumeCollectList(params, {
      showLoading: false,
    });
  },
  {
    queryKey: ['flexWorkerServices/getWorkerResumeCollectList'],
  }
);
 
function handleContact() {}
async function handleCancelCollection(item: API.GetNewestWorkerListOutput) {
  try {
    let params: API.APIcancelUserResumeCollectParams = {
      flexWorkerId: item.userId,
    };
    let res = await flexWorkerServices.cancelUserResumeCollect(params);
    if (res) {
      Message.success('操作成功');
      invalidateQueries();
    }
  } catch (error) {}
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
</style>