From 198ddcef9ac5e9c6ba15b7a4f4403019c265f68e Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Thu, 19 Jun 2025 17:46:27 +0800
Subject: [PATCH] 修改先取整在计算

---
 src/components/constract/PerpetualContract/orderCom/amountSlider.vue |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/components/constract/PerpetualContract/orderCom/amountSlider.vue b/src/components/constract/PerpetualContract/orderCom/amountSlider.vue
index 46a622a..97b5b7e 100644
--- a/src/components/constract/PerpetualContract/orderCom/amountSlider.vue
+++ b/src/components/constract/PerpetualContract/orderCom/amountSlider.vue
@@ -180,13 +180,17 @@
           default:
             sxf = 0;
         }
-        const fl =
-          this.walletMoney * sxf * this.initOpen.amount * this.lever_rate * rate;
+        // const fl =
+        // this.walletMoney * sxf * this.initOpen.amount * this.lever_rate * rate;
+        // const maxAmount =
+        // this.walletMoney * this.initOpen.amount * this.lever_rate;
         const maxAmount =
-          this.walletMoney * this.initOpen.amount * this.lever_rate;
+          Math.floor(this.walletMoney / (1 + sxf)) * this.lever_rate;
+        const fl = maxAmount * sxf;
         console.log(maxAmount * rate, fl);
 
-        data = maxAmount * rate - fl;
+        // data = maxAmount * rate - fl;
+        data = maxAmount;
 
         // if (this.lever_rate) {
         //   data = math.format((this.maxAmount * rate), 2);

--
Gitblit v1.9.3