litian
2024-03-12 b125d3ea74d61fb8e4d7238c83906aeea52c6b4c
pages/bookServices/list/index.js
@@ -9,7 +9,11 @@
    searchValue: '',
    path: '',
    pathList: [],
    pageCount: {
    page: 1,
      total: 0,
    },
    isMore: null,
    assortCheck: {
      name: '',
      code: '',
@@ -135,6 +139,24 @@
   */
  onReachBottom(e) {
    console.log('底部');
    const flag = this.data.bookList.length < this.data.pageCount.total
    if (flag) {
      this.setData({
        isMore: true,
        "pageCount.page": this.data.pageCount.page + 1
      })
      this.getBookList(this.data.path)
    } else {
      this.setData({
        isMore: true,
      })
      setTimeout(() => {
        this.setData({
          isMore: false
        })
      }, 100)
      console.log('没有更多了');
    }
  },
  /**
@@ -299,8 +321,8 @@
        height: 145,
      },
      paging: {
        start: (this.data.page - 1) * 16,
        size: 16,
        start: 0,
        size: this.data.pageCount.page * 8,
      },
      fields: {
        author: [],
@@ -313,8 +335,10 @@
    app.MG.store.getProductList(query).then((res) => {
      this.setData({
        bookList: res.datas,
        enable: false
        enable: false,
        "pageCount.total": res.total
      });
      console.log('图书列表', res, this.data.pageCount);
    });
  },
  // 一级分类切换