zzzz
2024-04-26 f989b0f6b7c1190a719d22a2aeec0e8914c2db07
first
2 files modified
59 ■■■■■ changed files
config/index.js 2 ●●● patch | view | raw | blame | history
src/page/trading/buy.vue 57 ●●●●● patch | view | raw | blame | history
config/index.js
@@ -40,7 +40,7 @@
    },
    // Various Dev Server settings
    host: "127.0.0.1", // can be overwritten by process.env.HOST
    host: "192.168.0.101", // can be overwritten by process.env.HOST
    port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: true,
    errorOverlay: true,
src/page/trading/buy.vue
@@ -94,6 +94,7 @@
                type="number"
                onkeyup="value=value.replace(/[^\d]/g,'')"
                v-model="num"
                @input="numInput"
              />
            </div>
            <div class="right_sw flexJy" style="width: auto">
@@ -101,14 +102,7 @@
                <img src="@/assets/img/ic_number_jian.png" />
              </div>
              <div class="addorj"></div>
              <div
                class="addorj"
                @click="
                  typeof num == 'string'
                    ? (num = Number(Number(num) + 1))
                    : (num = Number(Number(num) + 1))
                "
              >
              <div class="addorj" @click="jjjisua">
                <img src="@/assets/img/ic_number_add.png" />
              </div>
            </div>
@@ -130,10 +124,13 @@
            </div>
            <div class="bottom_bzz">
              <span>{{ ((nowPrice / selectCycle) * num) | _toLocaleString }}</span>
              <span>
                {{
                  ((nowPrice / selectCycle.replace("X", "")) * num)
                    | _toLocaleString
                }}
              </span>
              <span style="white-space: nowarp">
                <!-- moneyData.symbol + " " + -->
                {{ moneyData.availableBalance | _toLocaleString }}
              </span>
            </div>
@@ -196,14 +193,6 @@
            </div>
          </div>
        </div>
        <!-- <div class="zy">
            <div class="left_zy">
              <span>追踪止损</span>
            </div>
            <div class="right_sw">
              <van-switch v-model="profitArr[2].checked" />
            </div>
          </div> -->
      </div>
      <div class="btn_buy" @click="gdOrSetBuy()">
        <div :class="tabsCurrentIndex == 0 ? 'maichu' : ''">
@@ -337,7 +326,20 @@
  },
  methods: {
    ...mapActions(["setUseInfo"]),
    numInput(e) {
      // this.nowPrice / this.selectCycle.replace("X", "")
      // this.moneyData.availableBalance
      let numbs = Math.floor(
        this.moneyData.availableBalance /
          this.nowPrice /
          this.selectCycle.replace("X", "")
      );
      if (e.target.value >= numbs) {
        this.num = numbs;
      }
      // if()
      console.log(e.target.value);
    },
    async getMoneyData() {
      let data = await api.getMoney();
      let type = this.bayType === "SZHB" ? "US" : this.bayType;
@@ -359,6 +361,21 @@
    handleTabsClick(item, index) {
      this.priceTabsCurrentIndex = index;
    },
    jjjisua() {
      let numbs = Math.floor(
        this.moneyData.availableBalance /
          this.nowPrice /
          this.selectCycle.replace("X", "")
      );
      typeof this.num == "string"
        ? (this.num = Number(Number(this.num) + 1))
        : (this.num = Number(Number(this.num) + 1));
      console.log(this.num, numbs);
      if (this.num >= numbs) {
        this.num = numbs;
      }
    },
    jyslJian() {
      if (typeof this.num === "string") {
        this.num = 1;