百科新增loading

This commit is contained in:
qiaomu 2024-09-10 14:15:03 +08:00
parent 3def3bf68b
commit 37c8d6560f

View File

@ -21,7 +21,6 @@ Component({
},
lifetimes: {
attached() {
console.log('----------=========')
this.getData();
}
},
@ -29,7 +28,7 @@ Component({
* 组件的方法列表
*/
methods: {
async getData() {
async init() {
const page = this.data.page;
const id = this.id;
const { code, data, message, total } = await getEncyclopediaList(id, page);
@ -39,6 +38,11 @@ Component({
}
this.setData({ list: data, totalPage: Math.ceil(total / 20) });
},
async getData() {
loadingFunc(async() => {
await this.init();
})
},
jumpToDetail(e) {
console.log('e', e)
wx.navigateTo({