0510航天交易所ui仿制,代码使用的jiem
lxf
2025-06-19 ace7f5f4d66a3cfa09943a783c8e58c9a4129c14
修改先取整在x倍数
2 files modified
76 ■■■■■ changed files
src/components/perpetual-open/index.vue 72 ●●●●● patch | view | raw | blame | history
src/components/perpetual-position-list/index.vue 4 ●●● patch | view | raw | blame | history
src/components/perpetual-open/index.vue
@@ -202,10 +202,8 @@
                v-if="form.lever_rate == 25"
              >
                {{
                  Math.floor(
                    (initFutrue.amount / (initData.amount + 0.0375)) *
                      form.lever_rate
                  )
                  Math.floor(initFutrue.amount / (initData.amount + 0.0375)) *
                  form.lever_rate
                }}
                {{ $t("手数") }}
              </span>
@@ -214,10 +212,8 @@
                v-if="form.lever_rate == 50"
              >
                {{
                  Math.floor(
                    (initFutrue.amount / (initData.amount + 0.075)) *
                      form.lever_rate
                  )
                  Math.floor(initFutrue.amount / (initData.amount + 0.075)) *
                  form.lever_rate
                }}
                {{ $t("手数") }}
              </span>
@@ -226,10 +222,8 @@
                v-if="form.lever_rate == 100"
              >
                {{
                  Math.floor(
                    (initFutrue.amount / (initData.amount + 0.15)) *
                      form.lever_rate
                  )
                  Math.floor(initFutrue.amount / (initData.amount + 0.15)) *
                  form.lever_rate
                }}
                {{ $t("手数") }}
              </span>
@@ -238,10 +232,8 @@
                v-if="form.lever_rate == 200"
              >
                {{
                  Math.floor(
                    (initFutrue.amount / (initData.amount + 0.3)) *
                      form.lever_rate
                  )
                  Math.floor(initFutrue.amount / (initData.amount + 0.3)) *
                  form.lever_rate
                }}
                {{ $t("手数") }}
              </span>
@@ -873,33 +865,33 @@
      let vol;
      // vol = this.initOpen.volume / 1;
      if (this.form.lever_rate == 25) {
        vol = Math.floor(
          // (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
          //   this.initData.amount
          (this.initFutrue.amount / (this.initData.amount + 0.0375)) *
            this.form.lever_rate
        );
        vol =
          Math.floor(
            // (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
            //   this.initData.amount
            this.initFutrue.amount / (this.initData.amount + 0.0375)
          ) * this.form.lever_rate;
      } else if (this.form.lever_rate == 50) {
        vol = Math.floor(
          // (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
          //   this.initData.amount
          (this.initFutrue.amount / (this.initData.amount + 0.075)) *
            this.form.lever_rate
        );
        vol =
          Math.floor(
            // (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
            //   this.initData.amount
            this.initFutrue.amount / (this.initData.amount + 0.075)
          ) * this.form.lever_rate;
      } else if (this.form.lever_rate == 100) {
        vol = Math.floor(
          // (this.initFutrue.amount - this.initFutrue.amount * 0.15) /
          //   this.initData.amount
          (this.initFutrue.amount / (this.initData.amount + 0.15)) *
            this.form.lever_rate
        );
        vol =
          Math.floor(
            // (this.initFutrue.amount - this.initFutrue.amount * 0.15) /
            //   this.initData.amount
            this.initFutrue.amount / (this.initData.amount + 0.15)
          ) * this.form.lever_rate;
      } else {
        vol = Math.floor(
          // (this.initFutrue.amount - this.initFutrue.amount * 0.3) /
          //   this.initData.amount
          (this.initFutrue.amount / (this.initData.amount + 0.3)) *
            this.form.lever_rate
        );
        vol =
          Math.floor(
            // (this.initFutrue.amount - this.initFutrue.amount * 0.3) /
            //   this.initData.amount
            this.initFutrue.amount / (this.initData.amount + 0.3)
          ) * this.form.lever_rate;
      }
      return Math.floor(vol);
    },
src/components/perpetual-position-list/index.vue
@@ -82,9 +82,7 @@
        <div class="flex-1 text-left">
          <div class="text-grey">{{ $t("持仓数量") }}</div>
          <div class="mt-20" :class="[isStyle ? 'textColor1 ' : 'textColor']">
            {{ item.volume / (item.lever_rate ? item.lever_rate : 1) }}*{{
              item.lever_rate ? item.lever_rate : 1
            }}x
            {{ item.amount }}
          </div>
        </div>
        <div class="flex-1 text-left">