quanwei
2025-10-31 7a27a1d4d0038abe2115adb1753f897f56d66323
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
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
<template>
    <view class="apply-cash" v-if="!loadding"  :data-theme='theme()' :class="theme() || ''">
        <!--申请成功-->
        <view class="form-wrap ">
            <form @submit="formSubmit">
                <view class="d-b-s p32 cash-top" @click="isType=true">
                    <view class="f28 gray6 mr32">提现到</view>
                    <view class="flex-1 d-s-s" v-if="withdraw_type==10">
                        <view>
                            <image class="cash-icon mr16" src="/static/wx.png" mode=""></image>
                        </view>
                        <view>
                            <view class="f32">微信钱包</view>
                            <view class="f24 gray6 flex-1">实时到账</view>
                        </view>
                    </view>
                    <view class="flex-1 d-s-s" v-if="withdraw_type==30">
                        <view>
                            <image class="cash-icon mr16" src="/static/yhk.png" mode=""></image>
                        </view>
                        <view>
                            <view class="f32">银行卡</view>
                            <view class="f24 gray6 flex-1">预计2小时内到账</view>
                        </view>
                    </view>
                    <view class="flex-1 d-s-s" v-if="withdraw_type==20">
                        <view>
                            <image class="cash-icon mr16" src="/static/zfb.png" mode=""></image>
                        </view>
                        <view>
                            <view class="f32">支付宝</view>
                            <view class="f24 gray6 flex-1">实时到账</view>
                        </view>
                    </view>
                    <view class="icon iconfont icon-jiantou"></view>
                </view>
                <view class="border-top">
                    <view class="border-box"></view>
                </view>
                <view class="p-0-32">
                    <template v-if="withdraw_type==20">
                        <view class="f28 mb16">提现支付宝</view>
                        <view class="cash-input-item">
                            <view class="input-label">姓名</view>
                            <input class="p20 flex-1" name="alipay_name" type="text" value="" placeholder-class="grary"
                                placeholder="请输入姓名" />
                        </view>
                        <view class="cash-input-item mb48">
                            <view class="input-label">账号</view>
                            <input class="p20 flex-1" name="alipay_account" type="text" value=""
                                placeholder-class="grary" placeholder="请输入支付宝账号" />
                        </view>
                    </template>
                    <template v-if="withdraw_type==30">
                        <view class="f28 mb16">提现银行卡</view>
                        <view class="cash-input-item">
                            <view class="input-label">户名</view>
                            <input class="p20 flex-1" name="bank_name" type="text" value="" placeholder-class="grary"
                                placeholder="请输入姓名" />
                        </view>
                        <view class="cash-input-item">
                            <view class="input-label">账号</view>
                            <input class="p20 flex-1" name="bank_card" type="text" value="" placeholder-class="grary"
                                placeholder="请输入银行卡号" />
                        </view>
                        <view class="cash-input-item mb48">
                            <view class="input-label">开户行</view>
                            <input class="p20 flex-1" name="bank_account" type="text" value="" placeholder-class="grary"
                                placeholder="请输入开户行名称/地址" />
                        </view>
                    </template>
                    <view class=" txje">提现金额</view>
                    <view class="mb48">
                        <view class="withd-bc">
                            <view class="withd-bct">
                                <view style="height: 100%;display: flex;align-items: center;">
                                    <text style="font-size: 48rpx;">¥</text>
                                    <input class="tx-inpt" name="money" v-model="money" type="number" />
                                </view>
                            </view>
                            <view class="withd-bcb f26" v-if="money*1>balance*1">
                                <text class="red">输入金额超过可提现金额</text>
                            </view>
                            <view class="withd-bcb gray6 f26" v-else>
                                可提现余额{{balance}}元,<text @click="getAll"
                                    class="dominant fb">全部提现</text>
                            </view>
                        </view>
                    </view>
                    <view class="d-c-c" style="border: 16rpx solid #ffffff">
                        <button v-if="money*1<=balance*1" type="primary" class="btn-red flex-1"
                            @click="popup">提交申请</button>
                        <button v-else disabled class="btn-red-disabled flex-1"
                            @click="popup">提交申请</button>
                    </view>
                    <!-- <view class="login_index_seller_rule">
                        <label class="">
                            <radio class="radio" value="r1" :checked="ifchecked" 
                                @click="checkedme(false)" />
                        </label>
                        <text class="gray6">我已阅读并同意</text>
                        <text class="dominant"
                            @click="gotoPage('/pages/agent/cash/apply/webview')">《提现规则》</text>
                    </view> -->
                </view>
 
                <Popup :show="isPopup" :width='622' :padding="0" type="middle">
                    <view class="ww100 box-s-b pop-improt pr">
                        <view class="d-c-c mb48">
                            <text class="f34 fb">实际到账</text>
                            <view class="icon iconfont icon-guanbi" @click="hidePopupFunc(1)"></view>
                        </view>
                        <view class="tc f40 mb48 fb">
                            ¥<text class="f64">{{overMoney}}</text>
                        </view>
                        <view class="d-b-c mb60" style="line-height: 48rpx;">
                            <view class="gray6 f28">提现比例</view>
                            <view class="gray3 f28">{{cash_ratio}}%</view>
                        </view>
                        <button form-type="submit" class="submitbtn">确认提交</button>
                    </view>
                </Popup>
                <Popup :show="isType" :width='750' :padding="0" type="bottom">
                    <view class="ww100 box-s-b pop-improt typeof pr">
                        <view class="d-c-c mb48">
                            <text class="f34 fb">选择提现方式</text>
                            <view class="close-text" @click="isType=false">取消</view>
                        </view>
                        <view class="d-b-c pop-type-item"  @click="typeFunc(10)">
                            <view class="mr16">
                                <image class="cash-icon" src="/static/wx.png" mode=""></image>
                            </view>
                            <view class="d-b-c flex-1">
                                <view class="flex-1  tl">
                                    <view class="f32 gray72 mb6">微信钱包</view>
                                    <view class="f24 gray6">实时到账</view>
                                </view>
                                <view class="select-img" v-if="pop_type==10">
                                    <image src="/static/select.png" mode=""></image>
                                </view>
                            </view>
                        </view>
                        <view class="d-b-c pop-type-item"  @click="typeFunc(20)">
                            <view class="mr16">
                                <image class="cash-icon" src="/static/zfb.png" mode=""></image>
                            </view>
                            <view class="d-b-c flex-1">
                                <view class="flex-1  tl">
                                    <view class="f32 gray72 mb6">支付宝</view>
                                    <view class="f24 gray6">实时到账</view>
                                </view>
                                <view class="select-img" v-if="pop_type==20">
                                    <image src="/static/select.png" mode=""></image>
                                </view>
                            </view>
                        </view>
                        <view class="d-b-c pop-type-item"  @click="typeFunc(30)">
                            <view class="mr16">
                                <image class="cash-icon" src="/static/yhk.png" mode=""></image>
                            </view>
                            <view class="d-b-c flex-1">
                                <view class="flex-1 tl">
                                    <view class="f32 gray72 mb6">银行卡</view>
                                    <view class="f24 gray6">预计2小时内到账</view>
                                </view>
                                <view class="select-img" v-if="pop_type==30">
                                    <image src="/static/select.png" mode=""></image>
                                </view>
                            </view>
                        </view>
                        <button @click="selectType" class="submitbtn">确定</button>
                    </view>
                </Popup>
            </form>
        </view>
 
    </view>
