1
李凌
2025-10-23 7907f9a7d414404effff61df799945c23573b25a
src/components/Transform/perpetual-open/index.vue
@@ -105,6 +105,27 @@
                  <!-- {{ $t("张") }} -->
                </span>
              </div>
           <div
             class="h-76 lh-76 inputBackground mb-30 flex pr-20 justify-center rounded-lg textColor"
           >
            <input style="width: 133px;"
               :placeholder="selectIndex == 1 ? $t('请输入止盈金额') : ''"
               class="inputBackground pl-20 h-76 border-none text-left rounded-lg"
               v-model="form.stop_price_profit"
             />
             <span class="font-22 font-400 textColor">{{ $t("止盈") }}</span>
           </div>
           <div
             class="h-76 lh-76 inputBackground mb-30 flex pr-20 justify-center rounded-lg textColor" style="margin-bottom:20px"
             v-if="selectIndex == 1"
           >
             <input style="width: 133px;"
               :placeholder="selectIndex == 1 ? $t('请输入止损金额') : ''"
               class="inputBackground pl-20 h-76 border-none text-left rounded-lg"
               v-model="form.stop_price_loss"
             />
             <span class="font-22 font-400 textColor">{{ $t("止损") }}</span>
           </div>
              <!-- <vue-slider v-bind="options" v-model="form.amount"></vue-slider> -->
              <!-- <vue-slider class="mainBox" v-bind="options" :marks="marks" v-model="form.volume" :hide-label="true"  width="90%"
              :railStyle="{ background: '#404040', height: '4px' }"
@@ -121,8 +142,11 @@
  <span class="flex-1 text-right">100%</span>
</div> -->
              <!-- 张数输入 -->
              <amount-slider ref="sliderRef" :maxAmount="maxUSDT" @getAmount="getAmount"
                :propsAmount="form.amount"></amount-slider>
              <!-- <amount-slider ref="sliderRef" :maxAmount="maxUSDT" @getAmount="getAmount"
                :propsAmount="form.amount"></amount-slider> -->
            <div class="btns_box" >
               <div :class="bfbindex==index?'btns_box_boxs':'btns_box_box'" @click="bfbclick(item,index)" v-for="(item,index) in bfblist" :key="index">{{item.name}}%</div>
            </div>
            </template>
            <template v-if="selectIndex == 1 && userInfo.token">
              <div class="flex justify-between mt-30">
@@ -134,13 +158,12 @@
                  <span>{{ 'USDT' }}</span>
                </div>
              </div>
              <div class="flex justify-between mt-30">
              <!-- <div class="flex justify-between mt-30">
                <div class="text-grey">{{ $t("保证金") }}</div>
                <div class="textColor">
                  <!-- {{ (initData.amount * (form.amount / 1)) }} {{ queryType === 'cryptos' ? 'USDT' : 'USD' }} -->
                  {{ form.lever_rate * form.amount }} {{ 'USDT' }}
                </div>
              </div>
              </div> -->
              <div class="flex justify-between mt-30">
                <div class="text-grey">{{ $t("建仓手续费") }}</div>
                <div class="textColor">{{ reserve(userInfo.perpetual_contracts_status === '1' ?
@@ -150,9 +173,9 @@
              </div>
            </template>
            <div class="flex font-24 text-grey justify-between mt-32" v-if="selectIndex == 2">
            <div class="flex font-24 text-grey justify-between mt-32" >
              <div>{{ $t("可用USDT") }}</div>
              <div class="textColor">{{ initFutrue.amount }} {{ queryType === 'cryptos' ? 'USDT' : 'USD' }}</div>
              <div class="textColor">{{ initFutrue.amount }} USDT</div>
            </div>
            <div class="flex font-24 text-grey justify-between mt-20"
              v-if="selectIndex == 2 && JSON.stringify(initFutrue.para) != '[]'">
@@ -539,6 +562,13 @@
    return {
      THEME,
      fixDate,
     bfbindex:null,
     bfblist:[
        {name:'25'},
        {name:'50'},
        {name:'75'},
        {name:'100'}
     ],
      currentBuyType: '', // 交割合约当前下单的类型,用于弹窗倒计时结束以后,点击再下一单
      timeout2: null,
      timeout: null,
@@ -561,6 +591,8 @@
        direction: 'buy', // 买or卖
        price_type: 'opponent', // 市价or限价
        lever_rate: 1, // 杠杆
      stop_price_profit: "",
      stop_price_loss: "",
        price: '',
        amount: '', // 数量
        para_id: '' // 交割周琦id
@@ -615,6 +647,14 @@
  },
  methods: {
    reserve,
   bfbclick(e,i){
      this.bfbindex = i
      e = parseInt(e.name)
      const rate = e / 100; //如0.25
      this.form.amount = this.maxUSDT * rate
      var a = this.form.amount
      this.form.amount = Math.floor(a*100)/100
   },
    //获取张数
    getAmount(val) {
      if (!val) {
@@ -847,6 +887,14 @@
        this.$router.push('/login')
        return false;
      }
     //  if (!this.form.stop_price_profit) {
     //     this.$toast.fail(this.$t("请输入止盈金额"));
     //      return false;
     //     }
     // if (!this.form.stop_price_loss) {
     //    this.$toast.fail(this.$t("请输入止损金额"));
     //     return false;
     //    }
      if (this.selectIndex == 1) {
        if (!this.form.price) {
          showToast(this.$t('请输入金额'))
@@ -939,7 +987,24 @@
<style lang="scss">
@import "@/assets/init.scss";
.btns_box_boxs{
   width: 23%;
   border: 1px solid #F7B600;
   text-align: center;
   border-radius: 10px;
   color: #F7B600;
}
.btns_box_box{
   width: 23%;
   border: 1px solid #cbcbcb;
   text-align: center;
   border-radius: 10px;
}
.btns_box{
   display: flex;
   justify-content: space-between;
   align-items: center;
}
#cryptos {
  .perpetual-open {
    font-size: 26px;