zzzz
2024-03-28 91f9b7a3b7dfc4fe6b9b5008cfec4e18dfb6dcd5
src/page/list/tradingList/data.list.vue
@@ -21,6 +21,7 @@
    </div>
    <van-list
      style="margin-bottom: 50px"
      v-model="loadings"
      :finished="finished"
      :finished-text="$t('hj43')"
@@ -75,9 +76,9 @@
            <div style="text-align: right">
              <div
                class="tp right_bs"
                :class="`${item.hcrate > 0 ? 'green' : 'red'}`"
                :class="`${item.color > 0 ? 'green' : 'red'}`"
              >
                <span class="price_color">{{ item.hcrate }}</span>
                <span class="price_color">{{ item.hcrateP }}</span>
              </div>
            </div>
          </van-col>
@@ -114,19 +115,22 @@
      this.finished = false;
      this.listArr = [];
      this.pageNumVal = 1;
      this.getStock(e, this.zxactive);
      this.loadings = true;
      this.getStock(e, this.zxactive, 1);
    },
    zxactive(e) {
      this.finished = false;
      this.listArr = [];
      this.pageNumVal = 1;
      this.getStock(this.active, e);
      this.loadings = true;
      this.getStock(this.active, e, 1);
    },
    sousuo(e) {
      this.finished = false;
      this.listArr = [];
      this.pageNumVal = 1;
      this.getStock(this.active, this.zxactive);
      this.loadings = true;
      this.getStock(this.active, this.zxactive, 1);
    },
  },
  data() {
@@ -141,7 +145,7 @@
  mounted() {
    this.listArr = [];
    this.pageNumVal = 1;
    this.getStock(this.active, this.zxactive);
    this.getStock(this.active, this.zxactive, 1);
  },
  methods: {
    filterSH(val) {
@@ -177,15 +181,16 @@
      });
    },
    // 获取列表
    getStock: handleDt.debounce(async function (a, b) {
    getStock: handleDt.debounce(async function (a, b, c) {
      a = this.active;
      let stockType = "";
      if (a !== "") {
        let array = this.tabsList.filter((item) => item.key === a);
        stockType = array[0].name;
      }
      let pageNumVal = c || this.pageNumVal;
      let opt = {
        pageNum: this.pageNumVal,
        pageNum: pageNumVal,
        pageSize: 15,
        stockPlate: "",
        keyWords: this.sousuo,
@@ -193,27 +198,28 @@
        orderBy: "",
      };
      let data = await api.getStockByType(opt);
      this.loading = false;
      this.loadings = false;
      if (data.status === 0) {
        if (this.listArr.length >= data.data.total) {
        console.log(data.data.list.length < 15);
        if (data.data.list.length < 15) {
          this.finished = true;
        }
        if (this.pageNumVal !== 1) {
        if (pageNumVal !== 1) {
          this.listArr = [...this.listArr, ...data.data.list];
        } else {
          this.listArr = data.data.list;
        }
      } else {
        this.loading = false;
        this.finished = true;
      }
    }, 500),
    onLoads() {
      if (!this.loading) {
        this.pageNumVal++;
        this.loading = true;
        this.getStock();
      }
      console.log(333333);
      // if (!this.loading) {
      this.pageNumVal++;
      this.loadings = true;
      this.getStock();
      // }
    },
    optionszx() {},
  },