</template>
 
<script>
    import Popup from '@/components/uni-popup.vue';
    export default {
        components: {
            Popup
        },
        data() {
            return {
                loadding: true,
                /*是否加载完成*/
                indicatorDots: true,
                autoplay: true,
                interval: 2000,
                duration: 500,
                /*支付类别*/
                withdraw_type: 10,
                agent: {},
                payType: [],
                words: {},
                /*小程序订阅消息*/
                temlIds: [],
                money: '',
                ifchecked: false,
                url: '',
                isPopup: false,
                cash_ratio: 0,
                cash_ratioMoney: '',
                overMoney: '',
                isType: false,
                pop_type: 10,
                balance:''
            }
        },
        mounted() {
            /*获取数据*/
            this.getData();
        },
        onLoad() {
            // this.url = this.config.app_url + '/agreement/cash.docx';
        },
        watch: {
            'money': function(n, o) {
                let self = this;
                if (n != o) {
                    self.cash_ratioMoney = self.cash_ratio_percent();
                    self.overMoney = self.overprice();
 
                }
            }
        },
        methods: {
            typeFunc(n) {
                this.pop_type = n;
            },
            /*获取数据*/
            getData() {
                let self = this;
                uni.showLoading({
                    title: '加载中'
                });
                self.loadding = true;
                self._get('user.cash/index', {
                    platform: self.getPlatform()
                }, function(res) {
                    self.balance = res.data.balance;
                    self.cash_ratio = res.data.cash_ratio;
                    // self.payType = self.agent.settlement.pay_type;
                    self.loadding = false;
                    uni.hideLoading();
                });
            },
 
            checkedme(e) {
                let self = this;
                self.ifchecked = !self.ifchecked;
            },
            /*切换提现方式*/
            TabType(e) {
                this.withdraw_type = e;
            },
            selectType() {
                this.withdraw_type = this.pop_type;
                this.isType = false;
            },
            /*判断是否存在*/
            hasType(e) {
                if (this.payType.indexOf(e) != -1) {
                    return true;
                } else {
                    return false;
                }
            },
            popup() {
                this.isPopup = true;
            },
            hidePopupFunc() {
                this.isPopup = false;
            },
            getAll() {
                this.money = this.balance;
            },
            // openDoc(e) {
            //     var that = this;
            //     var filePath = e.currentTarget.dataset.url; //对应的网络路径,可以是内网的或者外网
            //     var fileType = e.currentTarget.dataset.type;
            //     console.log(filePath)
            //     wx.downloadFile({ //下载对应文件
            //         url: filePath,
            //         filePath: wx.env.USER_DATA_PATH + "/汇乐宝提现规则.docx",
            //         success: function(res) {
            //             var filePath = res.filePath; //文件路径    
            //             wx.openDocument({
            //                 filePath: filePath, // 装载对应文件的路径
            //                 fileType: fileType, // 指定打开的文件类型
            //                 showMenu: true, // 右上角的菜单转发分享操作
            //                 success: function(res) {
            //                     console.log("打开成功");
            //                 },
            //                 fail: function(res) {}
            //             })
            //         },
            //         fail: function(res) {
            //             console.log(res);
            //         }
            //     })
            // },
            cash_ratio_percent() {
                let money = this.money;
                let num = money * this.cash_ratio / 100;
                num=num.toFixed(2);
                return num
            },
            overprice() {
                let money = this.money * this.cash_ratio / 100;
                money = money.toFixed(2);
                console.log(money)
                return money
            },
            /*申请*/
            formSubmit: function(e) {
                console.log(111)
                let self = this;
                var formdata = e.detail.value;
                formdata.pay_type = self.withdraw_type;
                // if (self.ifchecked != true) {
                //     uni.showToast({
                //         title: '请阅读并勾选《提现规则》',
                //         duration: 1000,
                //         icon: 'none'
                //     });
                //     return false;
                // }
                var data = JSON.stringify(formdata);
                uni.showLoading({
                    title: '正在提交',
                    mask: true
                })
                self._post('user.cash/submit', {
                    data: data
                }, function(res) {
                    uni.hideLoading();
                    uni.showToast({
                        title: '申请成功',
                        duration: 2000,
                        icon: 'success'
                    });
                    uni.navigateBack();
                },(err)=>{
                    self.isPopup=false;
                });
            },
        }
    }
