|
|
@ -134,7 +134,7 @@ |
|
|
<v-input |
|
|
<v-input |
|
|
v-model="margin" |
|
|
v-model="margin" |
|
|
:placeholder="$t('contract.d2')" |
|
|
:placeholder="$t('contract.d2')" |
|
|
@input="sliderActive=-1" |
|
|
@input="inputEnter" |
|
|
class="h-30 p-x-sm p-y-xxs rounded bg-form-panel-3" |
|
|
class="h-30 p-x-sm p-y-xxs rounded bg-form-panel-3" |
|
|
> |
|
|
> |
|
|
<template #right> |
|
|
<template #right> |
|
|
@ -927,7 +927,7 @@ export default { |
|
|
watch: { |
|
|
watch: { |
|
|
maxNum(n) { |
|
|
maxNum(n) { |
|
|
this.form.amount = Math.round((this.maxNum * this.sliderActive1) / 100); |
|
|
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() { |
|
|
symbol() { |
|
|
this.$emit("symbols", this.symbol) |
|
|
this.$emit("symbols", this.symbol) |
|
|
@ -1005,6 +1005,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; |
|
|
@ -1426,7 +1434,7 @@ export default { |
|
|
this.form.amount = Math.round((this.maxNum * n) / 100); |
|
|
this.form.amount = Math.round((this.maxNum * n) / 100); |
|
|
this.sliderActive = i |
|
|
this.sliderActive = i |
|
|
this.sliderActive1 = n |
|
|
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) { |
|
|
pingChange(n, i) { |
|
|
// console.log(n) |
|
|
// console.log(n) |
|
|
|