From 8f9e4fbc244af9e91f69f8b2851f4068abe7e600 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Thu, 05 Jun 2025 15:17:24 +0800
Subject: [PATCH] style

---
 src/components/constract/PerpetualContract/createOrder.vue |   67 +++++++++++++++++++++++++++------
 1 files changed, 54 insertions(+), 13 deletions(-)

diff --git a/src/components/constract/PerpetualContract/createOrder.vue b/src/components/constract/PerpetualContract/createOrder.vue
index 39a610c..a70dba0 100644
--- a/src/components/constract/PerpetualContract/createOrder.vue
+++ b/src/components/constract/PerpetualContract/createOrder.vue
@@ -25,10 +25,23 @@
                 : 'not-allowed',
           }"
         >
-          <div @click="openLeverDialog">
+          <!-- <div @click="openLeverDialog">
             <span> {{ current_lever_rate }}</span
             ><i class="icon iconfont icon-Mul_triangle lever-icon"></i>
-          </div>
+          </div> -->
+          <!-- 替换弹窗为下拉选择 -->
+          <el-select
+            v-model="current_lever_rate_num"
+            @change="changeLeverSelect"
+          >
+            <el-option
+              v-for="item in [25, 50, 100, 200]"
+              :key="item"
+              :value="item"
+            >
+              {{ item }}X
+            </el-option>
+          </el-select>
         </div>
       </div>
       <!-- 限价+市价 -->
@@ -39,8 +52,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 +128,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 +330,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) {
@@ -369,6 +390,11 @@
     },
   },
   methods: {
+    changeLeverSelect(e) {
+      const newLever = Number(this.current_lever_rate_num);
+      this.current_lever_rate = `${newLever}.00X`;
+      this.current_lever_rate_num = newLever;
+    },
     //获取张数
     getAmount(val) {
       this.inputAmount = val;
@@ -392,6 +418,7 @@
     // 获取张数,数据转换
     getVolumnByLever() {
       let amount = this.initOpen.volume;
+      console.log("amount: ", amount);
       if (this.isActive == 1) {
         amount = Math.max(this.closeSellAmount, this.closeBuyAmount);
       }
@@ -431,11 +458,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 +508,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";
             }
           }
@@ -621,10 +650,22 @@
   color: #fff;
 }
 .noLogin div:nth-child(1) {
-  background: #1d91ff;
+  background: #f7b328;
 }
 .noLogin div:nth-child(2) {
   background: #484d56;
   margin-top: 20px;
 }
+
+::v-deep .el-select__wrapper {
+  background: #303133;
+  box-shadow: 0 0 0 1px #303133 inset;
+}
+::v-deep .el-select__placeholder {
+  color: #fff !important;
+}
+
+::v-deep .el-select-dropdown__item.is-selected {
+  color: #f7b328 !important;
+}
 </style>

--
Gitblit v1.9.3