|
|
|
@ -526,13 +526,20 @@ export default { |
|
|
|
return item.avail_position; |
|
|
|
}, |
|
|
|
activeStep_buy() { |
|
|
|
if (!this.form.amount_buy || !this.maxNum) return 0; |
|
|
|
let num = (this.form.amount_buy / this.maxNum) * 100; |
|
|
|
// console.log(this.form.amount_buy , this.maxNum ,'----------') |
|
|
|
// 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; |
|
|
|
return num; |
|
|
|
}, |
|
|
|
activeStep_sell() { |
|
|
|
if (!this.form.amount_sell || !this.maxNum) return 0; |
|
|
|
let num = (this.form.amount_sell / this.maxNum) * 100; |
|
|
|
// 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; |
|
|
|
return num; |
|
|
|
}, |
|
|
|
// 保证金 |
|
|
|
@ -542,7 +549,7 @@ export default { |
|
|
|
// }, |
|
|
|
amount_buy(){ |
|
|
|
console.info(this.form.lever_rate) |
|
|
|
console.info(this.margin_buy) |
|
|
|
console.info(this.margin_buy, '买入--保证金') |
|
|
|
if (!this.form.lever_rate || !this.margin_buy) return 0; |
|
|
|
let p=this.margin_buy*this.form.lever_rate; |
|
|
|
|
|
|
|
@ -605,14 +612,16 @@ export default { |
|
|
|
}, |
|
|
|
// 设置数量 |
|
|
|
sliderChange($ev, operate) { |
|
|
|
|
|
|
|
console.log($ev, '滑块滑起来了') |
|
|
|
if(operate=='sell'){ |
|
|
|
this.form.amount_sell = Math.round((this.maxNum * $ev) / 100)||''; |
|
|
|
console.info(this.form) |
|
|
|
// 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 |
|
|
|
}else if (operate == 'buy'){ |
|
|
|
this.form.amount_buy = Math.round((this.maxNum * $ev) / 100)||''; |
|
|
|
console.info(this.form) |
|
|
|
// 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 |
|
|
|
} |
|
|
|
}, |
|
|
|
|