success.vue
3.78 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!--
* @Date: 2024-01-15 18:28:25
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-30 15:18:54
* @FilePath: /xysBooking/src/views/success.vue
* @Description: 预约成功提示页面
-->
<template>
<div class="success-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 class="success-btn">
<div @click="goToHome" class="btn-item btn-left">首页</div>
<div @click="goToDetail" class="btn-item btn-right">详情</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useGo } from '@/hooks/useGo'
import { Cookies, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
//import { } from '@/utils/generateModules.js'
//import { } from '@/utils/generateIcons.js'
//import { } from '@/composables'
import { billInfoAPI, payPrepareAPI } from '@/api/index'
import { formatDatetime } from '@/utils/tools';
const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const go = useGo();
const goToHome = () => {
go('/')
}
const goToDetail = () => {
go('/bookingDetail', { pay_id: $route.query.pay_id });
}
const billInfo = ref({});
onMounted(async () => {
// 获取订单详情
const { code, data } = await billInfoAPI({ pay_id: $route.query.pay_id });
if (code) {
//
data.datetime = data && formatDatetime(data);
billInfo.value = data;
// TAG:支付翻状态
// const { code: prepare_code, data: prepare_data } = await payPrepareAPI({ pay_id: $route.query.pay_id });
}
})
</script>
<style lang="less" scoped>
.success-page {
position: relative;
background-color: #FFF;
// margin: 0.8rem;
// margin-bottom: 0;
// border-radius: 8px;
.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;
}
.success-btn {
background-color: #FFF;
position: fixed;
width: 100vw;
bottom: 0;
left: 0;
height: 5rem;
display: flex;
align-items: center;
justify-content: space-around;
.btn-item {
padding: 0.7rem 4rem;
border-radius: 5px;
font-size: 1.05rem;
}
.btn-left{
background-color: #A67939;
color: #FFF;
margin-left: 0.7rem;
}
.btn-right{
border: 1px solid #A67939;
color: #A67939;
font-size: 1.05rem;
margin-right: 0.7rem;
}
}
}
</style>