order-detail.vue
8.41 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<script setup>
import { reactive } from "vue";
import { cancelOrder, getOrderDetail } from "./api/index.js";
import qrCodeDialog from "./components/qrCodeDialog.vue";
import { ElMessageBox, ElMessage } from "element-plus";
const route = useRoute();
const router = useRouter();
const status = reactive({
0: {
txt: "待支付",
color: "#F740A6",
bgColor: "#FFE2F2",
},
1: {
txt: "已支付",
color: "#757575",
bgColor: "#DDDDDD",
},
2: {
txt: "未支付",
color: "#34C759",
bgColor: "#D2FFDD",
},
3: {
txt: "已退款",
color: "#FFCC00",
bgColor: "#FFF7D9",
},
});
const detail = reactive({
data: null,
fetchData() {
getOrderDetail({ orderSn: route.query.orderSn }).then((res) => {
detail.data = res.data;
});
},
});
detail.fetchData();
</script>
<template>
<div class="container">
<div class="left">
<!-- 票务信息 -->
<div class="ticket">
<div class="th">
<div style="width: 33%" class="td">票务信息</div>
<div style="width: 25%" class="td">地点</div>
<div style="width: 20%" class="td">单价</div>
<div style="width: 10%" class="td">数量</div>
<div style="width: 12%; text-align: right" class="td">小计</div>
</div>
<div class="line"></div>
<div class="tr">
<div style="width: 30%" class="td">{{ detail.data?.name }}</div>
<div style="width: 25%" class="td">{{ detail.data?.placeName }}</div>
<div style="width: 20%" class="td">
¥{{ detail.data?.singlePrice }}
</div>
<div style="width: 12%" class="td">
x{{ detail.data?.seatList?.length }}
</div>
<div style="width: 13%; text-align: right" class="td">
¥{{ detail.data?.payAmount }}
</div>
</div>
</div>
<!-- 座位 -->
<div class="seat_box">
<div class="th">
<div style="width: 30.33%" class="td">时间座位</div>
<div style="width: 30.33%" class="td">订单信息</div>
<div style="width: 30.33%" class="td">联系方式</div>
</div>
<div class="tr">
<div style="width: 30.33%" class="td flex-col">
<div>{{ detail.data?.dateStr }}</div>
<div v-for="(it, index) in detail.data?.seatList" :key="index">
<span v-if="it.venueId == 1">{{ it.area }}区</span
>{{ it.pai }}排{{ it.no }}座 ({{
it.venueId == 1 ? "B6" : "B4"
}}馆)
</div>
</div>
<div style="width: 30.33%" class="td flex-col">
<div>订单编号:{{ detail.data?.orderSn }}</div>
<div>创建时间:{{ detail.data?.orderTime }}</div>
</div>
<div style="width: 30.33%" class="td">
<div>联系电话:{{ detail.data?.contactPhone }}</div>
</div>
</div>
</div>
<!-- 购票人 -->
<div class="pay_ticket">
<div class="title">购票人</div>
<div class="people">
<div
v-for="(it, index) in detail.data?.customerList"
:key="index"
class="p_info"
>
<div>{{ it.name }}</div>
<div class="idcard">身份证:{{ it.idCard }}</div>
</div>
</div>
</div>
</div>
<div class="right">
<div class="balance">
<div class="title">结算信息</div>
<div class="cell">
<div class="label">订单状态</div>
<div class="value">{{ status[detail.data?.state]?.txt }}</div>
</div>
<div class="cell">
<div class="label">订单金额</div>
<div class="value">¥{{ detail.data?.payAmount }}</div>
</div>
<!-- button -->
<div v-if="detail.data?.state == 0" class="btn_box">
<div class="can_pay">取消支付</div>
<div class="pay">立即支付</div>
</div>
<div v-else>
<div v-if="detail.data?.state == 1 && detail.data?.isRefund" class="btn_box">
<div class="can_pay">取消购票</div>
<div class="pay">再来一单</div>
</div>
<div v-else class="btn_box">
<div class="pay_dis">请联系工作人员</div>
</div>
</div>
</div>
<div v-if="detail.data?.state == 0" class="tip">
请尽快完成支付,还剩15分00秒
</div>
</div>
</div>
</template>
<style scoped lang="scss">
.container {
width: 1200px;
margin: 0 auto;
padding: 20px 0;
display: flex;
gap: 20px;
.left {
width: 780px;
// 票务信息
.ticket {
background-color: #fff;
padding: 0 20px;
.th {
display: flex;
justify-content: space-between;
padding: 20px 0;
.td {
font-weight: bold;
font-size: 16px;
color: #333333;
line-height: 24px;
}
}
.line {
width: 740px;
height: 1px;
background: #eee;
}
.tr {
display: flex;
justify-content: space-between;
padding: 20px 0;
.td {
font-weight: 400;
font-size: 16px;
color: #333333;
line-height: 24px;
}
}
}
// 座位
.seat_box {
background-color: #fff;
padding: 0 20px;
margin-top: 20px;
.th {
display: flex;
justify-content: space-between;
padding: 20px 0;
.td {
font-weight: bold;
font-size: 16px;
color: #333333;
line-height: 24px;
}
}
.tr {
display: flex;
justify-content: space-between;
padding: 20px 0;
.td {
font-weight: 400;
font-size: 16px;
color: #333333;
line-height: 24px;
}
.flex-col {
display: flex;
flex-direction: column;
gap: 16px;
}
}
}
// 购票人
.pay_ticket {
background-color: #fff;
padding: 20px;
margin-top: 20px;
.title {
font-weight: bold;
font-size: 16px;
color: #333333;
margin-bottom: 28px;
}
.people {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 15px 50px;
.p_info {
font-weight: 400;
font-size: 16px;
color: #333333;
line-height: 24px;
.idcard {
color: #999999;
}
}
}
}
}
.right {
width: 400px;
.balance {
background-color: #fff;
padding: 20px;
.title {
font-weight: bold;
font-size: 20px;
color: #333333;
line-height: 30px;
margin-bottom: 28px;
}
.cell {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
&:last-child {
margin: 0;
}
.label {
font-weight: 400;
font-size: 16px;
color: #333333;
}
.value {
font-weight: 400;
font-size: 16px;
color: #ff8124;
}
}
.btn_box {
border-top: 1px solid #eee;
padding-top: 20px;
display: flex;
gap: 20px;
.pay_dis {
width: 360px;
height: 40px;
background: #A09DFF;
border-radius: 20px;
font-weight: 500;
font-size: 16px;
color: #ffffff;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.pay {
width: 170px;
height: 40px;
background: linear-gradient(270deg, #493ceb 0%, #8623fc 100%);
border-radius: 20px;
font-weight: 500;
font-size: 16px;
color: #ffffff;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.can_pay {
width: 170px;
height: 40px;
background: #f6f6f6;
border-radius: 20px;
font-weight: 500;
font-size: 16px;
color: #999;
line-height: 40px;
text-align: center;
box-sizing: border-box;
cursor: pointer;
}
}
}
.tip {
font-weight: 400;
font-size: 16px;
color: #ea3d6b;
line-height: 24px;
margin-top: 20px;
text-align: center;
}
}
}
</style>