1
admin
2026-01-13 95e138158db3e61e0be67691a4142f20c561634c
src/page/kline/index.vue
@@ -438,21 +438,15 @@
        </div> -->
      </div>
      <div class="rights">
        <div class="buy_btn">
        <!-- <div class="buy_btn">
          <div class="top_buy" @click="goBuy(0)">
            <span>{{ $t("hj84") }}</span>
          </div>
          <!-- <div class="bottom_buy">
            <span>{{ singDetails.nowPrice }}</span>
          </div> -->
        </div>
        </div> -->
        <div class="sell_btn" @click="goBuy(1)">
          <div class="top_sell">
            <span>{{ $t("hj85") }}</span>
          </div>
          <!-- <div class="bottom_sell">
            <span>{{ singDetails.nowPrice }}</span>
          </div> -->
        </div>
      </div>
    </div>
@@ -481,7 +475,8 @@
      newsdetailList: [],
      bayType: "",
      timer: null,
      key: 0
      key: 0,
      messageInstances: [] // 保存所有消息提示实例
    };
  },
  components: {
@@ -492,7 +487,6 @@
    // 进入页面的时候清除所以得计时器,防止页面切换的时候出现多个定时器
    let end = setTimeout(function() {}, 0);
    for (let i = 0; i <= end; i++) {
      clearTimeout(i);
      clearInterval(i);
    }
@@ -502,6 +496,7 @@
      this.getSingDetailUs();
    } else {
      this.getSingDetails();
      this.timer = setInterval(() => {
        this.getSingDetails();
      }, 5000);
@@ -511,10 +506,24 @@
    this.getNohknews();
  },
  beforeDestroy() {
    this.clearInterval(this.timer); // 在组件销毁前清除定时器
    clearInterval(this.timer); // 在组件销毁前清除定时器
    // 关闭所有消息提示
    this.messageInstances.forEach(instance => {
      if (instance && typeof instance.close === 'function') {
        instance.close();
      }
    });
    this.messageInstances = [];
  },
  destroyed() {
    this.clearInterval(this.timer); // 在组件销毁前清除定时器
    clearInterval(this.timer); // 在组件销毁前清除定时器
    // 确保所有消息提示都已关闭
    this.messageInstances.forEach(instance => {
      if (instance && typeof instance.close === 'function') {
        instance.close();
      }
    });
    this.messageInstances = [];
  },
  // beforeDestroy() {
  //   this.Klinetype = false;
@@ -542,31 +551,35 @@
        if (data.status === 0) {
          this.getOpation();
          this.optionBtn = false;
          this.$message({
          const messageInstance = this.$message({
            message: this.$t("hj97"),
            type: "success"
          });
          this.messageInstances.push(messageInstance);
        } else {
          this.optionBtn = false;
          this.$message({
          const messageInstance = this.$message({
            message: data.msg,
            type: "warning"
          });
          this.messageInstances.push(messageInstance);
        }
      } else {
        let data = await api.addOption({ code: this.kLineDetails.code });
        if (data.status === 0) {
          this.getOpation();
          this.optionBtn = false;
          this.$message({
          const messageInstance = this.$message({
            message: this.$t("hj96"),
            type: "success"
          });
          this.messageInstances.push(messageInstance);
        } else {
          this.$message({
          const messageInstance = this.$message({
            message: data.msg,
            type: "warning"
          });
          this.messageInstances.push(messageInstance);
          this.optionBtn = false;
        }
      }
@@ -1231,11 +1244,12 @@
    }
    .sell_btn {
      width: 50%;
      width: 100%;
      height: 80%;
      background: #c4d600;
      color: #fff;
      border-radius: 0 3rem 3rem 0 !important;
      // border-radius: 0 3rem 3rem 0 !important;
      border-radius: 3rem  !important;
      .top_sell {
        width: 100%;