zhengyiming
2 天以前 6c73b1255b612071d017ab4ebdad86a9ef9f880a
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
<template>
  <PageLayoutWithBg class="mineHire-page-wrapper" :title="'服务名'" :need-auth="false">
    <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch">
      <ContentScrollView style="background-color: transparent"> serciceDetail </ContentScrollView>
      <PageFooter>
        <!-- <PageFooterAction
            :icon="IconShare"
            text="分享"
            :isFlex="false"
            openType="share"
          ></PageFooterAction>
          <PageFooterAction
            :icon="userResumeInfo.isCollected ? IconAttentionActive : IconAttention"
            text="收藏"
            :isFlex="false"
            @click="handleAttention"
          ></PageFooterAction> -->
        <PageFooterBtn type="primary" @click="pay">预约下单</PageFooterBtn>
        <PageFooterBtn type="primary" @click="pay">预约下单</PageFooterBtn>
      </PageFooter>
    </LoadingLayout>
  </PageLayoutWithBg>
</template>
 
<script setup lang="ts">
import { useStandardServiceDetail } from '@12333/hooks';
import Taro from '@tarojs/taro';
import * as standardOrderServices from '@12333/services/apiV2/standardOrder';
 
defineOptions({
  name: 'serciceDetail',
});
 
const router = Taro.useRouter();
const id = router.params?.id ?? '';
 
const { isLoading, isError, detail, refetch } = useStandardServiceDetail({
  id,
});
 
async function addStandardOrder() {
  try {
    let params: API.AddStandardOrderCommand = {
      serviceId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
      serviceName: 'string',
      specId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
      specName: 'string',
      specPrice: 0,
      specNumber: 0,
      addressId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
      beginTime: '2025-12-24T06:44:24.840Z',
      endTime: '2025-12-24T06:44:24.840Z',
      supplierEnterpriseId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
      enterpriseEmployeeIds: ['3fa85f64-5717-4562-b3fc-2c963f66afa6'],
      remark: 'string',
      payAccess: 1,
      payAmount: 0,
    };
    let res = await standardOrderServices.addStandardOrder(params);
  } catch (error) {}
}
 
async function pay() {
  try {
    let params: API.PayStandardOrderCommand = {
      id: '9e919af2-3d33-4eac-f6dc-08de429676b3',
    };
    let res = await standardOrderServices.payStandardOrder(params);
    if (res) {
      Taro.requestPayment({
        timeStamp: res.timestamp,
        nonceStr: res.nonceStr,
        package: res.package,
        signType: res.signType as any,
        paySign: res.paySign,
      });
    }
  } catch (error) {}
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
</style>