diff --git a/pages/base/mine.vue b/pages/base/mine.vue
index c19f201..100a248 100644
--- a/pages/base/mine.vue
+++ b/pages/base/mine.vue
@@ -40,8 +40,10 @@
-->
- {{filterMoney(account.total_assets_btc, true)}}
- ≈{{ filterMoney(account.total_assets_usd, false) }} USDT
+
+ {{price1(account.total_assets_btc, 8)}}
+ ≈ ${{ price1(account.total_assets_usd, 2) }}
@@ -187,7 +189,8 @@
- ≈{{ omitTo(account.funds_account_usd,2) }}
+
+ ≈{{ price1(account.funds_account_usd,2) }}
{{ $t("base.d6") }}(USDT)
@@ -298,7 +301,8 @@
- {{ filterMoney(account.contract_account_usd)}}{{ account.symbol }}
+
+ {{ price1(account.contract_account_usd,2)}}{{ account.symbol }}
@@ -420,6 +424,14 @@ export default {
}
},
methods: {
+ price1(item,index){
+ if (item) {
+ let price = item.toFixed(index).toString();
+ let parts = price.split(".");
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+ return parts.join(".");
+ }
+ },
tohome(){
this._router.push("/pages/base/index");
// this.tabChange('home')
diff --git a/pages/exchange/open-position.vue b/pages/exchange/open-position.vue
index 7b5ad8a..f02ad9c 100644
--- a/pages/exchange/open-position.vue
+++ b/pages/exchange/open-position.vue
@@ -173,7 +173,7 @@
-->
@@ -183,6 +183,13 @@
+
@@ -1074,7 +1081,7 @@ export default {
watch: {
maxNum(n) {
this.form.amount = Math.round((this.maxNum * this.sliderActive1) / 100);
- this.margin = (this.form.amount / this.form.lever_rate).toFixed(5)
+ this.margin = (this.form.amount / this.form.lever_rate).toFixed(2)
},
symbol() {
this.$emit("symbols", this.symbol)
@@ -1151,6 +1158,14 @@ export default {
}
},
methods: {
+ inputEnter(e){
+ this.$nextTick(()=> {
+ this.margin = e
+ .replace(/[^\d.]/g, "") // 移除非数字、非小数点的字符
+ .replace(/^(\d*\.?\d{0,2}).*$/, "$1"); // 限制最多两位小数
+ this.sliderActive=-1
+ })
+ },
onRefresh() {
if (this.refreshing) return;
this.refreshing = true;
@@ -1574,7 +1589,7 @@ export default {
this.form.amount = Math.round((this.maxNum * n) / 100);
this.sliderActive = i
this.sliderActive1 = n
- this.margin = (this.form.amount / this.form.lever_rate).toFixed(5)
+ this.margin = (this.form.amount / this.form.lever_rate).toFixed(2)
},
pingChange(n, i) {
// console.log(n)