|
|
@@ -10,11 +10,21 @@
|
|
|
</ion-header>
|
|
|
<ion-content class="wallet-page">
|
|
|
<div class="head">
|
|
|
- <div class="balance">
|
|
|
- <span class="sym">{{ $t('balance.symbol') }}</span
|
|
|
- >{{ balance.balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}
|
|
|
+ <div class="info">
|
|
|
+ <div class="col left">
|
|
|
+ <div class="num">
|
|
|
+ <span class="sym">{{ $t('balance.symbol') }}</span>
|
|
|
+ <span>{{ balance.balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="label">{{ $t('balance.balance') }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="col right">
|
|
|
+ <div class="num credit">
|
|
|
+ <span>{{ balance.credits.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="label">{{ $t('balance.credits') }}</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="label">{{ $t('balance.balance') }}</div>
|
|
|
<div class="btn-record">
|
|
|
<!-- <img src="../assets/double_arrow_left.png" class="arrow" /> -->
|
|
|
<div class="btn-record-item" @click="$router.push({ name: 'userBank' })">
|
|
|
@@ -87,6 +97,11 @@
|
|
|
{{ $t('balance.availableWidthdrawAmount') }}: {{ $t('balance.symbol')
|
|
|
}}{{ balance.balance }}
|
|
|
</div>
|
|
|
+ <div class="desc">
|
|
|
+ {{ $t('balance.totalRechargeAmount') }}: {{ $t('balance.symbol')
|
|
|
+ }}{{ balance.rechargeAccumulation }}
|
|
|
+ </div>
|
|
|
+ <div class="desc">{{ $t('balance.credits') }}: {{ balance.credits }}</div>
|
|
|
<div class="input-wrapper">
|
|
|
<span class="sym">{{ $t('balance.symbol') }}</span>
|
|
|
<ion-input
|
|
|
@@ -111,7 +126,8 @@
|
|
|
v-html="
|
|
|
$t('balance.withdrawFeeTip', {
|
|
|
rate1: withdrawFeeLowRate * 100 + '%',
|
|
|
- rate2: withdrawFeeRate * 100 + '%'
|
|
|
+ rate2: withdrawFeeRate * 100 + '%',
|
|
|
+ factor: lowFeeFactor
|
|
|
})
|
|
|
"
|
|
|
></div>
|
|
|
@@ -151,7 +167,9 @@ export default {
|
|
|
return {
|
|
|
balance: {
|
|
|
balance: 0,
|
|
|
- feeFreeAllowances: 0
|
|
|
+ feeFreeAllowances: 0,
|
|
|
+ credits: 0,
|
|
|
+ rechargeAccumulation: 0
|
|
|
},
|
|
|
showRecharge: false,
|
|
|
rechargeAmount: 100,
|
|
|
@@ -160,6 +178,7 @@ export default {
|
|
|
showWithdrawModal: false,
|
|
|
withdrawFeeRate: 0.08,
|
|
|
withdrawFeeLowRate: 0.01,
|
|
|
+ lowFeeFactor: 50,
|
|
|
windowSize: useWindowSize(),
|
|
|
orderId: null,
|
|
|
interval: null,
|
|
|
@@ -168,12 +187,17 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getBalance()
|
|
|
- this.$http.get('/sysConfig/get/withdraw_fee_rate').then(res => {
|
|
|
- this.withdrawFeeRate = Number(res.value)
|
|
|
- })
|
|
|
- this.$http.get('/sysConfig/get/withdraw_fee_low_rate').then(res => {
|
|
|
- this.withdrawFeeLowRate = Number(res.value)
|
|
|
- })
|
|
|
+ this.$http
|
|
|
+ .post('/sysConfig/multipleGet', ['withdraw_fee_rate', 'withdraw_fee_low_rate', 'low_fee_factor'], {
|
|
|
+ body: 'json'
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.withdrawFeeRate = Number(res.find(item => item.name === 'withdraw_fee_rate')?.value || '0.08')
|
|
|
+ this.withdrawFeeLowRate = Number(
|
|
|
+ res.find(item => item.name === 'withdraw_fee_low_rate')?.value || '0.01'
|
|
|
+ )
|
|
|
+ this.lowFeeFactor = Number(res.find(item => item.name === 'low_fee_factor')?.value || '50')
|
|
|
+ })
|
|
|
},
|
|
|
ionViewDidEnter() {
|
|
|
Browser.addListener('browserFinished', () => {
|
|
|
@@ -195,13 +219,17 @@ export default {
|
|
|
realReceipt: '-'
|
|
|
}
|
|
|
}
|
|
|
- let fee
|
|
|
- if (amount <= this.balance.feeFreeAllowances) {
|
|
|
+ let feeRate, fee
|
|
|
+ if (
|
|
|
+ this.balance.rechargeAccumulation &&
|
|
|
+ this.balance.transactionVolume &&
|
|
|
+ this.balance.transactionVolume / this.balance.rechargeAccumulation >= this.lowFeeFactor
|
|
|
+ ) {
|
|
|
+ feeRate = this.withdrawFeeLowRate
|
|
|
fee = this.withdrawFeeLowRate * amount
|
|
|
} else {
|
|
|
- fee =
|
|
|
- this.withdrawFeeRate * (amount - this.balance.feeFreeAllowances) +
|
|
|
- this.withdrawFeeLowRate * this.balance.feeFreeAllowances
|
|
|
+ feeRate = this.withdrawFeeRate
|
|
|
+ fee = this.withdrawFeeRate * amount
|
|
|
}
|
|
|
return {
|
|
|
fee: fee.toFixed(2),
|
|
|
@@ -209,7 +237,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
breakpoint() {
|
|
|
- return Number((450 / this.windowSize.height).toFixed(2))
|
|
|
+ return Number((530 / this.windowSize.height).toFixed(2))
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -278,7 +306,7 @@ export default {
|
|
|
}
|
|
|
this.$toast.loading(this.$t('balance.withdrawing'))
|
|
|
this.$http
|
|
|
- .post('/withdrawApply/apply', { amount, separateFee: true })
|
|
|
+ .post('/withdrawApply/apply/v2', { amount, separateFee: true })
|
|
|
.then(res => {
|
|
|
this.$toast.dismiss()
|
|
|
this.getBalance()
|
|
|
@@ -343,25 +371,37 @@ export default {
|
|
|
height: 138px;
|
|
|
padding-top: 28px;
|
|
|
position: relative;
|
|
|
- .balance {
|
|
|
- font-size: 30px;
|
|
|
- font-weight: bold;
|
|
|
- color: @text-color;
|
|
|
- margin-left: 20px;
|
|
|
+ .info {
|
|
|
.f();
|
|
|
- align-items: baseline;
|
|
|
- .sym {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: normal;
|
|
|
- margin-right: 4px;
|
|
|
+ .col {
|
|
|
+ flex: 1 1 0;
|
|
|
+ padding: 0 20px;
|
|
|
+ &.right {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .num {
|
|
|
+ font-size: 26px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: @text-color;
|
|
|
+ line-height: 32px;
|
|
|
+ .sym {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: normal;
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+ &.credit {
|
|
|
+ font-size: 20px;
|
|
|
+ opacity: 0.8;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .label {
|
|
|
+ font-size: 14px;
|
|
|
+ color: fade(@text-color, 60);
|
|
|
+ margin-top: 4px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- .label {
|
|
|
- font-size: 14px;
|
|
|
- color: fade(@text-color, 60);
|
|
|
- margin-left: 20px;
|
|
|
- margin-top: 4px;
|
|
|
- }
|
|
|
+
|
|
|
.btn-record {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
@@ -571,6 +611,9 @@ ion-modal#modal-withdraw {
|
|
|
:deep(.rate2) {
|
|
|
color: #ff7f1f;
|
|
|
}
|
|
|
+ :deep(.factor) {
|
|
|
+ color: #ff7f1f;
|
|
|
+ }
|
|
|
}
|
|
|
.footer {
|
|
|
position: absolute;
|