zhengyiming
5 天以前 11bfc34b15abd0753f9d829f2c5d20ba213cc8c8
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
<template>
  <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch">
    <ContentScrollView style="background-color: transparent">
      <TaskDetailView :detail="detail"></TaskDetailView>
    </ContentScrollView>
  </LoadingLayout>
</template>
 
<script setup lang="ts">
import Taro from '@tarojs/taro';
import { useQuery } from '@tanstack/vue-query';
import * as taskServices from '@12333/services/apiV2/task';
import { TaskDetailView } from '@12333/components';
import './taskDetail.scss';
 
defineOptions({
  name: 'InnerPage',
});
 
const { userDetail } = useUser();
const router = Taro.useRouter();
const id = router.params?.id ?? '';
const from = router.params?.from ?? '';
 
const {
  isLoading,
  isError,
  data: detail,
  refetch,
} = useQuery({
  queryKey: ['taskServices/getTaskInfo', id],
  queryFn: async () => {
    return await taskServices.getTaskInfo(
      { id: id },
      {
        showLoading: false,
      }
    );
  },
  placeholderData: () => ({} as API.GetTaskInfoQueryResult),
  onSuccess(data) {
    // if (data.isExistTradeChatRecord) setTrue();
  },
});
 
Taro.useDidShow(() => {
  refetch();
});
</script>