k94314517
2024-07-25 a75b18a4157ab486e0b51c438ac165ab3a08e3e0
wechat_jiaxuan/pages/userinfo/collect.js
@@ -11,18 +11,24 @@
    dataList: [],
    total: 0,
    pageNum: 1,
    pageNum: 1,
    pageSize: 10,
  },
  onLoad(options) {
    this.getList()
  },
  onReachBottom() {
    if(this.data.total > this.data.dataset.length){
      this.setData({ pageNum: this.data.pageNum + 1 })
    console.log('触底事件');
    const { total, dataList, pageNum } = this.data
    if(total > dataList.length){
      this.setData({ pageNum: pageNum + 1 })
      this.getList()
    }else{
      wx.showToast({
        title: '暂无更多数据',
        icon: 'none'
      })
    }
    // this.pageN
  },
  tabsChange(e) {
    const activeTabs = e.currentTarget.dataset.val
@@ -61,7 +67,7 @@
    }).then(res => {
      if (res.data) {
        this.setData({
          dataList: [...this.data.dataset, ...res.data.records || []],
          dataList: [...this.data.dataList, ...res.data.records || []],
          total: res.data.total
        })
      }