Browse Source

合并

master
luyisha 3 years ago
parent
commit
edcac17342
  1. 42
      src/views/contract/exchange-store.vue

42
src/views/contract/exchange-store.vue

@ -94,7 +94,6 @@
<div style="width:47%;">
<div class="usable-box-A">
<span>{{ $t("contract.a3") }}</span>
<!-- accountInfo.account_equity 账户权益accountInfo.usable_balance 可用 -->
<span style="color: #444;"> {{ accountInfo.usable_balance }} USDT
<i
class="el-icon-sort"
@ -527,20 +526,13 @@ export default {
return item.avail_position;
},
activeStep_buy() {
// 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.account_equity) return 0;
let num = (this.form.amount_buy / this.accountInfo.account_equity) * 100;
if (!this.form.amount_buy || !this.maxNum) return 0;
let num = (this.form.amount_buy / this.maxNum) * 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.account_equity) return 0;
let num = (this.form.amount_sell / this.accountInfo.account_equity) * 100;
if (!this.form.amount_sell || !this.maxNum) return 0;
let num = (this.form.amount_sell / this.maxNum) * 100;
return num;
},
//
@ -550,7 +542,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;
let p=this.margin_buy;
@ -615,25 +607,15 @@ export default {
},
//
sliderChange($ev, operate) {
console.log($ev, '滑块滑起来了')
if(operate=='sell'){
// this.form.amount_sell = Math.round((this.maxNum * $ev) / 100)||'';
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
this.form.amount_sell = Math.round((this.maxNum * $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)||'';
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
this.form.amount_buy = Math.round((this.maxNum * $ev) / 100)||'';
console.info(this.form)
this.margin_buy=this.form.amount_buy/this.form.lever_rate || 0
}
},
//

Loading…
Cancel
Save