From a51ae716cb1eb8e21fc4a5c355d3cdbe02b27d7f Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 04 Jun 2025 18:38:25 +0800
Subject: [PATCH] style

---
 src/components/constract/PerpetualContract/createOrder.vue |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/components/constract/PerpetualContract/createOrder.vue b/src/components/constract/PerpetualContract/createOrder.vue
index 82f4a19..093a8a8 100644
--- a/src/components/constract/PerpetualContract/createOrder.vue
+++ b/src/components/constract/PerpetualContract/createOrder.vue
@@ -39,8 +39,8 @@
       >
         <el-tab-pane :label="$t('message.home.xianjia')" name="limit">
         </el-tab-pane>
-        <el-tab-pane :label="$t('message.home.shijia')" name="opponent">
-        </el-tab-pane>
+        <!-- <el-tab-pane :label="$t('message.home.shijia')" name="opponent">
+        </el-tab-pane> -->
       </el-tabs>
       <!-- 下单 -->
       <div class="place-order-form-box">
@@ -115,7 +115,7 @@
               </div>
             </div>
             <!-- 做空 -->
-            <div class="btn-wrapper">
+            <div class="btn-wrapper" v-show="isActive == 1">
               <div class="submit-btn-box">
                 <button
                   side="sell"
@@ -317,10 +317,18 @@
     getMargin: function () {
       const amount = this.inputAmount;
       let data = "0.00";
+      console.log(
+        "getMargin",
+        this.isActive,
+        amount,
+        this.lever_rate,
+        this.sessionObj.amount,
+        this.current_lever_rate_num
+      );
       if (
         this.isActive === 0 &&
-        amount != undefined &&
-        this.lever_rate.length != undefined &&
+        amount !== undefined &&
+        this.lever_rate.length !== undefined &&
         this.sessionObj.amount
       ) {
         if (this.lever_rate.length > 0) {
@@ -392,6 +400,7 @@
     // 获取张数,数据转换
     getVolumnByLever() {
       let amount = this.initOpen.volume;
+      console.log("amount: ", amount);
       if (this.isActive == 1) {
         amount = Math.max(this.closeSellAmount, this.closeBuyAmount);
       }
@@ -431,11 +440,11 @@
           return;
         }
         if (this.isActive === 0) {
-          // 开仓弹窗
-          this.$refs.openDialog.open();
+          // 开仓弹窗 不弹出直接确认
+          this.$refs.openDialog.handleSubmit();
         } else {
           // 平仓弹窗
-          this.$refs.closeDialog.open();
+          this.$refs.closeDialog.handleSubmit();
         }
       }
     },
@@ -481,9 +490,11 @@
               });
             }
             if (!this.current_lever_rate) {
-              this.current_lever_rate = hasLever ? this.lever_rate[0] : "1.00X";
+              this.current_lever_rate = hasLever
+                ? this.lever_rate[this.lever_rate.length - 1]
+                : "1.00X";
               this.current_lever_rate_num = hasLever
-                ? this.origin_lever[0]
+                ? this.origin_lever[this.lever_rate.length - 1]
                 : "1";
             }
           }

--
Gitblit v1.9.3