123
dcc
2024-06-29 68a34d95db63a264e7a577051d586ea496c63ca0
src/page/new-urrency/index.vue
@@ -121,7 +121,12 @@
            <div>{{ $t("总价") }}</div>
            <div>{{ amt * activeData.issuePrice }} USDT</div>
          </div>
          <van-button class="okbut" type="info" @click="peishou">
          <van-button
            :loading="loading"
            class="okbut"
            type="info"
            @click="peishou"
          >
            {{ $t("确定") }}
          </van-button>
        </div>
@@ -151,6 +156,7 @@
  },
  data() {
    return {
      loading: false,
      amt: 0,
      show: false,
      active: 1,
@@ -183,6 +189,10 @@
          id: 2,
        },
        {
          name: this.$t("中签结果"),
          id: 3,
        },
        {
          name: this.$t("新币预览"),
          id: 0,
        },
@@ -201,23 +211,28 @@
      this.money_data = res.data;
    },
    async peishou() {
      this.loading = true;
      if (Number(this.amt) <= 0) {
        return Notify({ type: "warning", message: this.$t("请输入数量") });
      }
      await icoOrderAppAdd({
      const res = await icoOrderAppAdd({
        icoNewCurrencyId: this.activeData.id,
        orderType: this.activeData.type,
        tokenCode: this.activeData.tokenCode,
        lotteryQuantity: this.amt,
      }).catch((ree) => {
        this.loading = false;
      });
      Dialog.alert({
        title: this.$t("提示"),
        message: this.$t("配售成功"),
        confirmButtonText: this.$t("确定"),
      }).then(() => {
        this.$router.push(`/list-urrency?type=${this.activeData.type}`);
      });
      this.loading = false;
      if (res.code === "0") {
        Dialog.alert({
          title: this.$t("提示"),
          message: this.$t("配售成功"),
          confirmButtonText: this.$t("确定"),
        }).then(() => {
          this.$router.push(`/list-urrency?type=${this.activeData.type}`);
        });
      }
    },
    onClickLeft() {
      this.$router.go(-1);
@@ -240,6 +255,9 @@
    // 获取列表
    changeTab(item) {
      if (item.id === 3) {
        return this.$router.push("/list-urrency");
      }
      this.active = item.id;
    },
  },