From bb4bf63aed5e87e23052a3c060dd7fa294a070ed Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Fri, 20 Jun 2025 15:30:27 +0800
Subject: [PATCH] bug: 偶尔出现不显示数量

---
 src/components/constract/PerpetualContract/orderCom/amountSlider.vue |   85 +++++++++++++++++++++---------------------
 1 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/src/components/constract/PerpetualContract/orderCom/amountSlider.vue b/src/components/constract/PerpetualContract/orderCom/amountSlider.vue
index 97b5b7e..506e359 100644
--- a/src/components/constract/PerpetualContract/orderCom/amountSlider.vue
+++ b/src/components/constract/PerpetualContract/orderCom/amountSlider.vue
@@ -12,7 +12,6 @@
         v-model="amount"
         step-strictly="true"
         :min="0"
-        :max="maxAmount"
         @change="inputChange"
       />
 
@@ -157,50 +156,52 @@
     //滑块事件
     sliderAmountChange(val) {
       let data;
-      if (this.maxAmount) {
-        // if (val == 0) {
-        //   this.amount = undefined;
-        // } else {
+      console.log(val, "sliderAmountChange");
 
-        const rate = val / 100; //如0.25
-        let sxf = 0;
-        switch (Number(this.lever_rate)) {
-          case 25:
-            sxf = 0.0375;
-            break;
-          case 50:
-            sxf = 0.075;
-            break;
-          case 100:
-            sxf = 0.15;
-            break;
-          case 200:
-            sxf = 0.3;
-            break;
-          default:
-            sxf = 0;
-        }
-        // const fl =
-        // this.walletMoney * sxf * this.initOpen.amount * this.lever_rate * rate;
-        // const maxAmount =
-        // this.walletMoney * this.initOpen.amount * this.lever_rate;
-        const maxAmount =
-          Math.floor(this.walletMoney / (1 + sxf)) * this.lever_rate;
-        const fl = maxAmount * sxf;
-        console.log(maxAmount * rate, fl);
+      // if (val) {
+      // if (val == 0) {
+      //   this.amount = undefined;
+      // } else {
 
-        // data = maxAmount * rate - fl;
-        data = maxAmount;
-
-        // if (this.lever_rate) {
-        //   data = math.format((this.maxAmount * rate), 2);
-        // } else {
-        //   data = math.format((this.maxAmount * rate) / 1, 2);
-        // }
-        this.amount = parseInt(data);
-        // }
-        this.$emit("getAmount", this.amount);
+      const rate = val / 100; //如0.25
+      let sxf = 0;
+      switch (Number(this.lever_rate)) {
+        case 25:
+          sxf = 0.0375;
+          break;
+        case 50:
+          sxf = 0.075;
+          break;
+        case 100:
+          sxf = 0.15;
+          break;
+        case 200:
+          sxf = 0.3;
+          break;
+        default:
+          sxf = 0;
       }
+      // const fl =
+      // this.walletMoney * sxf * this.initOpen.amount * this.lever_rate * rate;
+      // const maxAmount =
+      // this.walletMoney * this.initOpen.amount * this.lever_rate;
+      const maxAmount =
+        Math.floor((this.walletMoney / (1 + sxf)) * rate) * this.lever_rate;
+      // const fl = maxAmount * sxf;
+      console.log(maxAmount * rate);
+
+      // data = maxAmount * rate - fl;
+      data = maxAmount;
+      // this.maxAmount = maxAmount;
+      // if (this.lever_rate) {
+      //   data = math.format((this.maxAmount * rate), 2);
+      // } else {
+      //   data = math.format((this.maxAmount * rate) / 1, 2);
+      // }
+      this.amount = data;
+      // }
+      this.$emit("getAmount", this.amount);
+      // }
     },
     emptyValue() {
       this.sliderAmount = 0;

--
Gitblit v1.9.3