index.vue
3.45 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
<!--
* @Date: 2024-01-15 18:28:25
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-30 15:18:54
* @FilePath: /xyxBooking-weapp/src/pages/success/index.vue
* @Description: 预约成功提示页面
-->
<template>
<view class="success-page">
<view style="">
<view class="text-prompts">
<image src="https://cdn.ipadbiz.cn/xys/booking/%E6%88%90%E5%8A%9F@2x.png" mode="widthFix" />
<view class="text">预约成功</view>
</view>
<view class="appointment-information">
<view class="number-of-visitors">参观人数:<text>{{ billInfo?.total_qty }} 人</text></view>
<view class="visit-time">参访时间:<text>{{ billInfo?.datetime }}</text></view>
<view class="payment-amount">支付金额:<text>¥ {{ billInfo?.total_amt }}</text></view>
</view>
<view class="appointment-notice">
<view style="margin-bottom: 8rpx; display: flex; align-items: center; justify-content: center;"><IconFont name="tips" /> 温馨提示</view>
<view style="font-size: 27rpx;">1. 一人一码,或拿身份证,扫码或识别身份证成功后进入</view>
<view style="font-size: 27rpx;">2. 若您无法按时参观,请提前在预约记录中取消您的预约</view>
</view>
</view>
<view class="success-btn">
<view @tap="goToHome" class="btn-item btn-left">首页</view>
<view @tap="goToDetail" class="btn-item btn-right">详情</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import Taro, { useDidShow, useRouter as useTaroRouter } from '@tarojs/taro'
import { IconFont } from '@nutui/icons-vue-taro'
import { useGo } from '@/hooks/useGo'
import { billInfoAPI } from '@/api/index'
import { formatDatetime } from '@/utils/tools';
const router = useTaroRouter();
const go = useGo();
const goToHome = () => {
go('/index')
}
const goToDetail = () => {
go('/bookingDetail', { pay_id: router.params.pay_id });
}
const billInfo = ref({});
useDidShow(async () => {
// 获取订单详情
const { code, data } = await billInfoAPI({ pay_id: router.params.pay_id });
if (code) {
data.datetime = data && formatDatetime(data);
billInfo.value = data;
}
})
</script>
<style lang="less">
.success-page {
position: relative;
background-color: #FFF;
min-height: 100vh;
.text-prompts {
display: flex;
align-items: center;
justify-content: center;
height: 35vh;
flex-direction: column;
image {
width: 60vw;
}
.text {
color: #A67939;
font-size: 40rpx;
margin-top: 32rpx;
}
}
.appointment-information {
padding: 64rpx 32rpx;
border-bottom: 2rpx dashed #A67939;
line-height: 2;
.number-of-visitors {
text {
color: #A67939;
}
}
.visit-time {
text {
color: #A67939;
}
}
.payment-amount {
text {
color: #A67939;
}
}
}
.appointment-notice {
padding: 32rpx;
color: #666;
}
.success-btn {
position: fixed;
bottom: 64rpx;
width: 750rpx;
display: flex;
justify-content: space-around;
.btn-item {
width: 40%;
text-align: center;
padding: 26rpx 0;
border-radius: 16rpx;
font-size: 35rpx;
}
.btn-left {
border: 2rpx solid #A67939;
color: #A67939;
}
.btn-right {
background-color: #A67939;
color: #FFF;
}
}
}
</style>