| | |
| | | tagList: [], |
| | | activeCate: '', |
| | | dataList: [], |
| | | total: 0, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | |
| | |
| | | this.setData({ code: options.code}) |
| | | this.getTabList() |
| | | this.getList() |
| | | }, |
| | | onReachBottom() { |
| | | 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' |
| | | }) |
| | | } |
| | | }, |
| | | getList(){ |
| | | const { code, tagCodes, pageSize, pageNum } = this.data |
| | | pageZSZXContentList({ |
| | | catalogCode: code, |
| | | tagCodes: tagCodes ? [tagCodes] : [], |
| | | pageSize, |
| | | pageNum |
| | | }).then(res => { |
| | | this.setData({ |
| | | total: res.data.total, |
| | | dataList: [ ...this.data.dataList, ...res.data.records ] |
| | | }) |
| | | }) |
| | | }, |
| | | itemClick(e) { |
| | | const item = e.currentTarget.dataset.item |
| | |
| | | |
| | | }) |
| | | }, |
| | | getList(){ |
| | | const { code, tagCodes, pageSize, pageNum } = this.data |
| | | pageZSZXContentList({ |
| | | catalogCode: code, |
| | | tagCodes: tagCodes ? [tagCodes] : [], |
| | | pageSize, |
| | | pageNum |
| | | }).then(res => { |
| | | this.setData({ |
| | | dataList: [ ...this.data.dataList, ...res.data.records ] |
| | | }) |
| | | }) |
| | | }, |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | onReady() { |
| | | |
| | | }, |
| | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |