|
|
|
@ -88,16 +88,16 @@ |
|
|
|
</div> |
|
|
|
<div class="input-group mb-4 input-group-sm"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<span class="input-group-text">{{ $t("contract.e1") }}</span> |
|
|
|
<!-- <span class="input-group-text">{{ $t("contract.l2") }}</span> --> |
|
|
|
<!-- <span class="input-group-text">{{ $t("contract.e1") }}</span> --> |
|
|
|
<span class="input-group-text">{{ $t("contract.l2") }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- v-model="form.amount" --> |
|
|
|
<!-- :placeholder="tips" --> |
|
|
|
<input |
|
|
|
type="number" |
|
|
|
v-model="form.amount" |
|
|
|
class="form-control" |
|
|
|
:placeholder="tips" |
|
|
|
type="number" |
|
|
|
v-model="margin" |
|
|
|
class="form-control" |
|
|
|
placeholder="USDT" |
|
|
|
/> |
|
|
|
<!-- <div class="input-group-append"> |
|
|
|
<span class="input-group-text">{{ $t("contract.e2") }}</span> |
|
|
|
@ -229,8 +229,8 @@ export default { |
|
|
|
25:'', |
|
|
|
50:'', |
|
|
|
75:'' |
|
|
|
} |
|
|
|
// margin:"", |
|
|
|
}, |
|
|
|
margin:0, |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: { |
|
|
|
@ -330,19 +330,19 @@ export default { |
|
|
|
return num; |
|
|
|
}, |
|
|
|
// 保证金 |
|
|
|
margin() { |
|
|
|
if (!this.form.lever_rate) return ''; |
|
|
|
return math.omitTo(this.form.amount*this.unit_amount / this.form.lever_rate, 4); |
|
|
|
}, |
|
|
|
// amount(){ |
|
|
|
// console.info(this.form.lever_rate) |
|
|
|
// console.info(this.margin) |
|
|
|
// if (!this.form.lever_rate || !this.margin) return 0; |
|
|
|
// let p=this.margin*this.form.lever_rate; |
|
|
|
// margin() { |
|
|
|
// if (!this.form.lever_rate) return ''; |
|
|
|
// return math.omitTo(this.form.amount*this.unit_amount / this.form.lever_rate, 4); |
|
|
|
// }, |
|
|
|
amount(){ |
|
|
|
console.info(this.form.lever_rate) |
|
|
|
console.info(this.margin) |
|
|
|
if (!this.form.lever_rate || !this.margin) return 0; |
|
|
|
let p=this.margin*this.form.lever_rate; |
|
|
|
|
|
|
|
// this.form.amount=p; |
|
|
|
// return p |
|
|
|
// } |
|
|
|
this.form.amount=p; |
|
|
|
return p |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取合约账户信息 |
|
|
|
@ -390,8 +390,9 @@ export default { |
|
|
|
}, |
|
|
|
// 设置数量 |
|
|
|
sliderChange($ev) { |
|
|
|
this.form.amount = Math.round((this.maxNum * $ev) / 100)||''; |
|
|
|
// this.margin=this.form.amount/this.form.lever_rate |
|
|
|
this.form.amount = Math.round((this.maxNum * $ev) / 100)||''; |
|
|
|
console.info(this.form) |
|
|
|
this.margin=this.form.amount/this.form.lever_rate || 0 |
|
|
|
}, |
|
|
|
// 选择杠杆 |
|
|
|
selectLever(idx) { |
|
|
|
|