Browse Source

修改合约保证金只能输入2位小数点

master
liaoxinyu 1 year ago
parent
commit
9427df4fcf
  1. 9
      pages/base/mine.vue
  2. 12
      pages/exchange/open-position.vue

9
pages/base/mine.vue

@ -40,8 +40,9 @@
</text> </text>
</view> --> </view> -->
<view class=""> <view class="">
<view class="text_figure col-fff">{{filterMoney(account.total_assets_btc, true)}}</view> <!-- <view class="text_figure col-fff">{{filterMoney(account.total_assets_btc, true)}}</view> -->
<!-- <view style="color: #6FB58A;"> ${{ filterMoney(account.total_assets_usd, false) }} USDT</view> --> <!-- <view style="color: #6FB58A;"> ${{ filterMoney(account.total_assets_usd, false) }} USDT</view> -->
<view class="text_figure col-fff">{{ price1(account.total_assets_btc, 8) }}</view>
<view style="color: #6FB58A;"> ${{ price1(account.total_assets_usd, 2) }}</view> <view style="color: #6FB58A;"> ${{ price1(account.total_assets_usd, 2) }}</view>
</view> </view>
@ -188,7 +189,8 @@
<text class="fn-20 d-block color-light m-t-xs"> <text class="fn-20 d-block color-light m-t-xs">
<!-- {{ filterMoney(account.funds_account_usd) }} --> <!-- {{ filterMoney(account.funds_account_usd) }} -->
<!-- {{ (account.funds_account_usd).toFixed(2) }} --> <!-- {{ (account.funds_account_usd).toFixed(2) }} -->
{{ omitTo(account.funds_account_usd,2) }} <!-- {{ omitTo(account.funds_account_usd,2) }} -->
{{ price1(account.funds_account_usd,2) }}
</text> </text>
<text class="fn-sm d-block color-gray-6 m-t-xs">{{ $t("base.d6") }}(USDT)</text> <text class="fn-sm d-block color-gray-6 m-t-xs">{{ $t("base.d6") }}(USDT)</text>
@ -299,7 +301,8 @@
</v-link> </v-link>
</view> </view>
<span class="fn-20 d-block color-light" style="margin-top: 100rpx;"> <span class="fn-20 d-block color-light" style="margin-top: 100rpx;">
{{ filterMoney(account.contract_account_usd)}}{{ account.symbol }} <!-- {{ filterMoney(account.contract_account_usd)}}{{ account.symbol }} -->
{{ price1(account.contract_account_usd,2)}}{{ account.symbol }}
</span> </span>
<view class="d-flex justify-between m-t-xs"> <view class="d-flex justify-between m-t-xs">
<v-link to="/pages/transfer/index" class="d-flex"> <v-link to="/pages/transfer/index" class="d-flex">

12
pages/exchange/open-position.vue

@ -173,12 +173,12 @@
</v-input> --> </v-input> -->
<v-input <v-input
v-model="margin" v-model="margin"
@input="sliderActive=-1" @input="inputEnter"
:placeholder="$t('exchange.c5')" style="border: 1px solid #202020;"> :placeholder="$t('exchange.c5')" style="border: 1px solid #202020;">
<template #right> <template #right>
<view class="color-light fn-bold" style="margin-right: 10px;"> <view class="color-light fn-bold" style="margin-right: 10px;">
{{ $t("contract.d8") }} {{ $t("contract.d8") }}
<!-- {{symbol.split('/')[0]}} --> {{symbol.split('/')[0]}}
<i class="iconfont m-l-xs fn-sm">&#xe6e9;</i> <i class="iconfont m-l-xs fn-sm">&#xe6e9;</i>
</view> </view>
</template> </template>
@ -1151,6 +1151,14 @@ export default {
} }
}, },
methods: { methods: {
inputEnter(e){
this.$nextTick(()=> {
this.margin = e
.replace(/[^\d.]/g, "") //
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); //
this.sliderActive=-1
})
},
onRefresh() { onRefresh() {
if (this.refreshing) return; if (this.refreshing) return;
this.refreshing = true; this.refreshing = true;

Loading…
Cancel
Save