1
PC-20250623MANY\Administrator
2025-09-29 c03ae5893c55c8b30daed67e96d0a8d0a513451b
src/page/trading/buy.vue
@@ -30,19 +30,11 @@
            </div>
            <div class="rights">
              <div class="ese">
                <div
                  class="mc"
                  @click="handleTradingClick(0)"
                  :class="tabsCurrentIndex === 0 ? 'actives' : ''"
                >
                <div class="mc" @click="handleTradingClick(0)" :class="tabsCurrentIndex === 0 ? 'actives' : ''">
                  <span>Short</span>
                </div>
                <div
                  class="mr"
                  @click="handleTradingClick(1)"
                  :class="tabsCurrentIndex === 1 ? 'active' : ''"
                >
                <div class="mr" @click="handleTradingClick(1)" :class="tabsCurrentIndex === 1 ? 'active' : ''">
                  <span>Long</span>
                </div>
              </div>
@@ -53,13 +45,8 @@
      <div class="price_tabs">
        <div class="tabs">
          <div
            class="tab_item"
            v-for="(item, index) in priceTabs"
            :key="index"
            @click="handleTabsClick(item, index)"
            :class="priceTabsCurrentIndex === index ? 'active' : ''"
          >
          <div class="tab_item" v-for="(item, index) in priceTabs" :key="index" @click="handleTabsClick(item, index)"
            :class="priceTabsCurrentIndex === index ? 'active' : ''">
            <span>{{ item }}</span>
          </div>
        </div>
@@ -76,29 +63,21 @@
                <img src="@/assets/img/ic_number_jian.png" alt />
              </div>
              <div class="addorj"></div>
              <div
                class="addorj"
                @click="
                  typeof nums == 'string'
                    ? (nums = Number(Number(nums) + 1).toFixed(2))
                    : (nums = (Number(nums) + 1).toFixed(2))
                "
              >
              <div class="addorj" @click="
                typeof nums == 'string'
                  ? (nums = Number(Number(nums) + 1).toFixed(2))
                  : (nums = (Number(nums) + 1).toFixed(2))
                ">
                <img src="@/assets/img/ic_number_add.png" />
              </div>
            </div>
          </div>
          <div class="num">
            <span>{{ $t("hj100") }}</span>
            <span>{{ $t("交易数量") }}({{ $t('hj117') }})</span>
          </div>
          <div class="tr_es flexJy">
            <div class="top_input">
              <input
                type="number"
                onkeyup="value=value.replace(/[^\d]/g,'')"
                v-model="num"
                @input="numInput"
              />
              <input type="number" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="num" @input="numInput" />
            </div>
            <div class="right_sw flexJy" style="width: auto">
              <div class="addorj" @click="jyslJian">
@@ -126,8 +105,8 @@
              <span>
                {{ bayType | currencySymbol }}
                {{
                  (nowPrice * selectCycle.replace("X", "") * num)
                    | _toLocaleString
                  (nowPrice * selectCycle.replace("X", "") * num * stockNum)
                  | _toLocaleString
                }}
              </span>
              <span style="white-space: nowarp">
@@ -211,14 +190,8 @@
        </div>
      </div>
    </div>
    <van-action-sheet
      v-model="showGg"
      :actions="siteLeverList"
      :cancel-text="$t('hj106')"
      :description="$t('hj107')"
      close-on-click-action
      @select="onSelect"
    />
    <van-action-sheet v-model="showGg" :actions="siteLeverList" :cancel-text="$t('hj106')" :description="$t('hj107')"
      close-on-click-action @select="onSelect" />
  </div>
</template>
@@ -318,7 +291,8 @@
        }
      ],
      moneyData: {},
      gid: ""
      gid: "",
      stockNum: 0, // 一手的股数
    };
  },
  computed: {
@@ -343,6 +317,7 @@
    this.getMoneyData();
    this.getSettingInfo();
    this.queryStockConfig();
    this.getStockBuySetting();
  },
  watch: {
    checkedZy(val) {
@@ -378,8 +353,8 @@
      // this.moneyData.availableBalance
      let numbs = Math.floor(
        this.moneyData.availableBalance /
          this.nowPrice /
          this.selectCycle.replace("X", "")
        this.nowPrice /
        this.selectCycle.replace("X", "")
      );
      if (e.target.value >= numbs) {
        this.num = numbs;
@@ -412,8 +387,8 @@
    jjjisua() {
      let numbs = Math.floor(
        this.moneyData.availableBalance /
          this.nowPrice /
          this.selectCycle.replace("X", "")
        this.nowPrice /
        this.selectCycle.replace("X", "")
      );
      typeof this.num == "string"
        ? (this.num = Number(Number(this.num) + 1))
@@ -720,6 +695,13 @@
          elAlertText: data.msg
        });
      }
    },
    // 获取每手的股数
    async getStockBuySetting() {
      let data = await api.queryStockBuySetting({ stockType: this.bayType });
      if (data.status === 0) {
        this.stockNum = data.data[0].stockNum;
      }
    }
  },
  filters: {
@@ -740,7 +722,7 @@
  min-height: 100vh;
  background-color: #fff;
  > .content {
  >.content {
    width: 100%;
    height: calc(100% - 1.6rem);
    position: relative;
@@ -765,7 +747,7 @@
      display: flex;
      align-items: center;
      > img {
      >img {
        margin-top: 0.2rem;
        width: 0.6rem;
        height: 0.6rem;
@@ -841,13 +823,13 @@
        align-items: center;
        justify-content: flex-end;
        > div {
        >div {
          width: 65%;
          height: 80%;
          display: flex;
          justify-content: center;
          > div {
          >div {
            width: 45%;
            height: 70%;
            background: rgb(236, 236, 236);
@@ -898,7 +880,7 @@
    justify-content: center;
    border-radius: 0.15rem;
    > div {
    >div {
      width: 49%;
      height: 80%;
      border-radius: 0.15rem;
@@ -950,7 +932,7 @@
      height: 1.3rem;
      margin-top: 0.4rem;
      > div {
      >div {
        width: 100%;
        height: 50%;
        color: rgb(160, 160, 160);
@@ -984,7 +966,7 @@
      font-size: 0.3803rem;
      border-bottom: 0.05rem solid rgb(236, 236, 236);
      > div {
      >div {
        color: #000;
      }
    }
@@ -1009,7 +991,7 @@
    align-items: center;
    border-bottom: 0.05rem solid rgb(236, 236, 236);
    > div {
    >div {
      // width: 20%;
      height: 50%;
      display: flex;
@@ -1033,7 +1015,7 @@
  align-items: flex-end;
  // padding-top: 0.8rem;
  > div {
  >div {
    width: 100%;
    height: 1.2821rem;
    display: flex;