From 1d8e7ec35dd2e58b737353714b3d52fd1b77a3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Fri, 28 Mar 2025 11:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20=E6=B5=8B=E8=AF=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=90=88=E9=9B=86=E4=BF=A1=E6=81=AF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewPost/vp-overlay-collection.vue | 21 ++++++++-- src/utils/TGClient.ts | 6 +-- src/web/request/bbsReq.ts | 40 ++++++++++--------- src/web/utils/getRequestHeader.ts | 8 ++-- 4 files changed, 46 insertions(+), 29 deletions(-) diff --git a/src/components/viewPost/vp-overlay-collection.vue b/src/components/viewPost/vp-overlay-collection.vue index 48fcb560..7395eb3a 100644 --- a/src/components/viewPost/vp-overlay-collection.vue +++ b/src/components/viewPost/vp-overlay-collection.vue @@ -26,13 +26,14 @@ import TOverlay from "@comp/app/t-overlay.vue"; import TPostcard from "@comp/app/t-postcard.vue"; import { nextTick, onMounted, shallowRef, useTemplateRef, watch } from "vue"; -// import bbsReq from "@/web/request/bbsReq.js"; +import bbsReq from "@/web/request/bbsReq.js"; import postReq from "@/web/request/postReq.js"; type TpoCollectionProps = { collection: TGApp.BBS.Post.Collection; gid: number }; const props = defineProps(); const visible = defineModel(); +const info = shallowRef(); const postList = shallowRef>([]); const postListEl = useTemplateRef("postListRef"); @@ -49,11 +50,23 @@ watch( }, ); -onMounted(async () => { +onMounted(async () => await Promise.all([refreshInfo(), refreshPosts()])); + +async function refreshInfo(): Promise { + const infoResp = await bbsReq.collection(props.collection.collection_id, props.gid); + if ("retcode" in infoResp) { + // showSnackbar.warn(`[合集信息][${infoResp.retcode}] ${infoResp.message}`); + return; + } + info.value = infoResp; + console.log(info.value); +} + +async function refreshPosts(): Promise { postList.value = await postReq.collection(props.collection.collection_id); -}); +} -