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.
47 lines
861 B
47 lines
861 B
|
4 months ago
|
const _app = getApp<IAppOption>();
|
||
|
|
|
||
|
|
Page({
|
||
|
|
data: {
|
||
|
|
list: [] as any[],
|
||
|
|
pagination: {
|
||
|
|
page: 1,
|
||
|
|
pages: 1,
|
||
|
|
count: 1,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
onLoad() {},
|
||
|
|
getList(newPage = 1) {
|
||
|
|
wx.ajax({
|
||
|
|
method: 'GET',
|
||
|
|
url: '?r=wtx/knowledge/list',
|
||
|
|
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);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
handleDetail() {
|
||
|
|
wx.navigateTo({
|
||
|
|
url: '/pages/informationDetail/index',
|
||
|
|
});
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
export {};
|