transferPay.vue
7.22 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
<template>
<view class="container">
<!-- 订单信息 -->
<view class="card info-card">
<view class="info-row">
<text class="info-label">订单号</text>
<text class="info-value">{{ form.tradeNo || '-' }}</text>
</view>
<view class="info-row">
<text class="info-label">缴费单位</text>
<text class="info-value">{{ form.orderName || '-' }}</text>
</view>
<view class="info-row">
<text class="info-label">订单金额</text>
<text class="info-value highlight">¥{{ form.price || '0.00' }}</text>
</view>
</view>
<!-- 转账提示 -->
<view class="transfer-tip">
请通过网上银行(网银)或银行柜台或手机银行
</view>
<!-- 转账信息卡片 -->
<view class="card bank-card">
<view class="card-title">转账信息</view>
<view class="bank-row">
<text class="bank-label">收款人姓名</text>
<text class="bank-value">秦琦五洋赫公司</text>
<text class="copy-btn" @click="handelCoPy('秦琦五洋赫公司')">复制</text>
</view>
<view class="bank-row">
<text class="bank-label">收款银行</text>
<text class="bank-value">中国民生银行</text>
<text class="copy-btn" @click="handelCoPy('中国民生银行')">复制</text>
</view>
<view class="bank-row">
<text class="bank-label">收款卡号</text>
<text class="bank-value card-number">{{ form.ziZhangBu || '-' }}</text>
<text class="copy-btn" @click="handelCoPy(form.ziZhangBu)">复制</text>
</view>
<view class="bank-row">
<text class="bank-label">收款金额</text>
<text class="bank-value highlight">¥{{ form.price || '0.00' }}</text>
<text class="copy-btn" @click="handelCoPy(form.price)">复制</text>
</view>
</view>
<!-- 金额说明 -->
<view class="card notice-card">
<view class="notice-line">1. 请通过网上银行(网银)或银行柜台或手机银行向以下账号划转款项。</view>
<view class="notice-line">2. 转账金额与订单金额必须保持一致,不得多转、少转。</view>
</view>
<!-- 温馨提示 -->
<view class="card warning-card">
<view class="warning-title">
<text class="warning-icon">!</text>
<text>温馨提示</text>
</view>
<view class="warning-content">
<view class="warning-line">1. 转账时请务必核对账户余额,否则造成的资金损失由您自行承担。</view>
<view class="warning-line">2. 转账成功后请及时查询交易状态。</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="bottomBtn">
<button class="cancelBtn" @click="handelClose">取 消</button>
<button class="confirmBtn" @click="handelClose">确 定</button>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
const form = ref({
tradeNo: '',
orderName: '',
price: '',
ziZhangBu: ''
})
const orderId = ref('')
onLoad((option) => {
orderId.value = option.orderId || ''
getOrderDetail()
})
async function getOrderDetail() {
if (!orderId.value) return
uni.showLoading({ title: '加载中...' })
try {
const res = await api.orderDetail(orderId.value)
if (res.data) {
form.value = res.data
}
} catch (e) {
console.error('获取订单详情失败', e)
} finally {
uni.hideLoading()
}
}
function handelCoPy(text) {
if (!text || text === '-') {
uni.showToast({ title: '暂无内容可复制', icon: 'none' })
return
}
uni.setClipboardData({
data: String(text),
success: () => {
uni.showToast({ title: '复制成功', icon: 'success' })
},
fail: () => {
uni.showToast({ title: '复制失败', icon: 'none' })
}
})
}
function handelClose() {
uni.navigateBack({
delta: 2
})
}
</script>
<style lang="scss" scoped>
.hidden-input {
position: fixed;
left: -9999px;
opacity: 0;
}
.container {
min-height: 100vh;
background-color: #f7f7f7;
padding: 20rpx 20rpx 120rpx;
}
/* 订单信息卡片 */
.info-card {
background: #fff;
border-radius: 8rpx;
padding: 25rpx 20rpx;
margin-bottom: 20rpx;
.info-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
&:last-child {
border-bottom: none;
}
.info-label {
font-size: 28rpx;
color: #666;
}
.info-value {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.highlight {
color: #FF8124;
font-weight: 600;
}
}
}
/* 转账提示 */
.transfer-tip {
background-color: #E8F4FF;
color: #409EFF;
padding: 20rpx;
border-radius: 8rpx;
font-size: 28rpx;
text-align: center;
font-weight: 500;
margin-bottom: 20rpx;
}
/* 银行卡信息 */
.bank-card {
background: #fff;
border-radius: 8rpx;
padding: 25rpx 20rpx;
margin-bottom: 20rpx;
.card-title {
font-size: 30rpx;
font-weight: 600;
color: #333;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #e4e7ed;
}
.bank-row {
display: flex;
align-items: center;
padding: 16rpx 0;
font-size: 28rpx;
.bank-label {
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.bank-value {
flex: 1;
color: #333;
font-weight: 500;
&.card-number {
font-family: monospace;
letter-spacing: 2rpx;
}
&.highlight {
color: #FF8124;
}
}
.copy-btn {
color: #007AFF;
font-size: 26rpx;
padding: 8rpx 16rpx;
}
}
}
/* 金额说明 */
.notice-card {
background: #FEF0F0;
border-radius: 8rpx;
padding: 25rpx 20rpx;
margin-bottom: 20rpx;
.notice-line {
font-size: 26rpx;
color: #F56C6C;
line-height: 1.6;
margin-bottom: 8rpx;
&:last-child {
margin-bottom: 0;
}
}
}
/* 温馨提示 */
.warning-card {
background: #FDF6EC;
border-radius: 8rpx;
padding: 25rpx 20rpx;
.warning-title {
display: flex;
align-items: center;
font-size: 28rpx;
color: #E6A23C;
font-weight: 600;
margin-bottom: 16rpx;
.warning-icon {
width: 36rpx;
height: 36rpx;
background: #E6A23C;
color: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
margin-right: 10rpx;
}
}
.warning-content {
.warning-line {
font-size: 26rpx;
color: #E6A23C;
line-height: 1.6;
margin-bottom: 8rpx;
&:last-child {
margin-bottom: 0;
}
}
}
}
/* 底部按钮 */
.bottomBtn {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
gap: 20rpx;
padding: 20rpx 30rpx;
background: #fff;
border-top: 1rpx solid #eee;
}
.cancelBtn {
flex: 1;
height: 88rpx;
line-height: 88rpx;
background: #f5f5f5;
color: #666;
border-radius: 44rpx;
font-size: 32rpx;
border: none;
}
.confirmBtn {
flex: 1;
height: 88rpx;
line-height: 88rpx;
background: #C4121B;
color: #fff;
border-radius: 44rpx;
font-size: 32rpx;
border: none;
}
</style>