@uxda/appkit 4.3.6 → 4.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.mjs +7 -7
- package/COMPONENT_USAGE.md +1523 -1523
- package/PROJECT_DOCS.md +142 -142
- package/README.md +187 -187
- package/babel.config.js +12 -12
- package/dist/appkit.css +15 -63
- package/dist/assets/asset-DcH8Kg-2 +1 -0
- package/dist/index.js +259 -806
- package/package.json +79 -79
- package/project.config.json +15 -15
- package/project.tt.json +13 -13
- package/rollup.config.mjs +78 -78
- package/src/Appkit.ts +72 -72
- package/src/balance/api/endpoints.ts +133 -133
- package/src/balance/api/index.ts +118 -118
- package/src/balance/components/AccountView.vue +770 -770
- package/src/balance/components/BalanceCard.vue +210 -210
- package/src/balance/components/BalanceReminder.vue +84 -84
- package/src/balance/components/ConsumptionFilter.vue +218 -218
- package/src/balance/components/ConsumptionRules.vue +68 -68
- package/src/balance/components/DateFilter.vue +259 -259
- package/src/balance/components/DateRange.vue +111 -111
- package/src/balance/components/ListFilter.vue +62 -62
- package/src/balance/components/ListFilterPicker.vue +191 -191
- package/src/balance/components/PromoterCard.vue +307 -308
- package/src/balance/components/SecondBalance.vue +77 -77
- package/src/balance/components/Tip.vue +45 -45
- package/src/balance/components/index.ts +8 -8
- package/src/balance/types.ts +99 -99
- package/src/components/bt-cropper/index.vue +730 -730
- package/src/components/bt-cropper/utils/calcCropper.js +42 -42
- package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
- package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
- package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
- package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
- package/src/components/bt-cropper/utils/ratio.js +3 -3
- package/src/components/bt-cropper/utils/tools.js +25 -25
- package/src/components/dd-area/index.vue +225 -225
- package/src/components/dd-icon/doc.md +21 -21
- package/src/components/dd-icon/index.vue +23 -23
- package/src/components/dd-notice-bar/index.vue +78 -78
- package/src/components/dd-search/doc.md +34 -34
- package/src/components/dd-search/index.vue +168 -168
- package/src/components/dd-selector/index.vue +124 -124
- package/src/components/dd-skeleton/doc.md +19 -19
- package/src/components/dd-skeleton/index.vue +36 -36
- package/src/global.ts +6 -6
- package/src/index.ts +101 -101
- package/src/main.scss +1 -1
- package/src/notice/api/endpoints.ts +54 -54
- package/src/notice/api/index.ts +121 -121
- package/src/notice/components/NoticeBanner.vue +247 -247
- package/src/notice/components/NoticeEntry.vue +99 -99
- package/src/notice/components/NoticeList.vue +311 -311
- package/src/notice/components/NoticeList2.vue +400 -399
- package/src/notice/components/NoticePopup.vue +163 -163
- package/src/notice/components/index.ts +6 -6
- package/src/notice/components/useCommonList.ts +86 -87
- package/src/notice/components/useNotice.ts +35 -35
- package/src/notice/index.ts +1 -1
- package/src/notice/types.ts +25 -25
- package/src/payment/api/config.ts +7 -7
- package/src/payment/api/endpoints.ts +96 -98
- package/src/payment/api/index.ts +107 -108
- package/src/payment/components/AmountPicker.vue +90 -90
- package/src/payment/components/RechargeResult.vue +69 -68
- package/src/payment/components/RechargeView.vue +191 -191
- package/src/payment/components/RightsPicker.vue +105 -105
- package/src/payment/components/TradeView.vue +363 -571
- package/src/payment/components/UserAgreement.vue +234 -234
- package/src/payment/components/index.ts +22 -22
- package/src/payment/index.ts +5 -5
- package/src/payment/services/index.ts +16 -16
- package/src/payment/services/invoke-recharge.ts +25 -25
- package/src/payment/services/request-payment.ts +130 -132
- package/src/payment/types.ts +33 -34
- package/src/register/components/SelfRegistration.vue +233 -233
- package/src/register/components/index.ts +2 -2
- package/src/scenarios/components/SharePoster.vue +364 -364
- package/src/scenarios/components/index.ts +2 -2
- package/src/scenarios/components/poster-paste.vue +93 -93
- package/src/scenarios/components/share-poster.md +273 -273
- package/src/shared/components/AppDrawer.vue +53 -53
- package/src/shared/components/AppVerify.vue +128 -137
- package/src/shared/components/DeviceVersion.vue +78 -78
- package/src/shared/components/EmptyView.vue +33 -33
- package/src/shared/components/OcrBusinessLicense.vue +137 -120
- package/src/shared/components/OcrIcon.vue +229 -267
- package/src/shared/components/PageHeader.vue +84 -84
- package/src/shared/components/index.ts +8 -10
- package/src/shared/composables/index.ts +9 -10
- package/src/shared/composables/useAmount.ts +46 -46
- package/src/shared/composables/useCountdown.ts +46 -46
- package/src/shared/composables/useCrypto.ts +76 -76
- package/src/shared/composables/useDeviceEnv.ts +26 -26
- package/src/shared/composables/useDragBox.ts +97 -97
- package/src/shared/composables/useEncode.ts +43 -43
- package/src/shared/composables/useLogger.ts +144 -144
- package/src/shared/composables/useSafeArea.ts +46 -46
- package/src/shared/composables/useTabbar.ts +24 -24
- package/src/shared/composables/useUpload.ts +61 -106
- package/src/shared/composables/useValidator.ts +32 -32
- package/src/shared/composables/useWxAuth.ts +48 -48
- package/src/shared/http/Http.ts +148 -149
- package/src/shared/http/index.ts +1 -1
- package/src/shared/http/types.ts +163 -163
- package/src/shared/index.ts +9 -9
- package/src/shared/tracking/directives/index.ts +40 -40
- package/src/shared/tracking/examples/page-tracking-template.vue +27 -27
- package/src/shared/tracking/tracking-sdk.ts +1 -0
- package/src/shared/weixin/index.ts +9 -9
- package/src/shared/weixin/jssdk.ts +103 -104
- package/src/shared/weixin/payment.ts +38 -38
- package/src/styles/vars.scss +3 -3
- package/src/user/api/endpoints.ts +17 -17
- package/src/user/api/index.ts +123 -123
- package/src/user/components/LoginSetting.vue +114 -114
- package/src/user/components/UserAuth.vue +218 -218
- package/src/user/components/UserBinding.vue +277 -277
- package/src/user/components/UserBindingSuccess.vue +80 -80
- package/src/user/components/UserEntry.vue +139 -139
- package/src/user/components/UserFeedback.vue +427 -428
- package/src/user/components/UserFeedbackEntry.vue +175 -175
- package/src/user/components/UserHeadCrop.vue +65 -65
- package/src/user/components/UserInfo.vue +709 -711
- package/src/user/components/UserResourceEmpty.vue +75 -75
- package/src/user/components/index.ts +23 -23
- package/src/user/index.ts +1 -1
- package/src/utils/utils.ts +33 -33
- package/tsconfig.json +30 -30
- package/types/global.d.ts +22 -24
- package/types/vue.d.ts +10 -10
- package/src/shared/components/OcrBank.vue +0 -202
- package/src/shared/components/OcrInvoice.vue +0 -218
- package/src/shared/composables/useCompress.ts +0 -64
|
@@ -1,571 +1,363 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="view recharge-view2">
|
|
3
|
-
<view class="flex-grow">
|
|
4
|
-
<rights-picker
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<div class="amount"
|
|
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
|
-
async function checkBalance() {
|
|
368
|
-
const $http = useHttp()
|
|
369
|
-
return new Promise((resolve, reject) => {
|
|
370
|
-
state.buttonLoading = true;
|
|
371
|
-
$http
|
|
372
|
-
.get<any>(balanceEndpoints.获取余额明细, {
|
|
373
|
-
app: props.apps,
|
|
374
|
-
})
|
|
375
|
-
.then((data) => {
|
|
376
|
-
state.buttonLoading = false;
|
|
377
|
-
if (data.commonAccount < balance.value) {
|
|
378
|
-
showModal({
|
|
379
|
-
title: '温馨提示',
|
|
380
|
-
content: '云豆不足,请刷新后再次确认',
|
|
381
|
-
showCancel: false,
|
|
382
|
-
confirmText: '刷新',
|
|
383
|
-
confirmColor: '#017fff',
|
|
384
|
-
success: () => {
|
|
385
|
-
balance.value = data.commonAccount;
|
|
386
|
-
}
|
|
387
|
-
})
|
|
388
|
-
resolve(false)
|
|
389
|
-
|
|
390
|
-
} else {
|
|
391
|
-
resolve(true)
|
|
392
|
-
}
|
|
393
|
-
}).catch((error) => {
|
|
394
|
-
state.buttonLoading = false;
|
|
395
|
-
resolve(false)
|
|
396
|
-
})
|
|
397
|
-
})
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
</script>
|
|
401
|
-
|
|
402
|
-
<style lang="scss">
|
|
403
|
-
.recharge-view2 {
|
|
404
|
-
height: 100%;
|
|
405
|
-
display: flex;
|
|
406
|
-
flex-direction: column;
|
|
407
|
-
--nut-primary-color: #017fff;
|
|
408
|
-
|
|
409
|
-
.flex-grow {
|
|
410
|
-
flex-grow: 1;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.bean-buy {
|
|
414
|
-
margin: 0 15px;
|
|
415
|
-
padding: 10px;
|
|
416
|
-
background: #fffbf3;
|
|
417
|
-
border-radius: 5px;
|
|
418
|
-
display: flex;
|
|
419
|
-
justify-content: space-between;
|
|
420
|
-
align-items: center;
|
|
421
|
-
flex-wrap: wrap;
|
|
422
|
-
|
|
423
|
-
.left {
|
|
424
|
-
.title {
|
|
425
|
-
color: #fd6701;
|
|
426
|
-
font-size: 14px;
|
|
427
|
-
font-weight: 600;
|
|
428
|
-
line-height: 20px;
|
|
429
|
-
margin-bottom: 6px;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
.amount {
|
|
433
|
-
color: #353535;
|
|
434
|
-
font-size: 13px;
|
|
435
|
-
line-height: 16px;
|
|
436
|
-
background-image: url("https://cdn.ddjf.com/static/images/appkit/yundou.png");
|
|
437
|
-
background-repeat: no-repeat;
|
|
438
|
-
background-size: 16px 16px;
|
|
439
|
-
padding-left: 24px;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.right {
|
|
444
|
-
display: flex;
|
|
445
|
-
align-items: center;
|
|
446
|
-
|
|
447
|
-
.amount {
|
|
448
|
-
color: #353535;
|
|
449
|
-
font-size: 15px;
|
|
450
|
-
line-height: 20px;
|
|
451
|
-
margin-right: 10px;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.icon {
|
|
455
|
-
display: block;
|
|
456
|
-
width: 16px;
|
|
457
|
-
height: 16px;
|
|
458
|
-
font-size: 0;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.balance-warning {
|
|
464
|
-
width: 100%;
|
|
465
|
-
padding: 8px 10px;
|
|
466
|
-
margin-top: 10px;
|
|
467
|
-
background: #fdefe6;
|
|
468
|
-
border-radius: 5px;
|
|
469
|
-
color: #fd6701;
|
|
470
|
-
font-size: 12px;
|
|
471
|
-
|
|
472
|
-
&-tip {
|
|
473
|
-
margin: 10px 26px 0;
|
|
474
|
-
color: #666666;
|
|
475
|
-
font-size: 10px;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.amount-footer {
|
|
480
|
-
padding: 10px 0;
|
|
481
|
-
|
|
482
|
-
.agreement {
|
|
483
|
-
font-size: 12px;
|
|
484
|
-
display: flex;
|
|
485
|
-
justify-content: center;
|
|
486
|
-
align-items: cebter;
|
|
487
|
-
height: 40px;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.buy-amount {
|
|
491
|
-
display: flex;
|
|
492
|
-
justify-content: space-between;
|
|
493
|
-
align-items: center;
|
|
494
|
-
padding: 0 10px;
|
|
495
|
-
border-radius: 0px;
|
|
496
|
-
box-shadow: 0px -5px 14px -5px rgba(0, 0, 0, 0.1);
|
|
497
|
-
|
|
498
|
-
/* 上边框阴影 */
|
|
499
|
-
.left {
|
|
500
|
-
width: 70%;
|
|
501
|
-
color: #353535;
|
|
502
|
-
font-size: 13px;
|
|
503
|
-
|
|
504
|
-
.amount {
|
|
505
|
-
color: #fd6701;
|
|
506
|
-
font-size: 20px;
|
|
507
|
-
font-weight: 600;
|
|
508
|
-
|
|
509
|
-
i {
|
|
510
|
-
font-size: 14px;
|
|
511
|
-
font-style: normal;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
.recharge-button {
|
|
517
|
-
background: linear-gradient(
|
|
518
|
-
90deg,
|
|
519
|
-
#ffebc1 0%,
|
|
520
|
-
#ffd7a7 52.29%,
|
|
521
|
-
#ffb875 100%
|
|
522
|
-
);
|
|
523
|
-
color: #353535;
|
|
524
|
-
margin: 12px 0;
|
|
525
|
-
border: 0;
|
|
526
|
-
border-radius: 8px;
|
|
527
|
-
flex: 1;
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
.nut-checkbox {
|
|
532
|
-
line-height: 40px;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
.nut-checkbox__label {
|
|
536
|
-
margin-left: 8px;
|
|
537
|
-
flex: flex;
|
|
538
|
-
font-size: 12px;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
.link {
|
|
542
|
-
display: inline;
|
|
543
|
-
color: #fd6701;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.trade-dialog {
|
|
549
|
-
.nut-dialog__header {
|
|
550
|
-
font-size: 16px;
|
|
551
|
-
color: #262626;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.item {
|
|
555
|
-
font-size: 14px;
|
|
556
|
-
color: #666666;
|
|
557
|
-
line-height: 21px;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.nut-dialog__footer-cancel {
|
|
561
|
-
color: #353535 !important;
|
|
562
|
-
border-color: #cccccc !important;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.nut-dialog__footer-ok {
|
|
566
|
-
border: none;
|
|
567
|
-
color: #353535;
|
|
568
|
-
background: linear-gradient(90deg, #ffebc1 0%, #ffb875 100%);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="view recharge-view2">
|
|
3
|
+
<view class="flex-grow">
|
|
4
|
+
<rights-picker :items="amounts" :selected="state.selected" @change="onAmountSelect" />
|
|
5
|
+
<div class="bean-buy" v-if="amounts[state.selected]">
|
|
6
|
+
<div class="left">
|
|
7
|
+
<div class="title">使用云豆支付</div>
|
|
8
|
+
<div class="amount" v-if="!selectBean">余额 {{ formatAmount(balance || 0) }}</div>
|
|
9
|
+
<div class="amount" v-else>扣减后余额 {{ formatAmount(balance - amounts[state.selected].paymentAmount) }}</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="right" v-if="balance >= amounts[state.selected].paymentAmount" @click="selectBean = !selectBean">
|
|
12
|
+
<div class="amount">-{{ formatAmount(amounts[state.selected].paymentAmount || 0) }}</div>
|
|
13
|
+
<img class="icon"
|
|
14
|
+
:src="selectBean ? 'https://cdn.ddjf.com/static/images/appkit/select.svg' : 'https://cdn.ddjf.com/static/images/appkit/not-select.svg'" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<slot name="banner"></slot>
|
|
20
|
+
</view>
|
|
21
|
+
|
|
22
|
+
<view class="amount-footer">
|
|
23
|
+
<view class="agreement" v-if="!selectBean">
|
|
24
|
+
<nut-checkbox v-model="state.agreed">我已阅读并同意<a v-track-click class="link inline"
|
|
25
|
+
@click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
|
|
26
|
+
</view>
|
|
27
|
+
<div class="buy-amount">
|
|
28
|
+
<div class="left">
|
|
29
|
+
待支付:
|
|
30
|
+
<span class="amount">
|
|
31
|
+
<i>¥</i>{{ formatAmount(currentAmount) }}
|
|
32
|
+
</span>
|
|
33
|
+
</div>
|
|
34
|
+
<nut-button block shape="square" :loading="state.buttonLoading" v-track-click @click="onPayClick"
|
|
35
|
+
class="recharge-button">购买</nut-button>
|
|
36
|
+
</div>
|
|
37
|
+
</view>
|
|
38
|
+
<nut-dialog title="确认购买" custom-class="trade-dialog" v-model:visible="showDialog" @cancel="showDialog = !showDialog"
|
|
39
|
+
@ok="beanPay">
|
|
40
|
+
<template v-if="amounts[state.selected]">
|
|
41
|
+
<div class="item">云豆扣减:{{ formatAmount(amounts[state.selected].paymentAmount || 0) }}</div>
|
|
42
|
+
<div class="item">权益增加:{{ formatAmount(amounts[state.selected].priceRightNum || 0) }}笔</div>
|
|
43
|
+
<div class="item">扣减后云豆余额:{{ formatAmount(balance - amounts[state.selected].paymentAmount) }}</div>
|
|
44
|
+
</template>
|
|
45
|
+
</nut-dialog>
|
|
46
|
+
</view>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script lang="ts" setup>
|
|
50
|
+
import { computed, onMounted, reactive, ref } from 'vue'
|
|
51
|
+
import RightsPicker, { Amount } from './RightsPicker.vue'
|
|
52
|
+
import { endpoints, useHttp } from '../api'
|
|
53
|
+
import { requestBrandWCPayByBean, requestPaymentByBean } from '../services'
|
|
54
|
+
import Taro, { showToast, useRouter } from '@tarojs/taro'
|
|
55
|
+
import { useAmount } from '../../shared/composables/useAmount'
|
|
56
|
+
import { isWechat } from '../../shared/composables/useDeviceEnv'
|
|
57
|
+
|
|
58
|
+
// 充值用户界面
|
|
59
|
+
// 配置了必须的属性后
|
|
60
|
+
// 自动获取支付套餐包列表
|
|
61
|
+
// 并发起微信支付
|
|
62
|
+
export interface RechargeViewProps {
|
|
63
|
+
/**
|
|
64
|
+
* header头中的appcode,一般情况下与app参数一致,当无应用权限时,此参数未空
|
|
65
|
+
**/
|
|
66
|
+
headerApp: string,
|
|
67
|
+
/**
|
|
68
|
+
* 应用
|
|
69
|
+
**/
|
|
70
|
+
app: string,
|
|
71
|
+
/**
|
|
72
|
+
* 充值场景
|
|
73
|
+
*/
|
|
74
|
+
// stage?: string, // 这个参数暂时不用
|
|
75
|
+
/**
|
|
76
|
+
* 租户
|
|
77
|
+
*/
|
|
78
|
+
tenant: string,
|
|
79
|
+
/**
|
|
80
|
+
* h5支付完成后跳转地址
|
|
81
|
+
*/
|
|
82
|
+
payFinishJumpUrl?: ''
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const props = defineProps<RechargeViewProps>()
|
|
86
|
+
const { formatAmount } = useAmount()
|
|
87
|
+
const { params } = useRouter()
|
|
88
|
+
|
|
89
|
+
const emit = defineEmits<{
|
|
90
|
+
(event: 'complete', value: { result: boolean, type: string }): void,
|
|
91
|
+
(event: 'agree'): void,
|
|
92
|
+
}>()
|
|
93
|
+
|
|
94
|
+
const state = reactive({
|
|
95
|
+
agreed: false,
|
|
96
|
+
selected: 0,
|
|
97
|
+
// agreementOpen: false,
|
|
98
|
+
buttonLoading: false,
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
const balance = ref<number>(0)
|
|
103
|
+
const amounts = ref<Amount[]>([])
|
|
104
|
+
const selectBean = ref<boolean>(false)
|
|
105
|
+
|
|
106
|
+
const onAgreementLinkClick = (e) => {
|
|
107
|
+
e.preventDefault()
|
|
108
|
+
e.stopImmediatePropagation()
|
|
109
|
+
emit('agree')
|
|
110
|
+
// state.agreementOpen = true
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const onAmountSelect = (selected: number) => {
|
|
114
|
+
state.selected = selected
|
|
115
|
+
selectBean.value = false
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const currentAmount = computed(() => {
|
|
119
|
+
return amounts.value[state.selected] && !selectBean.value ? amounts.value[state.selected].paymentAmount : 0
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
onMounted(() => {
|
|
123
|
+
const $http = useHttp({ Appcode: props.headerApp, Tenant: props.tenant })
|
|
124
|
+
$http.get<any[]>(endpoints.获取增值权益类目, {
|
|
125
|
+
rightCode: props.app === 'corporateStar' ? 'riskQueryCompany' : 'riskQueryMulti',
|
|
126
|
+
}).then((res: any) => {
|
|
127
|
+
balance.value = res.balance
|
|
128
|
+
amounts.value = res.paymentCaseConfigVOS
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
// 云豆支付
|
|
133
|
+
const showDialog = ref<boolean>(false)
|
|
134
|
+
async function beanPay() {
|
|
135
|
+
const $http = useHttp({ Appcode: props.headerApp, Tenant: props.tenant })
|
|
136
|
+
$http.post(`/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`).then((response: any) => {
|
|
137
|
+
if (response) {
|
|
138
|
+
showDialog.value = false
|
|
139
|
+
emit('complete', { result: response, type: 'bean' })
|
|
140
|
+
} else {
|
|
141
|
+
showToast({
|
|
142
|
+
title: response.message,
|
|
143
|
+
icon: 'none',
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
const onPayClick = () => {
|
|
151
|
+
// 用云豆支付
|
|
152
|
+
if (selectBean.value) {
|
|
153
|
+
showDialog.value = true
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 微信支付
|
|
158
|
+
if (!selectBean.value && !state.agreed) {
|
|
159
|
+
showToast({
|
|
160
|
+
title: '请勾选《大道云平台云豆充值协议》',
|
|
161
|
+
icon: 'none',
|
|
162
|
+
})
|
|
163
|
+
return false
|
|
164
|
+
}
|
|
165
|
+
state.buttonLoading = true
|
|
166
|
+
|
|
167
|
+
if (Taro.getEnv() === 'WEB') {
|
|
168
|
+
if (!isWechat()) {
|
|
169
|
+
showToast({
|
|
170
|
+
title: '请使用微信浏览器打开',
|
|
171
|
+
icon: 'none',
|
|
172
|
+
})
|
|
173
|
+
state.buttonLoading = false
|
|
174
|
+
return false
|
|
175
|
+
}
|
|
176
|
+
requestBrandWCPayByBean({
|
|
177
|
+
caseConfigId: amounts.value[state.selected].id,
|
|
178
|
+
amount: amounts.value[state.selected].paymentAmount,
|
|
179
|
+
app: 'loankitMp',
|
|
180
|
+
tenant: props.tenant,
|
|
181
|
+
accountAuthFlag: false,
|
|
182
|
+
channelCode: 'centergzh',
|
|
183
|
+
payFinishJumpUrl: props.payFinishJumpUrl,
|
|
184
|
+
fromMini: !!params.from
|
|
185
|
+
}).then(result => {
|
|
186
|
+
console.log(result, '------requestBrandWCPay')
|
|
187
|
+
state.buttonLoading = false
|
|
188
|
+
if (typeof result === 'boolean' && result) {
|
|
189
|
+
window.location.href = props.payFinishJumpUrl as string
|
|
190
|
+
} else {
|
|
191
|
+
emit('complete', { result, type: 'wePay' })
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
} else {
|
|
195
|
+
wx.login({
|
|
196
|
+
success({ code }: { code: string }) {
|
|
197
|
+
requestPaymentByBean({
|
|
198
|
+
caseConfigId: amounts.value[state.selected].id,
|
|
199
|
+
amount: amounts.value[state.selected].paymentAmount,
|
|
200
|
+
app: props.app,
|
|
201
|
+
tenant: props.tenant,
|
|
202
|
+
user: code,
|
|
203
|
+
}, props.headerApp).then(result => {
|
|
204
|
+
state.buttonLoading = false
|
|
205
|
+
if (result) {
|
|
206
|
+
emit('complete', { result: true, type: 'wePay' })
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
</script>
|
|
214
|
+
|
|
215
|
+
<style lang="scss">
|
|
216
|
+
.recharge-view2 {
|
|
217
|
+
height: 100%;
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-direction: column;
|
|
220
|
+
--nut-primary-color: #017fff;
|
|
221
|
+
|
|
222
|
+
.flex-grow {
|
|
223
|
+
flex-grow: 1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.bean-buy {
|
|
227
|
+
margin: 0 15px;
|
|
228
|
+
padding: 10px;
|
|
229
|
+
background: #FFFBF3;
|
|
230
|
+
border-radius: 5px;
|
|
231
|
+
display: flex;
|
|
232
|
+
justify-content: space-between;
|
|
233
|
+
align-items: center;
|
|
234
|
+
|
|
235
|
+
.left {
|
|
236
|
+
.title {
|
|
237
|
+
color: #FD6701;
|
|
238
|
+
font-size: 14px;
|
|
239
|
+
font-weight: 600;
|
|
240
|
+
line-height: 20px;
|
|
241
|
+
margin-bottom: 6px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.amount {
|
|
245
|
+
color: #353535;
|
|
246
|
+
font-size: 13px;
|
|
247
|
+
line-height: 16px;
|
|
248
|
+
background-image: url('https://cdn.ddjf.com/static/images/appkit/yundou.png');
|
|
249
|
+
background-repeat: no-repeat;
|
|
250
|
+
background-size: 16px 16px;
|
|
251
|
+
padding-left: 24px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.right {
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
|
|
259
|
+
.amount {
|
|
260
|
+
color: #353535;
|
|
261
|
+
font-size: 15px;
|
|
262
|
+
line-height: 20px;
|
|
263
|
+
margin-right: 10px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.icon {
|
|
267
|
+
display: block;
|
|
268
|
+
width: 16px;
|
|
269
|
+
height: 16px;
|
|
270
|
+
font-size: 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.amount-footer {
|
|
276
|
+
padding: 10px 0;
|
|
277
|
+
padding-bottom: 20px;
|
|
278
|
+
|
|
279
|
+
.agreement {
|
|
280
|
+
font-size: 12px;
|
|
281
|
+
display: flex;
|
|
282
|
+
justify-content: center;
|
|
283
|
+
align-items: cebter;
|
|
284
|
+
height: 40px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.buy-amount {
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: space-between;
|
|
290
|
+
align-items: center;
|
|
291
|
+
padding: 0 10px;
|
|
292
|
+
border-radius: 0px;
|
|
293
|
+
box-shadow: 0px -5px 14px -5px rgba(0, 0, 0, 0.1);
|
|
294
|
+
|
|
295
|
+
/* 上边框阴影 */
|
|
296
|
+
.left {
|
|
297
|
+
width: 70%;
|
|
298
|
+
color: #353535;
|
|
299
|
+
font-size: 13px;
|
|
300
|
+
|
|
301
|
+
.amount {
|
|
302
|
+
color: #FD6701;
|
|
303
|
+
font-size: 20px;
|
|
304
|
+
font-weight: 600;
|
|
305
|
+
|
|
306
|
+
i {
|
|
307
|
+
font-size: 14px;
|
|
308
|
+
font-style: normal;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.recharge-button {
|
|
314
|
+
background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
|
|
315
|
+
color: #353535;
|
|
316
|
+
margin: 12px 0;
|
|
317
|
+
border: 0;
|
|
318
|
+
border-radius: 8px;
|
|
319
|
+
flex: 1;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.nut-checkbox {
|
|
324
|
+
line-height: 40px;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.nut-checkbox__label {
|
|
328
|
+
margin-left: 8px;
|
|
329
|
+
flex: flex;
|
|
330
|
+
font-size: 12px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.link {
|
|
334
|
+
display: inline;
|
|
335
|
+
color: #FD6701;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.trade-dialog {
|
|
341
|
+
.nut-dialog__header {
|
|
342
|
+
font-size: 16px;
|
|
343
|
+
color: #262626
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.item {
|
|
347
|
+
font-size: 14px;
|
|
348
|
+
color: #666666;
|
|
349
|
+
line-height: 21px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.nut-dialog__footer-cancel {
|
|
353
|
+
color: #353535 !important;
|
|
354
|
+
border-color: #CCCCCC !important;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.nut-dialog__footer-ok {
|
|
358
|
+
border: none;
|
|
359
|
+
color: #353535;
|
|
360
|
+
background: linear-gradient(90deg, #FFEBC1 0%, #FFB875 100%);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
</style>
|