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