|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
- <view class="content">
|
|
|
+ <view class="content">
|
|
|
+ <view class="" style="padding: 20rpx;font-size: 20rpx; color: #999;background-color: #fff;">
|
|
|
+ 提现需收取{{commission || '0'}}%手续费
|
|
|
+ </view>
|
|
|
<view class="content-money">
|
|
|
<view class="buttom">
|
|
|
<text class="text">可提现金额</text>
|
|
@@ -21,7 +24,24 @@
|
|
|
<view class=" tip-icon" @click="all()">全部提现</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+ <template v-if="withdrawal*1 > 0">
|
|
|
+ <view class="sq">
|
|
|
+ <text class="" style="font-size: 28rpx;">
|
|
|
+ 手续费
|
|
|
+ </text>
|
|
|
+ <text class="num" style="font-size: 28rpx;">
|
|
|
+ ¥{{ sxf | getMoneyStyle }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view class="sq" >
|
|
|
+ <text class="" style="font-size: 28rpx;">
|
|
|
+ 实际到账
|
|
|
+ </text>
|
|
|
+ <text class="num" style="font-size: 28rpx;">
|
|
|
+ ¥{{ sjdz | getMoneyStyle }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
<view class="list">
|
|
|
<radio-group @change="tabRadio">
|
|
|
<!-- <label>
|
|
@@ -65,7 +85,7 @@
|
|
|
</label>
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
- <button class="add-btn up" @click="confirm">提交申请</button>
|
|
|
+ <button class="add-btn up" @click="loading?'':confirm()">提交申请</button>
|
|
|
<button class="add-btn modified" @click="navTo('/pages/set/userinfo')">账号管理</button>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -73,10 +93,17 @@
|
|
|
<script>
|
|
|
import { getMoneyStyle } from '@/utils/rocessor.js';
|
|
|
import { extractCash, extractBank, aliInfo, bankInfo } from '@/api/wallet.js';
|
|
|
-import { mapState, mapMutations } from 'vuex';
|
|
|
-export default {
|
|
|
+import { mapState, mapMutations } from 'vuex';
|
|
|
+import { getUserInfo } from '@/api/user.js'
|
|
|
+export default {
|
|
|
+ filters: {
|
|
|
+ getMoneyStyle
|
|
|
+ },
|
|
|
data() {
|
|
|
- return {
|
|
|
+ return {
|
|
|
+ loading: true,
|
|
|
+ // userInfo: {},
|
|
|
+ commission: 0,
|
|
|
type: 'alipay', //提现方式
|
|
|
money: '', //可提现金额
|
|
|
withdrawal: '', //提现金额
|
|
@@ -93,13 +120,23 @@ export default {
|
|
|
...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
|
|
|
moneyMin() {
|
|
|
return '最低提现金额' + this.minPrice + '元';
|
|
|
+ },
|
|
|
+ //提现手续费
|
|
|
+ sxf() {
|
|
|
+ return (this.withdrawal*1*0.01*this.commission)
|
|
|
+ },
|
|
|
+ //实际到账
|
|
|
+ sjdz() {
|
|
|
+ return (this.withdrawal*1*(100-this.commission)*0.01)
|
|
|
}
|
|
|
},
|
|
|
- onShow(options) {
|
|
|
+ async onShow(options) {
|
|
|
+
|
|
|
// #ifdef H5
|
|
|
this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
|
|
|
// #endif
|
|
|
- //加载提现信息
|
|
|
+ //加载提现信息
|
|
|
+ await this.getUserInfo()
|
|
|
this.loadData();
|
|
|
// 加载提款账号信息
|
|
|
this.aliData.fullname = this.userInfo.alipay_name;
|
|
@@ -109,15 +146,23 @@ export default {
|
|
|
this.bankData.bank = this.userInfo.account_Bank + '(' + this.userInfo.bank_branch + ')';
|
|
|
this.bankData.bankno = this.userInfo.bank_card;
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
|
|
|
+ getUserInfo() {
|
|
|
+ getUserInfo({}).then(({data}) => {
|
|
|
+ this.setUserInfo(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 加载余额信息
|
|
|
async loadData() {
|
|
|
extractBank({}).then(({ data }) => {
|
|
|
- console.log(data);
|
|
|
+ console.log(data);
|
|
|
+ this.commission = data.commission
|
|
|
this.coldMoney = data.brokerage_price; //冻结中金额
|
|
|
this.money = data.commissionCount * 1; //可提现余额
|
|
|
this.minPrice = data.minPrice; //最小提现
|
|
|
- this.freeze = data.inmoneyCount; //提现中的余额
|
|
|
+ this.freeze = data.inmoneyCount; //提现中的余额
|
|
|
+ this.loading = false
|
|
|
});
|
|
|
},
|
|
|
// 跳转
|
|
@@ -139,9 +184,13 @@ export default {
|
|
|
if (this.withdrawal === '') {
|
|
|
this.$api.msg('请填写需要提现的佣金');
|
|
|
return;
|
|
|
+ }
|
|
|
+ if(this.withdrawal*1 > this.money*1 ) {
|
|
|
+ this.$api.msg('可提金额不足!');
|
|
|
+ return;
|
|
|
}
|
|
|
if (this.withdrawal == 0) {
|
|
|
- this.$api.msg('提现佣金不能为0');
|
|
|
+ this.$api.msg('提现红利不能为0');
|
|
|
return;
|
|
|
}
|
|
|
if (this.withdrawal < this.minPrice) {
|
|
@@ -151,7 +200,8 @@ export default {
|
|
|
let data = {
|
|
|
extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
|
|
|
money: this.withdrawal, //金额
|
|
|
- money_type: 'brokerage' //0佣金1余额
|
|
|
+ money_type: 'brokerage' ,//0佣金1余额
|
|
|
+ balance_type: 0,
|
|
|
};
|
|
|
if (this.type == 'alipay') {
|
|
|
data.name = this.aliData.fullname;
|
|
@@ -162,12 +212,19 @@ export default {
|
|
|
data.bankname = this.bankData.bank;
|
|
|
data.cardnum = this.bankData.bankno;
|
|
|
}
|
|
|
-
|
|
|
+ this.loading = true
|
|
|
extractCash(data)
|
|
|
.then(e => {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/money/success?type=1'
|
|
|
- });
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '/pages/money/success?type=1'
|
|
|
+ // });
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ duration: 2000,
|
|
|
+ position: 'top'
|
|
|
+ });
|
|
|
+ this.getUserInfo()
|
|
|
+ this.loadData()
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log();
|
|
@@ -303,5 +360,23 @@ page {
|
|
|
/deep/ .uni-radio-input {
|
|
|
width: 45rpx;
|
|
|
height: 45rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.sq {
|
|
|
+ // height: 110rpx;
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333333;
|
|
|
+ // line-height: 110rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .num {
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ // line-height: 46px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|