import { listMail } from '../../api/mail' Page({ data: { mails: [], query: { size: 8, current: 1 }, isLoading: true, noData: false, satisfactions: { not_satisfied: "不满意", basically_satisfied: "基本满意", satisfied: "非常满意", }, MAIL_STATES: { processing: "办理中", terminated: "已终止", completion: "已办结", } }, onLoad() { this.getList() }, getList() { this.setData({ isLoading: true }) listMail(this.data.query).then(data => { this.setData({ isLoading: false }) this.setData({ mails: this.data.mails.concat(data.records) }) console.log(this.data.mails.length) this.setData({ noData: this.data.mails.length >= data.total }) }) }, goMailDetail(event) { wx.navigateTo({ url: '/pages/mailDetail/index?id=' + event.target.dataset.id, }) }, loadMore() { console.log('loadMore') if (this.data.noData) { return } this.setData({ query: { size: 8, current: this.data.query.current + 1 } }) this.getList() }, goMailEvaluate(event) { console.log(event) wx.navigateTo({ url: '/pages/mailEvaluate/index?id=' + event.currentTarget.dataset.id + '&title=' + event.currentTarget.dataset.title + '&time=' + event.currentTarget.dataset.time, }) } });