From 37c8d6560f9f7665c461c75dcf4bc85e4178c74a Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Tue, 10 Sep 2024 14:15:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BE=E7=A7=91=E6=96=B0=E5=A2=9Eloading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/encyclopedia/components/item/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/encyclopedia/components/item/index.js b/pages/encyclopedia/components/item/index.js index 46a8046..7e0a260 100644 --- a/pages/encyclopedia/components/item/index.js +++ b/pages/encyclopedia/components/item/index.js @@ -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({