<template>
|
<view class="apply-cash" v-if="!loadding">
|
<!--申请成功-->
|
<view class="form-wrap f30">
|
<form @submit="formSubmit" @reset="formReset">
|
<view class="bg-white">
|
<view class="p-0-20 pt30 txje">
|
{{ words.cash_apply.words.money.value }}<text class="f26 gray9 ml30">{{ words.cash_apply.words.min_money.value+bonus.settlement.min_money+'元' }}</text>
|
</view>
|
<view class="p20">
|
<view class="withd-bc">
|
<view class="withd-bct">
|
<text style="font-size: 48rpx;">¥</text>
|
<view class="d-s-c flex-1">
|
<input class="tx-inpt flex-1" name="money" v-model="money" type="number" placeholder="请输入您要提现的金额" placeholder-style="font-size: 32rpx; color: #cccccc" @input="moneyInput()"/>
|
</view>
|
<button class="btn-gray-border btn-all" @click="getAll">全部提现</button>
|
</view>
|
<view class="d-b-c pt30 gray6 f26">
|
<view>{{ words.cash_apply.words.capital.value }}{{bonus.bonus.money}}元,提现手续费{{fee_rate}}%</view>
|
</view>
|
<view class="pt20 gray6 f26" v-if="real_money>0">
|
您申请提现{{money}}元,扣除手续费<text class="redEe">{{fee_money}}</text>元
|
,实际到账<text class="redEe">{{real_money}}</text>元
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="bg-white">
|
<view class="p20 f32 gray3 mt20">提现方式</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)">
|
<text class="f26 gray3">微信支付</text>
|
<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)">
|
<text class="f28 gray3">支付宝</text>
|
<text class="icon iconfont icon-xuanze"></text>
|
</view>
|
<template v-if="withdraw_type==20">
|
<view class="mt20">
|
<input class="p20 border" name="alipay_name" type="text" v-model="bonus.bonus.user.alipay_name" placeholder-class="grary" placeholder="请输入姓名" />
|
</view>
|
<view class="mt20">
|
<input class="p20 border" name="alipay_account" type="text" v-model="bonus.bonus.user.alipay_account" 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)">
|
<text class="f28 gray3">银行卡</text>
|
<text class="icon iconfont icon-xuanze"></text>
|
</view>
|
<template v-if="withdraw_type==30">
|
<template v-if="yms_open=='1'">
|
<view class="pt30">
|
<view class="form-item gray6">
|
<view class="field-name">开户姓名</view>
|
<view>{{ymsUser.real_name}}</view>
|
</view>
|
<view class="form-item gray6">
|
<view class="field-name">银行卡号</view>
|
<view>{{ymsUser.bank_card}}</view>
|
</view>
|
<view class="form-item gray6">
|
<view class="field-name">开户银行</view>
|
<view>{{ymsUser.bank_name}}</view>
|
</view>
|
</view>
|
|
</template>
|
<template v-else>
|
<view class="mt20">
|
<input class="p20 border" name="bank_account" type="text" value="" placeholder-class="grary" placeholder="请输入开户姓名" />
|
</view>
|
<view class="mt20">
|
<input class="p20 border" name="bank_card" type="text" value="" placeholder-class="grary" placeholder="请输入银行卡号" />
|
</view>
|
<view class="mt20">
|
<input class="p20 border" name="bank_name" type="text" value="" placeholder-class="grary" placeholder="请输入银行名称" />
|
</view>
|
|
</template>
|
</template>
|
</view>
|
</template>
|
<template v-if="hasType('40')">
|
<view class="p-30-0 border-b">
|
<view class="d-b-c" :class="withdraw_type==40?'active':''" @click="TabType(40)">
|
<text class="f26 gray3">余额</text>
|
<text class="icon iconfont icon-xuanze"></text>
|
</view>
|
</view>
|
</template>
|
</view>
|
</view>
|
</view>
|
<view class="d-c-c p20">
|
<button type="primary" class="btn-red flex-1" :style="{background: baseColor}" form-type="submit">{{ words.cash_apply.words.submit.value }}</button>
|
</view>
|
<view class="p20 f26" v-if="explain">
|
<view class="fb gray6">提现说明:</view>
|
<view class="mt10 gray9" style="white-space: pre-wrap;">{{explain}}</view>
|
</view>
|
</form>
|
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
export default {
|
components: {},
|
data() {
|
return {
|
loadding: true,
|
/*是否加载完成*/
|
indicatorDots: true,
|
autoplay: true,
|
interval: 2000,
|
duration: 500,
|
/*支付类别*/
|
withdraw_type: 10,
|
isData: false,
|
bonus: {},
|
payType: [],
|
words: {},
|
/*小程序订阅消息*/
|
temlIds: [],
|
money: '',
|
fee_rate: 0,
|
fee_money: 0,
|
real_money: 0,
|
explain:'',
|
baseColor: '',
|
yms_open: 0,
|
ymsUser: {}
|
}
|
},
|
mounted() {
|
this.setPageColor();
|
/*获取数据*/
|
this.getData();
|
},
|
methods: {
|
/*设置页面*/
|
setPageColor() {
|
let tabBar = uni.getStorageSync('TabBar');
|
this.baseColor = tabBar.color;
|
},
|
/*获取数据*/
|
getData() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
});
|
self.loadding = true;
|
self._get('user.bonus/cash', {
|
platform: self.getPlatform()
|
}, function(res) {
|
// 跳转完税系统 by lzyflash
|
if (res.data.needSohoSign) {
|
self.gotoPage('/pages/user/yms/sign/sign');
|
return;
|
}
|
self.bonus = res.data;
|
self.words = res.data.words;
|
self.payType = self.bonus.settlement.pay_type;
|
self.bonus.isData = true;
|
self.temlIds = res.data.template_arr;
|
self.fee_rate = Number(self.bonus.settlement.fee_rate)||0;
|
self.explain = self.bonus.settlement.explain;
|
self.yms_open = self.bonus.yms_open;
|
self.ymsUser = self.bonus.ymsUser;
|
// 判断默认提现方式是否存在
|
if (!self.hasType(self.withdraw_type)) {
|
self.withdraw_type = '';
|
}
|
self.loadding = false;
|
uni.hideLoading();
|
});
|
},
|
|
/*切换提现方式*/
|
TabType(e) {
|
this.withdraw_type = e;
|
},
|
|
/*判断是否存在*/
|
hasType(e) {
|
if (this.payType.indexOf(e) != -1) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
getAll() {
|
this.money = this.bonus.bonus.money;
|
this.checkFee();
|
},
|
moneyInput(e){
|
this.checkFee();
|
},
|
checkFee(){
|
if(Number(this.money)>0){
|
if(Number(this.money) > this.bonus.bonus.money) {
|
this.money = this.bonus.bonus.money;
|
}
|
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;
|
if (!formdata.pay_type) {
|
uni.showToast({
|
title: '请选择提现方式',
|
icon: 'none'
|
});
|
return;
|
}
|
var data = JSON.stringify(formdata);
|
let callback = function() {
|
uni.showLoading({
|
title: '正在提交',
|
mask: true
|
})
|
self._post('plus.bonus.cash/submit', {
|
data: data
|
}, function(data) {
|
uni.hideLoading();
|
uni.showToast({
|
title: '申请成功',
|
duration: 2000,
|
icon: 'success'
|
});
|
uni.navigateBack(-1);
|
});
|
}
|
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;
|
}
|
|
.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: 36rpx;
|
}
|
|
.form-item .active {
|
font-weight: bold;
|
}
|
|
.form-item .active .iconfont.icon-xuanze {
|
color: #F6220C;
|
}
|
|
.apply-cash .btn-red {
|
height: 88rpx;
|
line-height: 88rpx;
|
border-radius: 44rpx;
|
background: linear-gradient(90deg, #FF6B6B 4%, #F6220C 100%);
|
border: none;
|
font-size: 32rpx;
|
}
|
|
.withd-b {
|
background-color: #FFFFFF;
|
margin-bottom: 97rpx;
|
}
|
|
.withd-bct {
|
height: 92rpx;
|
padding-top: 30rpx;
|
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;
|
}
|
|
.btn-all {
|
font-size: 26rpx;
|
padding: 8rpx 10rpx;
|
line-height: normal;
|
}
|
.form-item .border-b:last-child {
|
border-bottom-width: 0;
|
}
|
</style>
|