信达小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
839 B

10 months ago
const app = getApp<IAppOption>();
10 months ago
Page({
data: {
list: [] as any[],
pagination: {
page: 1,
pages: 1,
count: 1,
},
},
10 months ago
onLoad() {
app.waitLogin().then(() => {
this.getList();
});
},
10 months ago
getList(newPage = 1) {
wx.ajax({
method: 'GET',
10 months ago
url: '?r=xd/doctor/index/get-msg-list',
10 months ago
data: {
page: newPage,
},
}).then((res) => {
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({
total: res.count,
list,
pagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
});
});
},
onReachBottom() {
const { page, pages } = this.data.pagination;
if (pages > page) {
this.getList(page + 1);
}
},
});
10 months ago
export {};