</script>
 
<style lang="scss">
    page {
        background-color: #FFFFFF;
    }
 
    .dominant {
        @include font_color("font_color");
    }
 
    .txje {
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #333333;
    }
 
    .apply-cash {
        /* padding-top: 16rpx; */
    }
 
    .form-wrap {
        /* border-radius: 20rpx; */
        // background: #FFFFFF;
        /* box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, .2); */
    }
 
    .form-item {
        margin-bottom: 20rpx;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        font-size: 28rpx;
    }
 
    .form-item .field-name {
        width: 140rpx;
    }
 
    .form-item input {
        font-size: 28rpx;
    }
 
    .form-item .text-price {
        padding: 0 10rpx;
        height: 80rpx;
        line-height: 80rpx;
        border-radius: 40rpx;
        border: 1px solid #CCCCCC;
    }
 
    .agreement-content {
        max-height: 60vh;
        overflow-y: auto;
    }
 
    .iconfont.icon-xuanze {
        font-size: 30rpx;
    }
 
    .form-item .active .iconfont.icon-xuanze {
        color: #F6220C;
    }
 
    .apply-cash .btn-red {
        width: 686rpx;
        height: 96rpx;
        line-height: 96rpx;
        @include background_color("background_color");
        opacity: 1;
        border-radius: 16rpx;
        border: none;
        font-size: 28rpx;
    }
 
    .apply-cash .btn-red-disabled {
        width: 686rpx;
        height: 96rpx;
        line-height: 96rpx;
        background-color: #F5F5F5;
        background: #F5F5F5;
        opacity: 1;
        border-radius: 16rpx;
        color: rgba(0, 0, 0, 0.24);
        border: none;
        font-size: 28rpx;
    }
 
    .withd-b {
        background-color: #FFFFFF;
        margin-bottom: 97rpx;
    }
 
    .withd-bct {
        height: 92rpx;
        padding-top: 59rpx;
        padding-right: 49rpx;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1rpx solid #d0d0d0;
    }
 
    .tx-inpt {
        background-color: #FFFFFF;
        font-size: 48rpx;
        line-height: 92rpx;
    }
 
    .withd-bcb {
        padding: 27rpx 0 49rpx 0;
    }
 
    .withdrawal-btn {
        margin: 0 30rpx;
        @include background_color("background_color");
        height: 60rpx;
        line-height: 60rpx;
        color: #FFFFFF;
        text-align: center;
        border-radius: 30rpx;
        padding: 0;
        font-size: 24rpx;
    }
 
    .login_index_seller_rule {
        width: 90%;
        margin: 0 auto;
        text-align: center;
        font-size: 24rpx;
    }
 
    .radio {
        transform: scale(0.7)
    }
 
    .pop-improt {
        width: 622rpx;
        height:480rpx;
        box-sizing: border-box;
        border-radius: 24rpx;
        padding: 32rpx;
    }
 
    .pop-improt .icon-guanbi {
        position: absolute;
        top: 32rpx;
        right: 32rpx;
        width: 30rpx;
        height: 30rpx;
        font-size: 26rpx;
        color: #666666;
 
    }
 
    .pop-improt.typeof {
        width: 750rpx;
        height: auto;
    }
 
    .pop-improt .close-text {
        position: absolute;
        top: 32rpx;
        left: 32rpx;
        font-size: 28rpx;
        font-weight: 600;
        @include font_color("font_color");
 
    }
 
    .submitbtn {
        width: 558rpx;
        height: 80rpx;
        @include background_color("background_color");
        opacity: 1;
        border-radius: 16rpx;
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 400;
        color: #FFFFFF;
        line-height: 80rpx;
        opacity: 1;
        margin: 0 auto;
    }
 
    .cash-icon {
        width: 40rpx;
        height: 40rpx;
    }
 
    .select-img {
        image{
            width: 48rpx;
            height: 48rpx;
        }
        width: 48rpx;
        height: 48rpx;
    }
 
    .pop-type-item {
        height: 138rpx;
        background: #FFFFFF;
        border-radius: 0px;
    }
 
    .cash-input-item {
        height: 88rpx;
        background: #FFFFFF;
        display: flex;
        justify-content: center;
        align-items: center;
        .input-label{
            width: 160rpx;
            text-align: left;
        }
    }
 
    .cash-top {
        height: 146rpx;
        box-sizing: border-box;
        background: #F5F5F5;
    }
 
    .border-top {
        .border-box{
            box-sizing: border;
            border-radius: 40rpx 40rpx 0px 0px;
            background-color: #FFFFFF;
            height: 58rpx;
            width: 100%;
        }
        height: 58rpx;
        width: 100%;
        background-color: #f5f5f5;
        
    }
    .mb48{
        margin-bottom: 48rpx;
    }
    .mb60{
        margin-bottom: 60rpx;
    }
</style>