From fc4ede4a680576450a044fee08de9f1835894947 Mon Sep 17 00:00:00 2001
From: ltlzx <942659938@qq.com>
Date: Sat, 5 Mar 2022 22:00:19 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/exchange/open-position.vue | 46 +++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/pages/exchange/open-position.vue b/pages/exchange/open-position.vue
index 19f8bdb..1c9ca56 100755
--- a/pages/exchange/open-position.vue
+++ b/pages/exchange/open-position.vue
@@ -115,14 +115,19 @@
>
-
+
- {{ $t("contract.d8") }}
+
+
+ USDT
+
@@ -245,15 +250,18 @@
{{ $t("common.c3") }}
- {{ maxNum }}{{ $t("contract.d8") }}
+ {{ maxNum }}
+
- {{ $t("common.c4") }}
+
+ {{ $t('contract.d2') }}
- {{ margin }} USDT
+
+ {{amount}}
@@ -729,6 +737,7 @@ export default {
},
data() {
return {
+ margin:'',
sellList: [],
buyList: [],
tradeList: [],
@@ -812,12 +821,21 @@ export default {
// return this.commissionTypes.find((item) => this.form.type == item.value);
// },
// 保证金
- margin() {
- return math.omitTo(
- (this.form.amount * this.unit_amount) / this.form.lever_rate,
- 0
- );
- },
+ // margin() {
+ // return math.omitTo(
+ // (this.form.amount * this.unit_amount) / this.form.lever_rate,
+ // 0
+ // );
+ // },
+ amount(){
+ console.info(this.form.lever_rate)
+ console.info(this.margin)
+ if (!this.form.lever_rate || !this.margin) return 0;
+ let p=this.margin*this.form.lever_rate;
+
+ this.form.amount=p;
+ return p
+ },
// 所占百分比
activeStep() {
return (this.form.amount / this.maxNum) * 100;
@@ -1317,6 +1335,8 @@ export default {
sliderChange(n,i) {
this.form.amount = Math.round((this.maxNum * n) / 100);
this.sliderActive=i
+
+ this.margin=this.form.amount/this.form.lever_rate
},
pingChange(n,i) {
console.log(n)