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); -}); +} -