wupengfei
15 小时以前 e213f4fbc54d69a5c478a5c44857c0eb1a2a54ae
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
<template>
  <!-- <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch"> -->
  <ContentScrollView hasPaddingTop>
    <MineServiceDetailView />
  </ContentScrollView>
  <PageFooter class="order-settle-bar">
    <PageFooterBtn class="business-card-btn" @click="cancelStandardOrderAppointment"
      >取消预约</PageFooterBtn
    >
    <PageFooterBtn type="primary" class="business-card-btn" @click="handleSubmit"
      >确认预约</PageFooterBtn
    >
  </PageFooter>
  <!-- </LoadingLayout> -->
</template>
 
<script setup lang="ts">
import { MineServiceDetailView } from '@12333/components';
import Taro from '@tarojs/taro';
import * as standardOrderServices from '@12333/services/apiV2/standardOrder';
import { Message } from '@12333/utils';
import { goBack } from '@/utils';
import { useStandardOrder } from '@12333/hooks';
 
defineOptions({
  name: 'InnerPage',
});
 
const route = Taro.useRouter();
const id = route.params?.id as string;
 
const { detail } = useStandardOrder({
  id: id,
});
 
async function cancelStandardOrderAppointment() {
  try {
    await Message.confirm({ message: '确认要取消预约吗?' });
    let params: API.CancelStandardOrderAppointmentCommand = {
      id: id,
    };
    let res = await standardOrderServices.cancelStandardOrderAppointment(params);
    if (res) {
      Message.success('操作成功');
      goBack();
    }
  } catch (error) {}
}
 
async function handleSubmit() {
  try {
    let params: API.SureStandardOrderAppointmentCommand = {
      id: id,
    };
    let res = await standardOrderServices.sureStandardOrderAppointment(params);
    if (res) {
      Message.success('操作成功');
      goBack();
    }
  } catch (error) {}
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.orderManageDetail-page-wrapper {
  .order-settle-bar {
    .order-settle-price-wrapper {
      height: 100%;
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      margin-left: 28px;
 
      .order-settle-price-label {
        color: boleGetCssVar('text-color', 'primary');
      }
    }
  }
}
</style>