lll
liukangdong
2024-07-21 4eaf6d8835d4e9b204f13d012f13bbd8a94a21cc
wechat_jiaxuan/components/disCase/index.js
@@ -4,7 +4,7 @@
   * 组件的属性列表
   */
  properties: {
    menuButtonInfo: Object
  },
  data: {
    activeIndex: -1,
@@ -15,6 +15,7 @@
    cateList: [],
    dataList: [],
    total: 0,
    pageNum: 1,
    pageSize: 10,
    query: '',
@@ -46,13 +47,30 @@
        catalogCode,pageNum,pageSize,tagCodes, sortType,query
      }).then(res => {
        if(res.data){
          this.setData({ dataList: res.data.records })
          this.setData({
            total: res.data.total,
            dataList: [...this.data.dataList, ...res.data.records],
          })
        }  
      })
    },
    scrolltolower() {
      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'
        })
      }
    },
    statusChange(e) {
      const sortType = e.currentTarget.dataset.status
      this.setData({sortType})
      this.setData({ pageNum: 1,dataList: [],total: 0})
      this.getList()
    },
    handleAction(e){
@@ -86,6 +104,7 @@
        cateList[activeIndex].paramIndex = -1
        cateList[activeIndex].paramName = ''
      }
      this.setData({ pageNum: 1,dataList: [],total: 0})
      this.setData({ tagCodes, cateList })
      console.log('tagCodes', tagCodes);
    },