quanwei
13 hours ago 408c463c5b66bba2aa1c81d8dca23e04c1608e24
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="apply-cash" v-if="!loadding">
        <!--申请成功-->
        <view class="form-wrap f30">
            <form @submit="formSubmit" @reset="formReset">
                <view class="p-0-20 pt30 txje">
                    提现金额<text class="f26 gray9 ml30">最低提现{{ release.settlement.min_money+'元' }}</text>
                </view>
                <view class="p-0-20 ">
                    <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" @input="moneyInput()"/>
                            </view>
                        </view>
                        <view class="withd-bcb">
                            可提现金额{{release.release.money}}元,提现手续费比例{{fee_rate}}%,<text @click="getAll" style="color: #0479FF;">全部提现</text>
                        </view>
                        <view class="withd-bcb">
                            当前应扣除手续费<text class="redEe">{{fee_money}}元</text>
                            ,实际到账<text class="redEe">{{real_money}}元</text>
                        </view>
                    </view>
                </view>
                <view class="p20 f32 gray3 txbt">提现方式</view>
                <view class="form-item p20">
                    <view class="ww100">
                        <template v-if="hasType('10')">
                            <view class="p-30-0 border-b">
                                <view class="d-b-c" :class="withdraw_type==10?'active':''" @click="TabType(10)">
                                    <view class="d-s-c flex-1">
                                        <image style="width: 28rpx;height: 28rpx;margin-right: 22rpx;" src="/static/wx.png" mode=""></image>
                                        <text class="f26 gray3">微信支付</text>
                                    </view>
                                    <text class="icon iconfont icon-xuanze"></text>
                                </view>
                            </view>
                        </template>
                        <template v-if="hasType('20')">
                            <view class="p-30-0 border-b">
                                <view class="d-b-c" :class="withdraw_type==20?'active':''" @click="TabType(20)">
                                    <view class="d-s-c flex-1">
                                        <image style="width: 28rpx;height: 28rpx;margin-right: 22rpx;" src="/static/zfb.png" mode=""></image>
                                        <text class="f26 gray3">支付宝</text>
                                    </view>
                                    <text class="icon iconfont icon-xuanze"></text>
                                </view>
                                <template v-if="withdraw_type==20">
                                    <view class="mt20">
                                        <input class="p20 border-tb" name="alipay_name" type="text" value="" placeholder-class="grary" placeholder="请输入姓名" />
                                    </view>
                                    <view class="mt20">
                                        <input class="p20 border-tb" name="alipay_account" type="text" value="" placeholder-class="grary" placeholder="请输入支付宝账号" />
                                    </view>
                                </template>
                            </view>
                        </template>
                        <template v-if="hasType('30')">
                            <view class="p-30-0 border-b">
                                <view class="d-b-c" :class="withdraw_type==30?'active':''" @click="TabType(30)">
                                    <view class="d-s-c flex-1">
                                        <image style="width: 28rpx;height: 22rpx;margin-right: 22rpx;" src="/static/yinxingqia.png" mode=""></image>
                                        <text class="f26 gray3">银行卡</text>
                                    </view>
                                    <text class="icon iconfont icon-xuanze"></text>
                                </view>
                                <template v-if="withdraw_type==30">
                                    <view class="mt20">
                                        <input class="p20 border-tb" name="real_name" type="text" value="" placeholder-class="grary" placeholder="请输入开户姓名" />
                                    </view>
                                    <view class="mt20">
                                        <input class="p20 border-tb" name="bank_name" type="text" value="" placeholder-class="grary" placeholder="请输入开户行名称" />
                                    </view>
                                    <view class="mt20">
                                        <input class="p20 border-tb" name="bank_account" type="text" value="" placeholder-class="grary" placeholder="请输入开户行地址" />
                                    </view>
                                    <view class="mt20">
                                        <input class="p20 border-tb" name="bank_card" type="text" value="" placeholder-class="grary" placeholder="请输入银行卡号" />
                                    </view>
                                </template>
                            </view>
                        </template>
                    </view>
                </view>
                <view class="d-c-c mt60" style="border: 16rpx solid #F2F2F2">
                    <button type="primary" class="btn-red flex-1" form-type="submit">提交申请</button>
                </view>
                <view class="fb mt20 p-0-20 gray6" v-if="explain">提现说明:</view>
                <view class="mt10 p20" v-if="explain" style="white-space: pre-wrap;">{{explain}}</view>
            </form>
 
        </view>
        <shopTabBar></shopTabBar>
    </view>
