dcc
2024-06-29 358dd78ee40aea1e43fd7987c6e604960c2d0672
src/page/quotes.vue
@@ -12,7 +12,6 @@
        </div>
      </div>
      <div class="px-32 py-13 flex items-center">
        <!-- <img src="@/assets/image/icon-left_arrow.png" alt="logo" class="w-20 h-33 border-1 mr-32" @click="back"/> -->
        <div class="inputBoxbg h-60 w-full rounded-full flex items-center">
          <input
            style="padding-left: 10px; max-width: 130px"
@@ -23,7 +22,7 @@
            @input="onInput"
          />
          <img
            src="@/assets/image/icon-search.png"
            src="@/assets/3x/资源 22@3x.png"
            alt="logo"
            class="w-32 h-32 mx-16"
          />
@@ -95,7 +94,10 @@
    [Tab.name]: Tab,
    [Tabs.name]: Tabs,
  },
  async created() {
    this.keywords = this.$route.query.inputdata;
    // console.log(this.inputdata, "this.inputdata");
    this.active = this.$route.query.active / 1;
    if (this.userInfo.token) {
      const list = await _myCoins(); // 获取我的自选
@@ -104,7 +106,11 @@
    await this.fetchQoutes();
  },
  computed: {
    ...mapGetters({ coinList: "home/coinList", userInfo: "user/userInfo" }),
    ...mapGetters({
      coinList: "home/coinList",
      userInfo: "user/userInfo",
      newcoinArr: "home/newcoinArr",
    }),
  },
  data() {
    const arr = [];
@@ -112,6 +118,7 @@
      arr.push({ id: i });
    }
    return {
      inputdata: "",
      tabList: [
        { id: 1, text: this.$t("自选"), data: arr, loading: true },
        { id: 2, text: this.$t("现货"), data: arr, loading: true },
@@ -129,8 +136,14 @@
      sortVal: 0,
    };
  },
  mounted() {
    this.NEW_CION_LIST();
    this.GET_UERS_KYC();
  },
  methods: {
    ...mapActions("home", [SET_COIN_LIST]),
    ...mapActions("home", [SET_COIN_LIST, "NEW_CION_LIST"]),
    ...mapActions("user", ["GET_UERS_KYC"]),
    listSort(val) {
      this.sortVal = val;
    },
@@ -140,8 +153,8 @@
        await this.SET_COIN_LIST();
      }
      const coins = this.coinList.map((item) => item.symbol);
      const data = await _getHomeList(coins.join(","));
      console.log(data);
      const mainArray = coins.filter((item) => !this.newcoinArr.includes(item));
      const data = await _getHomeList(mainArray.join(","));
      this.tabList[0]["data"] = data.filter((item) =>
        this.myList.includes(item.symbol)
      );
@@ -155,7 +168,6 @@
        clearTimeout(this.timeout);
        this.timeout = null;
      }
      console.log(this.tabList[1]);
      //排序
      if (this.sortVal == 1) {
        this.tabList[0]["data"] = this.tabList[0]["data"].sort(
@@ -265,7 +277,8 @@
    getFilterData() {
      // 过滤后的数据
      const index = this.active / 1 - 1;
      console.log(index);
      console.log(index, "====", this.keywords, this.tabList);
      this.tabList[index]["data"] = this.tabList[index]["data"].filter((item) =>
        item.symbol.includes(this.keywords.toLocaleLowerCase())
      );
@@ -279,6 +292,7 @@
        clearTimeout(this.inputTimeout);
        this.inputTimeout = null;
      }
      this.inputTimeout = setTimeout(() => {
        this.getFilterData();
      }, 50);