|
|
|
@ -125,8 +125,8 @@ |
|
|
|
v-model="form.amount" --> |
|
|
|
<v-input |
|
|
|
v-model="margin" |
|
|
|
:placeholder="$t('contract.d2')" |
|
|
|
@input="sliderActive=-1" |
|
|
|
:placeholder="$t('contract.d2')" |
|
|
|
@input="inputEnter" |
|
|
|
class="h-30 p-x-sm p-y-xxs rounded bg-form-panel-3" |
|
|
|
> |
|
|
|
<template #right> |
|
|
|
@ -887,7 +887,7 @@ export default { |
|
|
|
}, |
|
|
|
maxNum(n){ |
|
|
|
this.form.amount = Math.round((this.maxNum * this.sliderActive1) / 100); |
|
|
|
this.margin=(this.form.amount/this.form.lever_rate) |
|
|
|
this.margin=(this.form.amount/this.form.lever_rate).toFixed(2) |
|
|
|
}, |
|
|
|
symbol() { |
|
|
|
this.$emit("symbols",this.symbol) |
|
|
|
@ -966,6 +966,14 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
inputEnter(e){ |
|
|
|
this.$nextTick(()=> { |
|
|
|
this.margin = e |
|
|
|
.replace(/[^\d.]/g, "") // 移除非数字、非小数点的字符 |
|
|
|
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); // 限制最多两位小数 |
|
|
|
this.sliderActive=-1 |
|
|
|
}) |
|
|
|
}, |
|
|
|
onRefresh(){ |
|
|
|
location.reload() |
|
|
|
if (this.refreshing) return; |
|
|
|
@ -1391,7 +1399,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) |
|
|
|
this.margin=(this.form.amount/this.form.lever_rate).toFixed(2) |
|
|
|
}, |
|
|
|
pingChange(n,i) { |
|
|
|
console.log(n) |
|
|
|
|