From cbce3eda60b5a5d09ccbfec5d593eeb4b444700b Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 14 Oct 2023 15:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E6=9A=82=E6=97=B6=E5=B0=B1?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=88=B0=E8=BF=99=E9=87=8C=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/common/News.vue | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/pages/common/News.vue b/src/pages/common/News.vue index 09855591..88d5d772 100644 --- a/src/pages/common/News.vue +++ b/src/pages/common/News.vue @@ -182,15 +182,8 @@ onBeforeMount(() => { }); onMounted(async () => { - loadingTitle.value = "正在获取公告数据"; - const noticeData = await Mys.News.get(gid); - rawData.value.notice.isLast = noticeData.is_last; - rawData.value.notice.lastId = noticeData.list.length; - postData.value.notice = Mys.News.card.notice(noticeData); tab.value = "notice"; - setTimeout(() => { - loading.value = false; - }, 1500); + await firstLoad("notice"); }); async function firstLoad(key: NewsKey): Promise { @@ -198,7 +191,7 @@ async function firstLoad(key: NewsKey): Promise { return; } if (rawData.value[key].lastId === 0) { - loadingTitle.value = `正在获取${rawData.value[key].name}数据...;`; + loadingTitle.value = `正在获取${rawData.value[key].name}数据...`; loading.value = true; const getData = await Mys.News.get(gid, NewsType[key]); rawData.value[key].isLast = getData.is_last;