|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
<script setup lang="ts">
|
|
2
|
2
|
import {
|
|
|
3
|
+ getApplicationredWithdrawal,
|
|
3
|
4
|
getApplicationWithdrawal,
|
|
4
|
5
|
getBandAccountInfo,
|
|
5
|
6
|
getUserSpreadInfo,
|
|
|
@@ -25,10 +26,20 @@ const yanglaojin = ref<UserYanglaoJinModel>()
|
|
25
|
26
|
const widthdrawalConfig = ref({})
|
|
26
|
27
|
|
|
27
|
28
|
const cashWithdrawalAmount = ref()
|
|
28
|
|
-
|
|
|
29
|
+const isshow = ref(0)
|
|
29
|
30
|
const isDisabled = ref(true)
|
|
30
|
31
|
const userBrokeragePrice = ref(0)
|
|
|
32
|
+const member_brokerage_price = ref(0)
|
|
31
|
33
|
// userSpreadInfo.value.brokerage_price
|
|
|
34
|
+onLoad((options) => {
|
|
|
35
|
+ if (options && options.type) {
|
|
|
36
|
+ if (options.type == 1) {
|
|
|
37
|
+ isshow.value = 1
|
|
|
38
|
+ } else if (options.type == 2) {
|
|
|
39
|
+ isshow.value = 2
|
|
|
40
|
+ }
|
|
|
41
|
+ }
|
|
|
42
|
+})
|
|
32
|
43
|
onShow(async () => {
|
|
33
|
44
|
cashWithdrawalAmount.value = null
|
|
34
|
45
|
getBandAccountInfo({ type: '1' }).then(res => {
|
|
|
@@ -72,6 +83,7 @@ onShow(async () => {
|
|
72
|
83
|
await userStore.getUserInfo()
|
|
73
|
84
|
// 佣金信息
|
|
74
|
85
|
userSpreadInfo.value = await getUserSpreadInfo()
|
|
|
86
|
+ console.log(99999, userSpreadInfo.value);
|
|
75
|
87
|
|
|
76
|
88
|
yanglaojin.value = await getUserYangLaoJin()
|
|
77
|
89
|
|
|
|
@@ -81,15 +93,29 @@ onShow(async () => {
|
|
81
|
93
|
console.log(widthdrawalConfig.value)
|
|
82
|
94
|
userBrokeragePrice.value = userSpreadInfo.value?.brokerage_price ? parseFloat(userSpreadInfo.value?.brokerage_price) : 0
|
|
83
|
95
|
console.log(userBrokeragePrice.value)
|
|
|
96
|
+ member_brokerage_price.value = userSpreadInfo.value?.member_brokerage_price ? parseFloat(userSpreadInfo.value?.member_brokerage_price) : 0
|
|
|
97
|
+ console.log(member_brokerage_price.value)
|
|
84
|
98
|
// if (userSpreadInfo.value?.brokerage_price) {
|
|
85
|
|
- if (userBrokeragePrice.value < widthdrawalConfig.value.withdrawal_money) {
|
|
86
|
|
- isDisabled.value = true
|
|
87
|
|
- return uni.showToast({
|
|
88
|
|
- title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
|
|
89
|
|
- icon: 'none'
|
|
90
|
|
- })
|
|
|
99
|
+ if (isshow.value == 1) {
|
|
|
100
|
+ if (userBrokeragePrice.value < widthdrawalConfig.value.withdrawal_money) {
|
|
|
101
|
+ isDisabled.value = true
|
|
|
102
|
+ return uni.showToast({
|
|
|
103
|
+ title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
|
|
|
104
|
+ icon: 'none'
|
|
|
105
|
+ })
|
|
|
106
|
+ }
|
|
|
107
|
+ } else if (isshow.value == 2) {
|
|
|
108
|
+
|
|
|
109
|
+ if (member_brokerage_price.value < widthdrawalConfig.value.withdrawal_money) {
|
|
|
110
|
+ isDisabled.value = true
|
|
|
111
|
+ return uni.showToast({
|
|
|
112
|
+ title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
|
|
|
113
|
+ icon: 'none'
|
|
|
114
|
+ })
|
|
|
115
|
+ }
|
|
91
|
116
|
}
|
|
92
|
117
|
|
|
|
118
|
+
|
|
93
|
119
|
// }
|
|
94
|
120
|
})
|
|
95
|
121
|
|
|
|
@@ -113,24 +139,27 @@ function Tochecked() {
|
|
113
|
139
|
if (iswxshow.value == true) {
|
|
114
|
140
|
Accountbind({ openid: userStore.openid, wx_type: '1' }).then(resg => {
|
|
115
|
141
|
console.log('我是resg', resg);
|
|
|
142
|
+ setTimeout(() => {
|
|
|
143
|
+ uni.showToast({
|
|
|
144
|
+ title: '绑定成功',
|
|
|
145
|
+ icon: 'none'
|
|
|
146
|
+ })
|
|
|
147
|
+ }, 300)
|
|
116
|
148
|
|
|
117
|
|
- uni.showToast({
|
|
118
|
|
- title: '绑定成功',
|
|
119
|
|
- icon: 'none'
|
|
120
|
|
- })
|
|
121
|
149
|
iswxshow.value = true
|
|
122
|
150
|
}).catch((error) => {
|
|
123
|
|
- uni.showToast({
|
|
124
|
|
- title: error,
|
|
125
|
|
- icon: 'none'
|
|
126
|
|
- })
|
|
127
|
|
- if(error=='此微信已绑定其他账户'){
|
|
128
|
|
- iswxshow.value=false
|
|
129
|
|
- }
|
|
|
151
|
+ setTimeout(() => {
|
|
|
152
|
+ uni.showToast({
|
|
|
153
|
+ title: error,
|
|
|
154
|
+ icon: 'none'
|
|
|
155
|
+ })
|
|
|
156
|
+ }, 300)
|
|
|
157
|
+
|
|
|
158
|
+ iswxshow.value = false
|
|
130
|
159
|
})
|
|
131
|
|
- }else{
|
|
|
160
|
+ } else {
|
|
132
|
161
|
console.log(111);
|
|
133
|
|
-
|
|
|
162
|
+
|
|
134
|
163
|
}
|
|
135
|
164
|
}
|
|
136
|
165
|
|
|
|
@@ -140,21 +169,33 @@ function Tochecked() {
|
|
140
|
169
|
|
|
141
|
170
|
function handleInputAll() {
|
|
142
|
171
|
// console.log(userSpreadInfo.value?.brokerage_price)
|
|
143
|
|
- if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && userSpreadInfo.value?.brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
|
|
144
|
|
- cashWithdrawalAmount.value = userSpreadInfo.value.brokerage_price
|
|
145
|
|
- } else {
|
|
146
|
|
- uni.showToast({
|
|
147
|
|
- title: '可用余额太少,未满足提现要求',
|
|
148
|
|
- icon: 'none'
|
|
149
|
|
- })
|
|
|
172
|
+ if (isshow.value == 1) {
|
|
|
173
|
+ if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && userSpreadInfo.value?.brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
|
|
|
174
|
+ cashWithdrawalAmount.value = userSpreadInfo.value.brokerage_price
|
|
|
175
|
+ } else {
|
|
|
176
|
+ uni.showToast({
|
|
|
177
|
+ title: '可用余额太少,未满足提现要求',
|
|
|
178
|
+ icon: 'none'
|
|
|
179
|
+ })
|
|
|
180
|
+ }
|
|
|
181
|
+ } else if (isshow.value == 2) {
|
|
|
182
|
+ if (userSpreadInfo.value && userSpreadInfo.value.member_brokerage_price && userSpreadInfo.value?.member_brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
|
|
|
183
|
+ cashWithdrawalAmount.value = userSpreadInfo.value.member_brokerage_price
|
|
|
184
|
+ } else {
|
|
|
185
|
+ uni.showToast({
|
|
|
186
|
+ title: '可用余额太少,未满足提现要求',
|
|
|
187
|
+ icon: 'none'
|
|
|
188
|
+ })
|
|
|
189
|
+ }
|
|
150
|
190
|
}
|
|
|
191
|
+
|
|
151
|
192
|
}
|
|
152
|
193
|
|
|
153
|
194
|
/**
|
|
154
|
195
|
* 立即提现
|
|
155
|
196
|
*/
|
|
156
|
197
|
function handleImmediateWithdrawal() {
|
|
157
|
|
-
|
|
|
198
|
+
|
|
158
|
199
|
if (isDisabled.value) {
|
|
159
|
200
|
return
|
|
160
|
201
|
}
|
|
|
@@ -213,7 +254,7 @@ function handleImmediateWithdrawal() {
|
|
213
|
254
|
})
|
|
214
|
255
|
}
|
|
215
|
256
|
|
|
216
|
|
- if(iswxshow.value==false){
|
|
|
257
|
+ if (iswxshow.value == false) {
|
|
217
|
258
|
uni.showToast({
|
|
218
|
259
|
title: '请先勾选提现方式',
|
|
219
|
260
|
icon: 'none'
|
|
|
@@ -243,6 +284,99 @@ function handleImmediateWithdrawal() {
|
|
243
|
284
|
// if (yanglaojin.value) {
|
|
244
|
285
|
// }
|
|
245
|
286
|
}
|
|
|
287
|
+/**
|
|
|
288
|
+ * 立即提现
|
|
|
289
|
+ */
|
|
|
290
|
+function handleImmediateredWithdrawal() {
|
|
|
291
|
+
|
|
|
292
|
+ if (isDisabled.value) {
|
|
|
293
|
+ return
|
|
|
294
|
+ }
|
|
|
295
|
+ if (widthdrawalConfig.value.withdrawal_status == '0') {
|
|
|
296
|
+ isDisabled.value = true
|
|
|
297
|
+ return uni.showToast({
|
|
|
298
|
+ title: '提现功能关闭',
|
|
|
299
|
+ icon: 'none'
|
|
|
300
|
+ })
|
|
|
301
|
+ }
|
|
|
302
|
+ if (widthdrawalConfig.value.withdrawal_wchat == '0') {
|
|
|
303
|
+ isDisabled.value = true
|
|
|
304
|
+
|
|
|
305
|
+ return uni.showToast({
|
|
|
306
|
+ title: '微信提现功能关闭',
|
|
|
307
|
+ icon: 'none'
|
|
|
308
|
+ })
|
|
|
309
|
+ }
|
|
|
310
|
+
|
|
|
311
|
+ // 1.用户可提现余额≤最低提现额
|
|
|
312
|
+ if (member_brokerage_price.value < widthdrawalConfig.value.withdrawal_money) {
|
|
|
313
|
+ return uni.showToast({
|
|
|
314
|
+ title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
|
|
|
315
|
+ icon: 'none'
|
|
|
316
|
+ })
|
|
|
317
|
+ }
|
|
|
318
|
+
|
|
|
319
|
+ // 2 当输入金额≤可提现余额<最低提现额度
|
|
|
320
|
+ if (Number.parseFloat(cashWithdrawalAmount.value) <= Number.parseFloat(member_brokerage_price.value) && Number.parseFloat(cashWithdrawalAmount.value) < widthdrawalConfig.value.withdrawal_money) {
|
|
|
321
|
+ // 1 判断是否需要实名
|
|
|
322
|
+ if (!yanglaojin.value?.is_certification == 1) {
|
|
|
323
|
+ return uni.navigateTo({
|
|
|
324
|
+ url: '/pages/real-name-authentication/index'
|
|
|
325
|
+ })
|
|
|
326
|
+ }
|
|
|
327
|
+
|
|
|
328
|
+ return uni.showToast({
|
|
|
329
|
+ title: '满' + widthdrawalConfig.value.withdrawal_money + '才可以提现~',
|
|
|
330
|
+ icon: 'none'
|
|
|
331
|
+ })
|
|
|
332
|
+ }
|
|
|
333
|
+
|
|
|
334
|
+ // 当输入金额>可提现余额且输入金额≥最低提现额度
|
|
|
335
|
+ if ((Number.parseFloat(cashWithdrawalAmount.value) > Number.parseFloat(member_brokerage_price.value)) && (Number.parseFloat(cashWithdrawalAmount.value) >= widthdrawalConfig.value.withdrawal_money)) {
|
|
|
336
|
+ // 1 判断是否需要实名
|
|
|
337
|
+ if (!yanglaojin.value?.is_certification == 1) {
|
|
|
338
|
+ return uni.navigateTo({
|
|
|
339
|
+ url: '/pages/real-name-authentication/index'
|
|
|
340
|
+ })
|
|
|
341
|
+ }
|
|
|
342
|
+
|
|
|
343
|
+
|
|
|
344
|
+ return uni.showToast({
|
|
|
345
|
+ title: '输入金额超过可提现余额',
|
|
|
346
|
+ icon: 'none'
|
|
|
347
|
+ })
|
|
|
348
|
+ }
|
|
|
349
|
+
|
|
|
350
|
+ if (iswxshow.value == false) {
|
|
|
351
|
+ uni.showToast({
|
|
|
352
|
+ title: '请先勾选提现方式',
|
|
|
353
|
+ icon: 'none'
|
|
|
354
|
+ })
|
|
|
355
|
+ return
|
|
|
356
|
+ }
|
|
|
357
|
+
|
|
|
358
|
+ getApplicationredWithdrawal({ extract_price: cashWithdrawalAmount.value, extract_type: "1", type: 2 }).then(res => {
|
|
|
359
|
+
|
|
|
360
|
+ uni.showToast({
|
|
|
361
|
+ title: '提现已申请',
|
|
|
362
|
+ icon: 'none'
|
|
|
363
|
+ })
|
|
|
364
|
+ setTimeout(() => {
|
|
|
365
|
+ uni.navigateTo({
|
|
|
366
|
+ url: '/pages/withdrawal-record/index'
|
|
|
367
|
+ })
|
|
|
368
|
+ }, 300)
|
|
|
369
|
+ }).catch(error => {
|
|
|
370
|
+ uni.showToast({
|
|
|
371
|
+ title: error,
|
|
|
372
|
+ icon: 'none'
|
|
|
373
|
+ })
|
|
|
374
|
+ })
|
|
|
375
|
+
|
|
|
376
|
+
|
|
|
377
|
+ // if (yanglaojin.value) {
|
|
|
378
|
+ // }
|
|
|
379
|
+}
|
|
246
|
380
|
|
|
247
|
381
|
function handleWithdrawalRecord() {
|
|
248
|
382
|
uni.navigateTo({
|
|
|
@@ -257,7 +391,8 @@ function handleShowAgreement(type) {
|
|
257
|
391
|
}
|
|
258
|
392
|
</script>
|
|
259
|
393
|
<template>
|
|
260
|
|
- <div class="p-3 flex flex-col gap-3">
|
|
|
394
|
+ <!-- 佣金提现 -->
|
|
|
395
|
+ <div class="p-3 flex flex-col gap-3" v-if="isshow == 1">
|
|
261
|
396
|
<div class="flex justify-end">
|
|
262
|
397
|
<div class=" text-sm" @tap="handleWithdrawalRecord">提现记录</div>
|
|
263
|
398
|
</div>
|
|
|
@@ -294,8 +429,8 @@ function handleShowAgreement(type) {
|
|
294
|
429
|
<div>微信</div>
|
|
295
|
430
|
</div>
|
|
296
|
431
|
<div>
|
|
297
|
|
- <radio :checked="true" v-if="iswxshow==true" />
|
|
298
|
|
- <radio :checked="false" v-if="iswxshow==false" @click="Tochecked" />
|
|
|
432
|
+ <radio :checked="true" v-if="iswxshow == true" />
|
|
|
433
|
+ <radio :checked="false" v-if="iswxshow == false" @click="Tochecked" />
|
|
299
|
434
|
</div>
|
|
300
|
435
|
</div>
|
|
301
|
436
|
|
|
|
@@ -321,9 +456,79 @@ function handleShowAgreement(type) {
|
|
321
|
456
|
|
|
322
|
457
|
<div class="flex flex-col text-sm text-gray leading-8 py-4">
|
|
323
|
458
|
<div>详细说明</div>
|
|
324
|
|
- <div>平台服务费 {{ withdrawalCal.service }}</div>
|
|
325
|
|
- <div>本次提取将扣除服务费 ¥{{ withdrawalCal.service_money }}</div>
|
|
326
|
|
- <div>本次提取实际到账额度 ¥{{ withdrawalCal.money }}</div>
|
|
|
459
|
+ <div>平台服务费 {{ cashWithdrawalAmount ? withdrawalCal.service : '0' }}</div>
|
|
|
460
|
+ <div>本次提取将扣除服务费 ¥{{ cashWithdrawalAmount ? withdrawalCal.service_money : '0.00' }}</div>
|
|
|
461
|
+ <div>本次提取实际到账额度 ¥{{ cashWithdrawalAmount ? withdrawalCal.money : '0.00' }}</div>
|
|
|
462
|
+ </div>
|
|
|
463
|
+
|
|
|
464
|
+ </div>
|
|
|
465
|
+
|
|
|
466
|
+ </div>
|
|
|
467
|
+ <!-- 红积分提现 -->
|
|
|
468
|
+ <div class="p-3 flex flex-col gap-3" v-if="isshow == 2">
|
|
|
469
|
+ <div class="bg-white rounded-lg text-sm p-3 flex flex-col gap-4">
|
|
|
470
|
+ <div class="flex justify-between">
|
|
|
471
|
+ <div class="font-bold">提现金额</div>
|
|
|
472
|
+ <div class="text-xs text-gray" @click="handleShowAgreement(6)">提现规则</div>
|
|
|
473
|
+ </div>
|
|
|
474
|
+ <div class="flex justify-center items-center pt-4 f-hairline-bottom">
|
|
|
475
|
+ <div class="text-lg font-bold">¥</div>
|
|
|
476
|
+ <div class="flex-1">
|
|
|
477
|
+ <input placeholder="请输入金额" class="w-full" type="digit" v-model="cashWithdrawalAmount" />
|
|
|
478
|
+ </div>
|
|
|
479
|
+ <div class="text-xs text-red" @click="handleInputAll">全部提现</div>
|
|
|
480
|
+ </div>
|
|
|
481
|
+ <div class="flex text-gray items-center gap-3 text-sm">
|
|
|
482
|
+ <div v-if="userSpreadInfo">
|
|
|
483
|
+ 可用余额¥:{{ userStore.userInfo.member_brokerage_price }}
|
|
|
484
|
+ </div>
|
|
|
485
|
+ <div v-if="userStore.userInfo">
|
|
|
486
|
+ 可用红积分:{{ parseFloat(Number(userStore.userInfo.red)).toFixed(2).replace(/\.?0+$/, '') }}
|
|
|
487
|
+ </div>
|
|
|
488
|
+ </div>
|
|
|
489
|
+
|
|
|
490
|
+ </div>
|
|
|
491
|
+ <div class="bg-white rounded-lg text-sm p-3 flex flex-col">
|
|
|
492
|
+ <div class="flex f-hairline-bottom font-bold text-sm pb-2">
|
|
|
493
|
+ 提现至
|
|
|
494
|
+ </div>
|
|
|
495
|
+ <div>
|
|
|
496
|
+ <div class="flex items-center justify-between py-3">
|
|
|
497
|
+ <div class="flex items-center gap-2">
|
|
|
498
|
+ <image :src="wx_logoImage" mode="widthFix" class="w-8 h-8"></image>
|
|
|
499
|
+ <div>微信</div>
|
|
|
500
|
+ </div>
|
|
|
501
|
+ <div>
|
|
|
502
|
+ <radio :checked="true" v-if="iswxshow == true" />
|
|
|
503
|
+ <radio :checked="false" v-if="iswxshow == false" @click="Tochecked" />
|
|
|
504
|
+ </div>
|
|
|
505
|
+ </div>
|
|
|
506
|
+
|
|
|
507
|
+ <!-- <div class="flex items-center justify-between py-3">-->
|
|
|
508
|
+ <!-- <div class="flex items-center gap-2">-->
|
|
|
509
|
+ <!-- <image :src="zfb_logoImage" mode="widthFix" class="w-8 h-8"></image>-->
|
|
|
510
|
+ <!-- <div>支付宝支付</div>-->
|
|
|
511
|
+ <!-- </div>-->
|
|
|
512
|
+ <!-- <div>-->
|
|
|
513
|
+ <!-- <radio />-->
|
|
|
514
|
+ <!-- </div>-->
|
|
|
515
|
+ <!-- </div>-->
|
|
|
516
|
+ </div>
|
|
|
517
|
+ </div>
|
|
|
518
|
+
|
|
|
519
|
+ <div class="flex flex-col">
|
|
|
520
|
+ <div class=" flex rounded-full bg-red-300">
|
|
|
521
|
+ <nut-button type="primary" block :disabled="isDisabled" :class="isDisabled && 'bg-gray-800'"
|
|
|
522
|
+ @tap="handleImmediateredWithdrawal">
|
|
|
523
|
+ 立即提现
|
|
|
524
|
+ </nut-button>
|
|
|
525
|
+ </div>
|
|
|
526
|
+
|
|
|
527
|
+ <div class="flex flex-col text-sm text-gray leading-8 py-4">
|
|
|
528
|
+ <div>详细说明</div>
|
|
|
529
|
+ <div>平台服务费 {{ cashWithdrawalAmount ? withdrawalCal.service : '0' }}</div>
|
|
|
530
|
+ <div>本次提取将扣除服务费 ¥{{ cashWithdrawalAmount ? withdrawalCal.service_money : '0.00' }}</div>
|
|
|
531
|
+ <div>本次提取实际到账额度 ¥{{ cashWithdrawalAmount ? withdrawalCal.money : '0.00' }}</div>
|
|
327
|
532
|
</div>
|
|
328
|
533
|
|
|
329
|
534
|
</div>
|