Fix(提现):[#1202]提现金额不应该减掉手续费,实际到手的金额由后端计算即可
This commit is contained in:
@@ -21,15 +21,18 @@
|
||||
<view class="item acea-row row-middle">
|
||||
<view class="dollar bold">¥</view>
|
||||
<view class="input">
|
||||
<input
|
||||
:placeholder="'最低提现金额' + minPrice"
|
||||
placeholder-style="font-size:28rpx"
|
||||
v-model="amout"
|
||||
:maxlength='maxlength'
|
||||
@blur="balanceInputBlur"
|
||||
@input="balanceInputChange"
|
||||
type="digit"
|
||||
autofocus
|
||||
<u--input
|
||||
v-model="amout"
|
||||
:placeholder="'最低提现金额' + minPrice"
|
||||
:maxlength="-1"
|
||||
:customStyle="{
|
||||
'border': 0
|
||||
}"
|
||||
placeholder-style="font-size:28rpx"
|
||||
type="digit"
|
||||
autofocus
|
||||
@blur="balanceInputBlur"
|
||||
@input="balanceInputChange"
|
||||
/>
|
||||
</view>
|
||||
<view class="withdraw-all-btn" @click="withdrawalAll">全部提现</view>
|
||||
@@ -52,7 +55,8 @@
|
||||
<uni-popup ref="popup" type="bottom">
|
||||
<blPaymentPasswordInput hideTopBorder ref="secrity" @input="onInput" @confirm="onConfirm">
|
||||
<block slot='header' style='width: 100%;'>
|
||||
<view style="font-size: 36rpx;color: #8B8F99;margin-top: 10rpx;">请输入支付密码</view>
|
||||
<view style="font-size: 36rpx;color: #8B8F99;line-height: 80rpx;">请输入支付密码</view>
|
||||
<view style="font-size: 28rpx;color: #999;margin-top: 20rpx;">手续费:{{ totalFee }}</view>
|
||||
</block>
|
||||
<block slot='middle'>
|
||||
<view class="" style="background-color: #fff;"></view>
|
||||
@@ -66,7 +70,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import {getUserInfo, getMenuUser, bindingPhone, getBank, bankCardList, postCashInfo} from "@/api/user";
|
||||
import { getBank, bankCardList, postCashInfo } from "@/api/user";
|
||||
import NP from "number-precision";
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
|
||||
@@ -80,7 +84,6 @@ export default {
|
||||
amout: "",
|
||||
minPrice: 0,
|
||||
banks: [],
|
||||
maxlength: -1,
|
||||
commissionCount: 0, //可提现金额
|
||||
fee: 0, //手续费
|
||||
gdAmount: 0, //固定手续费
|
||||
@@ -102,7 +105,7 @@ export default {
|
||||
if( 提现金额 < gdLimit ) sxf = gdAmount
|
||||
if( 提现金额 >= gdLimit ) sxf = 提现金额*fl
|
||||
*/
|
||||
return this.calculateSxf(this.amout);
|
||||
return this.calculateSxf(this.amout)
|
||||
}
|
||||
},
|
||||
onLoad: function (e) {
|
||||
@@ -140,8 +143,9 @@ export default {
|
||||
console.log("variable");
|
||||
}
|
||||
console.log("sxf:" + sxf);
|
||||
|
||||
return this.$force2Decimal(sxf);
|
||||
// fix bug#1202
|
||||
// 四舍五入,再保留两位小数
|
||||
return (Math.round(sxf * 100) / 100).toFixed(2);
|
||||
},
|
||||
goCashRecord() {
|
||||
this.$yrouter.push('/pkg_user/views/withdrawalLog');
|
||||
@@ -193,19 +197,24 @@ export default {
|
||||
|
||||
return value
|
||||
},
|
||||
balanceInputChange: function (e) {
|
||||
var value = e.target.value;
|
||||
this.amout = value
|
||||
var v = this.clearNoNum(value)
|
||||
balanceInputChange(value) {
|
||||
let v = this.clearNoNum(value)
|
||||
if (v > this.commissionCount) {
|
||||
v = this.commissionCount
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.amout = v
|
||||
}, 0)
|
||||
},
|
||||
balanceInputBlur: function (e) {
|
||||
var value = e.target.value;
|
||||
|
||||
balanceInputBlur(value) {
|
||||
if (String(value).length == 0) {
|
||||
this.amout = 0
|
||||
return
|
||||
}
|
||||
if (value > this.commissionCount) {
|
||||
this.amout = this.commissionCount
|
||||
} else {
|
||||
this.amout = value
|
||||
}
|
||||
},
|
||||
openPwdInput() {
|
||||
@@ -287,7 +296,6 @@ export default {
|
||||
});
|
||||
},
|
||||
confrimBtnClick: function () {
|
||||
let that = this;
|
||||
if (!this.selectedBank) {
|
||||
this.$dialog.error("请选择提现银行卡");
|
||||
return;
|
||||
@@ -338,32 +346,20 @@ export default {
|
||||
},
|
||||
withdrawalAll: function () {
|
||||
if (this.commissionCount) {
|
||||
this.amout = this.commissionCount + "";
|
||||
this.amout = this.commissionCount + ''
|
||||
}
|
||||
},
|
||||
getBank: function () {
|
||||
let that = this;
|
||||
getBank().then(
|
||||
res => {
|
||||
that.banks = res.data.extractBank;
|
||||
that.minPrice = res.data.minPrice;
|
||||
that.commissionCount = this.$force2Decimal(res.data.commissionCount);
|
||||
that.gdAmount = parseFloat(res.data.gdAmount);
|
||||
that.gdLimit = parseFloat(res.data.gdLimit);
|
||||
that.feeRate = parseFloat(res.data.fl);
|
||||
|
||||
//可提现金额去除手续费
|
||||
if (that.commissionCount > 0) {
|
||||
var sxf = that.calculateSxf(that.commissionCount);
|
||||
console.log('手续费:' + sxf);
|
||||
that.commissionCount = this.$force2Decimal(Math.max(0, (that.commissionCount - sxf)));
|
||||
;
|
||||
}
|
||||
},
|
||||
function (err) {
|
||||
|
||||
}
|
||||
);
|
||||
res => {
|
||||
this.banks = res.data.extractBank
|
||||
this.minPrice = res.data.minPrice
|
||||
this.commissionCount = this.$force2Decimal(res.data.commissionCount)
|
||||
this.gdAmount = parseFloat(res.data.gdAmount)
|
||||
this.gdLimit = parseFloat(res.data.gdLimit)
|
||||
this.feeRate = parseFloat(res.data.fl)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user