wupengfei
2025-02-17 7ab49073679e738a11c33d0b094fe7308e83fd51
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<template>
  <ContentScrollView style="background-color: transparent">
    <div class="flexJobSign-page-wrapper">
      <div class="searchbar-container">
        <BlSearchbar
          v-model.trim="searchValue"
          placeholder="搜索合同名/编号"
          @search="handleSearch"
          @change="handleSearch"
        ></BlSearchbar>
        <ChunkTitle title="合同列表" />
      </div>
 
      <InfiniteLoading
        scrollViewClassName="common-infinite-scroll-list home-list"
        v-bind="infiniteLoadingProps"
      >
        <template #renderItem="{ item }">
          <SignCard
            @click="handleCheck(item)"
            v-model:checked-id="checkedId"
            :id="item.id"
          ></SignCard>
        </template>
      </InfiniteLoading>
    </div>
  </ContentScrollView>
 
  <PageFooter>
    <PageFooterBtn type="primary">邀请签约</PageFooterBtn>
  </PageFooter>
</template>
 
<script setup lang="ts">
import { useInfiniteLoading } from '@12333/hooks';
import { OrderInputType } from '@12333/constants';
import * as orderServices from '@12333/services/api/Order';
import _ from 'lodash';
import { trim } from '@12333/utils';
import { SignCard } from '@12333/components';
 
defineOptions({
  name: 'InnerPage',
});
 
const searchValue = ref('');
const queryState = reactive({
  searchValueTrim: '',
});
 
const checkedId = ref('');
 
const handleSearch = _.debounce(function () {
  queryState.searchValueTrim = trim(searchValue.value);
}, 300);
 
const { infiniteLoadingProps } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.FrontOrderListInput = {
      pageModel: {
        rows: 20,
        page: pageParam,
        orderInput: [{ property: 'isRecommend', order: OrderInputType.Desc }],
      },
    };
 
    return orderServices.getFrontOrderList(params, {
      showLoading: false,
    });
  },
  {
    queryKey: ['orderServices/getFrontOrderList'],
  }
);
 
function handleCheck(item: API.OrderInfoDto) {
  checkedId.value = item.id;
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.flexJobSign-page-wrapper {
  .searchbar-container {
    padding: 30px;
  }
 
  .chunk-title-wrapper {
    padding: 30px 0 0;
  }
 
  .home-list {
    background-color: #ffffff;
  }
}
</style>