jhzh
2024-04-28 3da2a498c24b2846649cbbe468910899a6f11a98
src/page/trading/buy.vue
@@ -27,19 +27,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>{{ $t("hj84") }}</span>
                </div>
                <div
                  class="mr"
                  @click="handleTradingClick(1)"
                  :class="tabsCurrentIndex === 1 ? 'active' : ''"
                >
                <div class="mr" @click="handleTradingClick(1)" :class="tabsCurrentIndex === 1 ? 'active' : ''">
                  <span>{{ $t("hj85") }}</span>
                </div>
              </div>
@@ -50,13 +42,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>
@@ -73,14 +60,11 @@
                <img src="@/assets/img/ic_number_jian.png" alt />
              </div>
              <div class="addorj"></div>
              <div
                class="addorj"
                @click="
              <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>
@@ -90,12 +74,7 @@
          </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">
@@ -148,21 +127,16 @@
        </div>
        <div class="zy" v-show="checkedZy">
          <div class="left_zy">
            <input
              v-model="profitTarget"
              onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
              @input="zyInt"
            />
            <input v-model="profitTarget" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
              @input="zyInt" />
          </div>
          <div class="right_sw" style="width: auto">
            <div class="addorj" @click="zYjian">
              <img src="@/assets/img/ic_number_jian.png" />
            </div>
            <div class="addorj"></div>
            <div
              class="addorj"
              @click="profitTarget = (Number(profitTarget) + 1).toFixed(2)"
            >
            <div class="addorj"
              @click="tabsCurrentIndex==0?profitTarget = (Number(profitTarget) + 1).toFixed(2):profitTarget = (Number(profitTarget) + 1).toFixed(2)">
              <img src="@/assets/img/ic_number_add.png" />
            </div>
          </div>
@@ -177,14 +151,11 @@
        </div>
        <div class="zy" v-show="checkedZs">
          <div class="left_zy">
            <input
              v-model="zhisun"
              onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
              @input="zsInt"
            />
            <input v-model="zhisun" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @input="zsInt" />
          </div>
          <div class="right_sw" style="width: auto">
            <div class="addorj" @click="zhisun--">
            <div class="addorj"
              @click="zSjian">
              <img src="@/assets/img/ic_number_jian.png" />
            </div>
            <div class="addorj"></div>
@@ -200,20 +171,16 @@
        </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>
<script>
import * as api from "@/axios/api";
import { mapActions } from "vuex";
  import {
    mapActions
  } from "vuex";
export default {
  name: "trBuy",
@@ -275,13 +242,20 @@
      if_us: 0,
      bayType: "",
      id: "",
      actions: [
        { name: "100X", subname: this.$t("hj102") },
        { name: "200X", subname: this.$t("hj102") },
        { name: "300X", subname: this.$t("hj102") },
      ],
      profitArr: [
        actions: [{
            name: "100X",
            subname: this.$t("hj102")
          },
        {
            name: "200X",
            subname: this.$t("hj102")
          },
          {
            name: "300X",
            subname: this.$t("hj102")
          },
        ],
        profitArr: [{
          name: this.$t("hj104"),
          checked: false,
        },
@@ -298,6 +272,7 @@
      gid: "",
    };
  },
  mounted() {
    this.bayType = this.$route.query.bayType;
    this.gid = this.$route.query.gid;
@@ -325,6 +300,14 @@
    },
  },
  methods: {
      zSjian(){
        var newzishu = (Number(this.zhisun)-1).toFixed(2)
        if(Number(newzishu)<1){
        }else{
          this.zhisun = newzishu
        }
      },
    ...mapActions(["setUseInfo"]),
    numInput(e) {
      // this.nowPrice / this.selectCycle.replace("X", "")
@@ -339,6 +322,10 @@
      }
      // if()
      console.log(e.target.value);
      },
      handleDoubleClick(event) {
        console.log(1);
        // console.log('Input field was double-clicked', event);
    },
    async getMoneyData() {
      let data = await api.getMoney();
@@ -367,9 +354,9 @@
          this.nowPrice /
          this.selectCycle.replace("X", "")
      );
      typeof this.num == "string"
        ? (this.num = Number(Number(this.num) + 1))
        : (this.num = Number(Number(this.num) + 1));
        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) {
@@ -403,18 +390,38 @@
      }
    },
    zYjian() {
      if ((Number(this.profitTarget) - 1).toFixed(2) < this.nowPrice) {
        this.profitTarget = this.nowPrice;
      var newzishu = (Number(this.profitTarget)-1).toFixed(2)
      if(Number(newzishu)<1){
      } else {
        this.profitTarget = (Number(this.profitTarget) - 1).toFixed(2);
        this.profitTarget = newzishu
      }
        // this.profitTarget = (Number(this.profitTarget) - 1).toFixed(2);
        // if(this.tabsCurrentIndex==0){
        //   console.log( this.nowPrice);
        //   if ((Number(this.profitTarget) - 1).toFixed(2) < this.nowPrice) {
        //     this.profitTarget = (Number(this.profitTarget) - 1).toFixed(2);
        //   } else {
        //     this.profitTarget = this.nowPrice;
        //   }
        // }else{
        //   console.log(123);
        //   if ((Number(this.profitTarget) - 1).toFixed(2) < this.nowPrice) {
        //     this.profitTarget = this.nowPrice;
        //   } else {
        //     this.profitTarget = (Number(this.profitTarget) - 1).toFixed(2);
        //   }
        // }
    },
    zSjia() {
      if ((Number(this.zhisun) + 1).toFixed(2) > this.nowPrice) {
        this.zhisun = this.nowPrice;
      } else {
        this.zhisun++;
      }
        // if ((Number(this.zhisun) + 1).toFixed(2) > this.nowPrice) {
        //   this.zhisun = this.nowPrice;
        // } else {
        //   this.zhisun++;
        // }
    },
    zsInt(e) {
      if (typeof e.target.value === "string") {
@@ -440,8 +447,10 @@
    },
    gdOrSetBuy() {
      if (this.priceTabsCurrentIndex == 0) {
        this.setBuy();
      } else {
        this.gdBuy();
      }
      if (navigator.vibrate) {
@@ -633,12 +642,13 @@
          this.siteLeverList = [];
          for (
            let i = 0;
            i < this.$store.state.userInfo.siteLever.split("/").length;
            i++
              let i = 0; i < this.$store.state.userInfo.siteLever.split("/").length; i++
          ) {
            let val = this.$store.state.userInfo.siteLever.split("/")[i];
            let item = { label: val, name: val + "X" };
              let item = {
                label: val,
                name: val + "X"
              };
            this.siteLeverList.push(item);
          }
          console.log(this.siteLeverList, " this.selectCycle");
@@ -1069,6 +1079,7 @@
    transform: skew(-10deg, 0deg);
  }
}
/deep/.van-overlay {
  z-index: 10000 !important;
}