wupengfei
6 天以前 3c7cbba6d64ca8bf7b1307023072b505414f7d5d
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
<template>
  <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch">
    <BusinessCardDetailInfoView @edit="goEditBusinessCard"></BusinessCardDetailInfoView>
    <PageFooterBtn type="primary" class="business-card-btn">递名片</PageFooterBtn>
  </LoadingLayout>
</template>
 
<script setup lang="ts">
import { useQuery } from '@tanstack/vue-query';
import Taro from '@tarojs/taro';
import * as flexWorkerServices from '@12333/services/api/FlexWorker';
import BusinessCardDetailInfoView from './BusinessCardDetailInfoView.vue';
 
defineOptions({
  name: 'BusinessCardView',
});
 
const router = Taro.useRouter();
 
const id = router.params?.id;
 
const {
  isLoading,
  isError,
  data: detail,
  refetch,
} = useQuery({
  queryKey: ['flexWorkerServices/getFlexTaskDto', id],
  queryFn: async () => {
    return await flexWorkerServices.getFlexTaskDto(
      { id: id },
      {
        showLoading: false,
      }
    );
  },
  placeholderData: () => ({} as API.GetFlexTaskDtoOutput),
  onSuccess(data) {},
});
 
function goEditBusinessCard() {
  Taro.navigateTo({
    url: `${RouterPath.businessCardEdit}?id=${id}`,
  });
}
 
function handleBusinessCard() {}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.businessCard-page-wrapper {
  .business-card-btn {
    width: 100%;
    margin: 40px auto 0;
    font-size: 28px;
  }
}
</style>