<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" 
 | 
        @click="goFlexJobDetail(item)" 
 | 
        @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'; 
 | 
import Taro from '@tarojs/taro'; 
 | 
  
 | 
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 goFlexJobDetail(item: API.GetUserResumesQueryResultItem) { 
 | 
  Taro.navigateTo({ 
 | 
    url: `${RouterPath.flexJobDetail}?userId=${item.id}`, 
 | 
  }); 
 | 
} 
 | 
  
 | 
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> 
 |