5.10航天ui交易所pc端,代码jiem-pc
lxf
2025-06-05 8f9e4fbc244af9e91f69f8b2851f4068abe7e600
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"
@@ -377,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;
@@ -400,6 +418,7 @@
    // 获取张数,数据转换
    getVolumnByLever() {
      let amount = this.initOpen.volume;
      console.log("amount: ", amount);
      if (this.isActive == 1) {
        amount = Math.max(this.closeSellAmount, this.closeBuyAmount);
      }
@@ -439,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();
        }
      }
    },
@@ -489,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";
            }
          }
@@ -635,4 +656,16 @@
  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>