callback.vue
3.09 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
<!--
* @Date: 2024-01-26 10:24:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-26 16:30:31
* @FilePath: /xysBooking/src/views/callback.vue
* @Description: 反馈页面
-->
<template>
<div class="callback-page">
<div style="">
<div class="text-prompts">
<img src="https://cdn.ipadbiz.cn/xys/booking/%E6%88%90%E5%8A%9F@2x.png">
<div class="text">支付完成</div>
</div>
<div class="appointment-information">
<div class="number-of-visitors">参观人数:<span>{{ billInfo?.total_qty }} 人</span></div>
<div class="visit-time">参访时间:<span>{{ billInfo?.datetime }}</span></div>
<div class="payment-amount">支付金额:<span>¥ {{ billInfo?.total_amt }}</span></div>
</div>
<!-- <div class="appointment-notice">
<p style="margin-bottom: 0.25rem;"><van-icon name="info-o" /> 温馨提示</p>
<p style="font-size: 0.85rem;">1. 一人一码,或拿身份证,扫码或识别身份证成功后进入</p>
<p style="font-size: 0.85rem;">2. 若您无法按时参观,请提前在预约记录中取消您的预约</p>
</div> -->
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { onAuthBillInfoAPI, icbcOrderQryAPI } from '@/api/index'
import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
//import { } from '@/utils/generateModules.js'
//import { } from '@/utils/generateIcons.js'
//import { } from '@/composables'
const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const billInfo = ref({});
const formatDatetime = (data) => { // 格式化日期
let begin_time = data.begin_time.slice(0, -3);
let end_time = data.end_time.slice(0, -3);
let str = begin_time + ' ' + end_time;
return `${str.split(' ')[0]} ${str.split(' ')[1]}-${str.split(' ')[3]}`;
}
onMounted(async () => {
// 获取订单ID
const { code, data } = await icbcOrderQryAPI({ out_trade_no: $route.query.out_trade_no });
if (code) {
// 获取订单详情
const { code:code_pay, data:data_pay } = await onAuthBillInfoAPI({ pay_id: data.pay_id });
if (code_pay) {
//
data_pay.datetime = data_pay && formatDatetime(data_pay);
billInfo.value = data_pay;
}
}
})
</script>
<style lang="less" scoped>
.callback-page {
position: relative;
background-color: #FFF;
.text-prompts {
display: flex;
align-items: center;
justify-content: center;
height: 35vh;
flex-direction: column;
img {
width: 60vw;
}
.text {
color: #A67939;
font-size: 1.25rem;
}
}
.appointment-information {
padding: 2rem 1rem;
border-bottom: 1px dashed #A67939;
line-height: 2;
.number-of-visitors {
span {
color: #A67939;
}
}
.visit-time {
span {
color: #A67939;
}
}
.payment-amount {
span {
color: #FF1919;
}
}
}
.appointment-notice {
color: #A67939;
padding: 1rem;
line-height: 2;
}
}
</style>