| | |
| | | minDate: '', |
| | | pagination: { |
| | | page: 0, |
| | | capacity: 10 |
| | | capacity: 6 |
| | | }, |
| | | total: 0, |
| | | dataList: [], |
| | |
| | | this.initData() |
| | | }, |
| | | onReachBottom() { |
| | | if (this.total > 10) { |
| | | console.log('onReachBottom'); |
| | | if (this.total > this.dataList.length) { |
| | | this.getList() |
| | | } |
| | | }else { |
| | | this.showToast('暂无更多数据') |
| | | } |
| | | }, |
| | | methods: { |
| | | getList() { |
| | |
| | | ...pagination, |
| | | model: { ...param } |
| | | }).then(res => { |
| | | if (pagination.page === 1) { |
| | | this.dataList = res.data.records |
| | | } else { |
| | | this.dataList = [...list, ...res.data.records] |
| | | } |
| | | this.dataList = [...this.dataList, ...res.data.records] |
| | | this.total = res.data.total |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | initData() { |
| | | getCarsList({ |
| | | type: 1 |
| | | type: 0 |
| | | }).then(res => { |
| | | this.carsList = [res.data] |
| | | }) |