yiming
2024-04-09 12cc87a1f2f9b91359d3ca43fe052440d9890dac
pages/bookExhibitionList/index.js
@@ -8,6 +8,9 @@
   * 页面的初始数据
   */
  data: {
    totalSize: '',
    start: 0,
    isMore: null,
    keynoteDisabled: true,
    value: '',
    keyword: '',
@@ -61,19 +64,19 @@
      value: 'timeAsc',
      options: [{
          value: 'nameAsc',
          label: '名称从高到低',
          label: '名称正序',
        },
        {
          value: 'nameDesc',
          label: '名称从低到高',
          label: '名称倒序',
        },
        {
          value: 'timeAsc',
          label: '创建时间从高到低',
          label: '出版时间正序',
        },
        {
          value: 'timeDesc',
          label: '创建时间从底到高',
          label: '出版时间倒序',
        },
      ],
    },
@@ -164,9 +167,32 @@
  onPullDownRefresh() {
  },
  onPullDownRefresh() {
    this.data.page.size = 16 //更改显示的值
    this.bookExhibitionGet(); // 调用方法加载更多数据
  // onPullDownRefresh() {
  //   this.data.page.size = 16 //更改显示的值
  //   this.bookExhibitionGet(); // 调用方法加载更多数据
  // },
  onScrollToLower() {
    console.log(789);
    console.log(this.data.bookExhibitionList.length);
    console.log(this.data.totalSize);
    if (this.data.bookExhibitionList.length < this.data.totalSize) {
      this.setData({
        isMore: true,
        start: this.data.start + 1
      })
      this.bookExhibitionGet()
    } else {
      this.setData({
        isMore: true,
      })
      setTimeout(() => {
        this.setData({
          isMore: false
        })
        console.log('300');
      }, 300)
    }
  },
  /**
   * 页面上拉触底事件的处理函数
@@ -192,7 +218,7 @@
        // 'page.start': currentPage,
        'page.size': newSize
      });
      this.bookExhibitionGet(); // 调用方法加载更多数据
      // this.bookExhibitionGet(); // 调用方法加载更多数据
@@ -251,7 +277,10 @@
        'bookClassification*': this.data.keynoteValue || [],
        ...searchObj
      },
      paging: this.data.page,
      paging: {
        start: '0',
        size: this.data.start * 10
      },
      sort: sort,
      // coverSize: {
      //   width: 100
@@ -277,9 +306,10 @@
      }
      const list = [...res.datas]
      console.log(res);
      this.setData({
        bookExhibitionList: list
        bookExhibitionList: list,
        totalSize: res.total
      })
      // 判断数据长度
      console.log(list.length, 'list.length');
@@ -368,9 +398,10 @@
    this.setData({
      'multipleSelect.value': e.detail.value,
    });
  },
  handleConfirm(event) {
    const {
      value
@@ -381,11 +412,14 @@
    this.data.keynoteValue = value
    this.bookExhibitionGet()
  },
  handleReset() {
  handleReset(e) {
    // 重置操作的处理逻辑
    this.data.keynoteValue = []
    console.log('重置操作');
    this.bookExhibitionGet()
  },
  onSwapRight() {
@@ -435,5 +469,6 @@
    });
    console.log(e.detail.value, 'e.detail.value');
    this.bookExhibitionGet()
  }
  },
})