|
|
|
@ -531,16 +531,16 @@ export default { |
|
|
|
// if (!this.form.amount_buy || !this.maxNum) return 0; |
|
|
|
// let num = (this.form.amount_buy / this.maxNum) * 100; |
|
|
|
// return num; |
|
|
|
if (!this.form.amount_buy || !this.accountInfo.usable_balance) return 0; |
|
|
|
let num = (this.form.amount_buy / this.accountInfo.usable_balance) * 100; |
|
|
|
if (!this.form.amount_buy || !this.accountInfo.account_equity) return 0; |
|
|
|
let num = (this.form.amount_buy / this.accountInfo.account_equity) * 100; |
|
|
|
return num; |
|
|
|
}, |
|
|
|
activeStep_sell() { |
|
|
|
// if (!this.form.amount_sell || !this.maxNum) return 0; |
|
|
|
// let num = (this.form.amount_sell / this.maxNum) * 100; |
|
|
|
// return num; |
|
|
|
if (!this.form.amount_sell || !this.accountInfo.usable_balance) return 0; |
|
|
|
let num = (this.form.amount_sell / this.accountInfo.usable_balance) * 100; |
|
|
|
if (!this.form.amount_sell || !this.accountInfo.account_equity) return 0; |
|
|
|
let num = (this.form.amount_sell / this.accountInfo.account_equity) * 100; |
|
|
|
return num; |
|
|
|
}, |
|
|
|
// 保证金 |
|
|
|
@ -552,7 +552,8 @@ export default { |
|
|
|
console.info(this.form.lever_rate) |
|
|
|
console.info(this.margin_buy, '买入--保证金') |
|
|
|
if (!this.form.lever_rate || !this.margin_buy) return 0; |
|
|
|
let p=this.margin_buy*this.form.lever_rate; |
|
|
|
// let p=this.margin_buy*this.form.lever_rate; |
|
|
|
let p=this.margin_buy; |
|
|
|
|
|
|
|
this.form.amount_buy=p; |
|
|
|
return p |
|
|
|
@ -561,7 +562,8 @@ export default { |
|
|
|
console.info(this.form.lever_rate) |
|
|
|
console.info(this.margin_sell) |
|
|
|
if (!this.form.lever_rate || !this.margin_sell) return 0; |
|
|
|
let p=this.margin_sell*this.form.lever_rate; |
|
|
|
// let p=this.margin_sell*this.form.lever_rate; |
|
|
|
let p=this.margin_sell; |
|
|
|
|
|
|
|
this.form.amount_sell=p; |
|
|
|
return p |
|
|
|
@ -616,14 +618,22 @@ export default { |
|
|
|
console.log($ev, '滑块滑起来了') |
|
|
|
if(operate=='sell'){ |
|
|
|
// this.form.amount_sell = Math.round((this.maxNum * $ev) / 100)||''; |
|
|
|
this.form.amount_sell = Math.round((this.accountInfo.usable_balance * $ev) / 100)||''; |
|
|
|
// console.info(this.form) |
|
|
|
this.margin_sell=this.form.amount_sell/this.form.lever_rate || 0 |
|
|
|
if($ev!==100){ |
|
|
|
this.form.amount_sell = Math.round((this.accountInfo.account_equity * $ev) / 100)||''; |
|
|
|
}else{ |
|
|
|
this.form.amount_sell = ((this.accountInfo.account_equity * $ev) / 100)||''; |
|
|
|
} |
|
|
|
// this.margin_sell=this.form.amount_sell/this.form.lever_rate || 0 |
|
|
|
this.margin_sell=this.form.amount_sell || 0 |
|
|
|
}else if (operate == 'buy'){ |
|
|
|
// this.form.amount_buy = Math.round((this.maxNum * $ev) / 100)||''; |
|
|
|
this.form.amount_buy = Math.round((this.accountInfo.usable_balance * $ev) / 100)||''; |
|
|
|
// console.info(this.form) |
|
|
|
this.margin_buy=this.form.amount_buy/this.form.lever_rate || 0 |
|
|
|
if($ev!==100){ |
|
|
|
this.form.amount_buy = Math.round((this.accountInfo.account_equity * $ev) / 100)||''; |
|
|
|
}else{ |
|
|
|
this.form.amount_buy = ((this.accountInfo.account_equity * $ev) / 100)||''; |
|
|
|
} |
|
|
|
// this.margin_buy=this.form.amount_buy/this.form.lever_rate || 0 |
|
|
|
this.margin_buy=this.form.amount_buy || 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 选择杠杆 |
|
|
|
|