From 001ca5fe290213003902a30c07cc42887a7e9b8c Mon Sep 17 00:00:00 2001 From: luyisha Date: Thu, 15 Jun 2023 18:15:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E7=BA=A6=E6=9D=A0=E6=9D=86=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=BF=9D=E8=AF=81=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/exchange-store.vue | 29 ++++++++++++++++++--------- src/views/setting/index.vue | 7 ++++--- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/views/contract/exchange-store.vue b/src/views/contract/exchange-store.vue index 8adfc32..bfbf414 100644 --- a/src/views/contract/exchange-store.vue +++ b/src/views/contract/exchange-store.vue @@ -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 } }, diff --git a/src/views/setting/index.vue b/src/views/setting/index.vue index 3a386a1..8098683 100644 --- a/src/views/setting/index.vue +++ b/src/views/setting/index.vue @@ -8,9 +8,10 @@
-
{{$t('setting.loginPassword')}}
-
-
{{$t('setting.loginPassword')}}
+ +
+