</template>
 
<script>
    export default {
        components: {},
        data() {
            return {
                loadding: true,
                /*是否加载完成*/
                indicatorDots: true,
                autoplay: true,
                interval: 2000,
                duration: 500,
                /*支付类别*/
                withdraw_type: 30,
                isData: false,
                release: {},
                payType: [],
                /*小程序订阅消息*/
                temlIds: [],
                money: '',
                fee_rate:0,
                fee_money:0,
                real_money:0,
                explain:''
            }
        },
        mounted() {
            /*获取数据*/
            this.getData();
        },
        onLoad() {
            uni.setNavigationBarTitle({
                title: '申请提现'
              })
        },
        methods: {
        
            /*获取数据*/
            getData() {
                let self = this;
                uni.showLoading({
                    title: '加载中'
                });
                self.loadding = true;
                self._get('plus.release.cash/index', {
                    platform: self.getPlatform()
                }, function(res) {
                    self.release = res.data;
                    self.payType = self.release.settlement.pay_type;
                    self.release.isData = true;
                    self.temlIds = res.data.template_arr;
                    self.fee_rate=Number(self.release.settlement.fee_rate)||0;
                    self.explain = self.release.settlement.explain;
                    self.loadding = false;
                    uni.hideLoading();
                });
            },
 
            /*切换提现方式*/
            TabType(e) {
                let self = this;
                this.withdraw_type = e;
            },
 
            /*判断是否存在*/
            hasType(e) {
                if (this.payType.indexOf(e) != -1) {
                    return true;
                } else {
                    return false;
                }
            },
            getAll() {
                this.money = this.release.release.money;
                this.checkFee();
            },
            moneyInput(e){
                this.checkFee();
            },
            checkFee(){
                if(Number(this.money)>0){
                    this.fee_money=(Number(this.money)*Number(this.fee_rate)/100).toFixed(2);
                    this.real_money=(Number(this.money)-Number(this.fee_money)).toFixed(2);
                }else{
                    this.fee_money=0;
                    this.real_money=0;
                }
            },
            /*申请*/
            formSubmit: function(e) {
 
                let self = this;
                var formdata = e.detail.value;
                formdata.fee_rate=self.fee_rate;
                formdata.fee_money=self.fee_money;
                formdata.real_money=self.real_money;
                formdata.pay_type = self.withdraw_type;
                var data = JSON.stringify(formdata);
                let callback = function() {
                    uni.showLoading({
                        title: '正在提交',
                        mask: true
                    })
                    self._post('plus.release.Cash/submit', {
                        data: data
                    }, function(data) {
                        uni.hideLoading();
                        uni.showToast({
                            title: '申请成功',
                            duration: 2000,
                            icon: 'success'
                        });
                        setTimeout(function(){
                            uni.navigateBack(-1);
                        },200);
                    });
                }
                self.subMessage(self.temlIds, callback);
            },
        }
    }
</script>
 
<style>
    page {
        background-color: #F2F2F2;
    }
 
    .txje {
        font-size: 32rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #333333;
        margin-top: 16rpx;
    }
 
    .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;
    }
 
    .txbt {
        border-top: 16rpx solid #F2F2F2;
 
    }
 
    .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: #FF5649;
    }
 
    .apply-cash .btn-red {
        height: 88rpx;
        line-height: 88rpx;
        border-radius: 44rpx;
        background: #FF5649;
        border-color: #FF5649;
        border: none;
        font-size: 32rpx;
    }
 
    .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 {
        font-size: 26rpx;
        color: #999999;
        padding: 27rpx 0 49rpx 0;
    }
 
    .withdrawal-btn {
        margin: 0 30rpx;
        background-color: #f36a24;
        height: 60rpx;
        line-height: 60rpx;
        color: #FFFFFF;
        text-align: center;
        border-radius: 30rpx;
        padding: 0;
        font-size: 24rpx;
    }
    .border-tb{
        border: none;
        border-top: 1rpx solid #eeeeee;
        border-bottom: 1rpx solid #eeeeee;
    }
</style>