|
|
|
@ -101,6 +101,7 @@ |
|
|
|
class="form-control" |
|
|
|
v-model="marginBuy" |
|
|
|
:placeholder="tips" |
|
|
|
@input="inputEnter(false)" |
|
|
|
title="" |
|
|
|
/> |
|
|
|
<!-- <div class="input-group-append"> |
|
|
|
@ -229,6 +230,7 @@ |
|
|
|
class="form-control" |
|
|
|
v-model="marginSell" |
|
|
|
:placeholder="tips" |
|
|
|
@input="inputEnter(true)" |
|
|
|
title="" |
|
|
|
/> |
|
|
|
<!-- <div class="input-group-append"> |
|
|
|
@ -254,7 +256,8 @@ |
|
|
|
<div v-if="tab == 1" class="kaicang"> |
|
|
|
<div class="d-flex justify-content-between mb-3"> |
|
|
|
<div class="color_7c">{{ $t("contract.e7") }} </div> |
|
|
|
<div>{{ accountInfo.openNum }}</div> |
|
|
|
<!-- <div>{{ accountInfo.openNum }}</div> --> |
|
|
|
<div>{{ maxNum }}</div> |
|
|
|
</div> |
|
|
|
<div class="d-flex justify-content-between mb-3"> |
|
|
|
<div class="color_7c">{{ $t("contract.e1") }}</div> |
|
|
|
@ -518,7 +521,7 @@ export default { |
|
|
|
// console.info(this.form.lever_rate) |
|
|
|
// console.info(this.margin) |
|
|
|
if (!this.form.lever_rate || !this.marginBuy) return 0; |
|
|
|
let p=this.marginBuy*this.form.lever_rate; |
|
|
|
let p = Math.round(this.marginBuy*this.form.lever_rate); |
|
|
|
|
|
|
|
this.buyform.amount=p; |
|
|
|
return p |
|
|
|
@ -527,13 +530,24 @@ export default { |
|
|
|
// console.info(this.form.lever_rate) |
|
|
|
// console.info(this.margin) |
|
|
|
if (!this.form.lever_rate || !this.marginSell) return 0; |
|
|
|
let p=this.marginSell*this.form.lever_rate; |
|
|
|
let p = Math.round(this.marginSell*this.form.lever_rate); |
|
|
|
|
|
|
|
this.sellform.amount=p; |
|
|
|
return p |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
inputEnter(boll) { |
|
|
|
if(boll){ |
|
|
|
this.marginSell = this.marginSell |
|
|
|
.replace(/[^\d.]/g, "") // 移除非数字、非小数点的字符 |
|
|
|
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); // 限制最多两位小数 |
|
|
|
}else{ |
|
|
|
this.marginBuy = this.marginBuy |
|
|
|
.replace(/[^\d.]/g, "") // 移除非数字、非小数点的字符 |
|
|
|
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); // 限制最多两位小数 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取合约账户信息 |
|
|
|
contractAccount(boo) { |
|
|
|
if (!this.isLogin) return; |
|
|
|
@ -548,7 +562,7 @@ export default { |
|
|
|
// if (!this.form.lever_rate) { |
|
|
|
// this.form.lever_rate = res.lever_rate; |
|
|
|
// } |
|
|
|
if (this.form.lever_rate && !boo) { |
|
|
|
if (this.form.lever_rate) { |
|
|
|
this.openNum(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|