payView.vue
8.64 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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<template>
<el-dialog
v-model="dialogVisible"
:close-on-click-modal="false"
align-center
class="payment-dialog"
title="对公转账"
width="1000px"
@close="handelClose"
>
<div class="dialog-content">
<!-- 订单信息 -->
<div class="info-row">
<div class="label">订单号:</div>
<div class="value">{{ form.tradeNo }}</div>
</div>
<div class="info-row">
<div class="label">缴费单位:</div>
<div class="value">{{ form.orderName ?? '——' }}</div>
</div>
<div class="info-row">
<div class="label">订单金额:</div>
<div class="value highlight">¥{{ form.price }}</div>
</div>
<!-- 转账提示 -->
<div class="transfer-tip">
请通过网上银行(网银)或银行柜台或手机银行
</div>
<!-- 转账信息卡片 -->
<div class="bank-card">
<div class="card-title">转账信息</div>
<div class="bank-row">
<span class="bank-label">收款人姓名:</span>
<span class="bank-value">中国跆拳道协会</span>
<el-button class="copyBtn" size="small" type="" @click="handelCoPy('秦琦五洋赫公司')">复制</el-button>
</div>
<div class="bank-row">
<span class="bank-label">收款银行:</span>
<span class="bank-value">中国民生银行</span>
<el-button class="copyBtn" size="small" type="" @click="handelCoPy('中国民生银行')">复制</el-button>
</div>
<div class="bank-row">
<span class="bank-label">收款卡号:</span>
<span class="bank-value card-number">{{ form.ziZhangBu }}</span>
<el-button class="copyBtn" size="small" type="" @click="handelCoPy( form.ziZhangBu )">复制</el-button>
</div>
<div class="bank-row">
<span class="bank-label">收款金额:</span>
<span class="bank-value card-number highlight">¥{{ form.price }}</span>
<el-button class="copyBtn" size="small" type="" @click="handelCoPy(form.price)">复制</el-button>
</div>
</div>
<!-- 金额输入区域 -->
<div class="amount-section">
<div class="amount-notice">
<div class="notice-line">1. 请使用注册机构账号对公转账。</div>
<div class="notice-line">2. 此订单将为您保留7天,请您及时支付。逾期未支付,订单将会自动取消。</div>
<div class="notice-line">3. 请通过网上银行(网银)或银行柜台或手机银行向以下账号划转款项。</div>
<div class="notice-line">4. 转账金额与订单金额必须保持一致,不得多转、少转。</div>
</div>
</div>
<!-- 温馨提示 -->
<div class="warning-tip">
<el-alert
show-icon
title="温馨提示"
type="warning"
>
<template #default>
<div>1. 转账时请务必核对账户余额,否则造成的资金损失由您自行承担。</div>
<div>2. 转账成功后请及时查询交易状态。</div>
</template>
</el-alert>
</div>
<br>
<br>
<br>
<div style="text-align: center;">
<el-button class="largeBtn" round type="" @click="handelClose">取 消</el-button>
<el-button class="largeBtn" round type="primary" @click="handelClose">确 定</el-button>
</div>
</div>
</el-dialog>
</template>
<script setup>
import { getCurrentInstance, ref } from 'vue'
import { orderDetail } from '@/api/system/userInfo'
import { useRouter } from 'vue-router'
const emit = defineEmits(['handel-success'])
const dialogVisible = ref(false)
const id = ref()
const form = ref({})
const status = ref(0)
const router = useRouter()
const { proxy } = getCurrentInstance()
function open(row, type) {
id.value = row
getOrderDetail(id.value)
dialogVisible.value = true
status.value = type ?? 0
}
async function getOrderDetail() {
if (!id.value) return
const res = await orderDetail(id.value)
form.value = res.data
}
const copySuccess = ref(false)
async function handelCoPy(val) {
try {
await navigator.clipboard.writeText(val)
copySuccess.value = true
proxy.$modal.msgSuccess('复制成功')
setTimeout(() => {
copySuccess.value = false
}, 2000)
} catch (err) {
console.error('复制失败:', err)
// 降级方案
fallbackCopyText(val)
}
}
// 降级方案(兼容旧浏览器)
const fallbackCopyText = (text) => {
const textarea = document.createElement('textarea')
textarea.value = text
document.body.appendChild(textarea)
textarea.select()
document.execCommand('copy')
document.body.removeChild(textarea)
copySuccess.value = true
proxy.$modal.msgSuccess('复制成功')
setTimeout(() => {
copySuccess.value = false
}, 2000)
}
function handelClose() {
switch (status.value) {
case 1:
router.replace('/member/memberPay')
break
// case 2:
// router.push('')
// break
case 3:
router.replace('/level/apply')
break
case 4:
router.replace('/rank/score')
break
case 5:
router.replace('/beyond/score')
break
default:
dialogVisible.value = false
emit('handel-success')
break
}
dialogVisible.value = false
emit('handel-success')
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
.payment-dialog {
:deep(.el-dialog__header) {
border-bottom: 1px solid #e4e7ed;
padding-bottom: 15px;
.el-dialog__title {
font-size: 20px;
font-weight: 500;
color: #303133;
}
}
:deep(.el-dialog__body) {
padding: 20px;
}
:deep(.el-dialog__footer) {
border-top: 1px solid #e4e7ed;
padding: 12px 20px;
}
}
.dialog-content {
.info-row {
display: flex;
margin-bottom: 12px;
font-size: 18px;
line-height: 1.5;
.label {
width: 140px;
color: #606266;
flex-shrink: 0;
}
.value {
color: #303133;
flex: 1;
&.highlight {
color: orange;
background-color: transparent;
//font-weight: 500;
}
}
}
.remark-text {
background-color: #f5f7fa;
padding: 8px 12px;
border-radius: 4px;
font-size: 18px;
color: #909399;
margin: 15px 0 12px 0;
text-align: right;
}
.transfer-tip {
background-color: #ecf5ff;
color: #409eff;
padding: 10px 12px;
border-radius: 4px;
font-size: 20px;
margin-bottom: 16px;
text-align: center;
font-weight: 500;
}
.bank-card {
background-color: #f8f9fa;
border-radius: 8px;
padding: 12px 16px;
margin-bottom: 20px;
border: 1px solid #e9ecef;
.card-title {
font-size: 20px;
font-weight: 600;
color: #303133;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid #e4e7ed;
}
.bank-row {
margin-bottom: 20px;
font-size: 20px;
line-height: 1.4;
.bank-label {
color: #606266;
display: inline-block;
width: 140px;
}
.bank-value {
color: #303133;
font-weight: 500;
&.card-number {
font-family: monospace;
letter-spacing: 1px;
font-size: 20px;
}
}
}
}
.amount-section {
margin-bottom: 20px;
.amount-label {
font-size: 18px;
color: #303133;
margin-bottom: 8px;
font-weight: 500;
}
.amount-input {
margin-bottom: 12px;
:deep(.el-input-group__prepend) {
font-weight: 500;
background-color: #f5f7fa;
}
}
.amount-notice {
background-color: #fef0f0;
padding: 8px 12px;
border-radius: 4px;
font-size: 18px;
color: #f56c6c;
line-height: 1.6;
.notice-line {
margin-bottom: 4px;
&:last-child {
margin-bottom: 0;
}
}
}
}
.warning-tip {
margin-top: 8px;
font-size: 18px;
:deep(.el-alert) {
background-color: #fdf6ec;
border: none;
padding: 8px 12px;
.el-alert__content {
color: #e6a23c;
span {
font-size: 20px;
}
div {
margin-bottom: 4px;
font-size: 18px !important;
&:last-child {
margin-bottom: 0;
}
}
}
}
}
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
}
.demo-btn {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f2f5;
}
.highlight {
color: orange !important;
background-color: transparent;
}
.copyBtn {
margin-left: 20px;
position: relative;
top: -3px;
}
</style>