🚸 处理未选择版块帖子

This commit is contained in:
BTMuli
2025-08-09 16:29:47 +08:00
parent b65d60eae9
commit 5cc48c9438

View File

@@ -10,10 +10,16 @@
PostID{{ postId }} | Render by TeyvatGuide v{{ appVersion }}
</div>
<div class="tp-post-meta">
<div class="mpm-forum" v-if="postData.forum" @click="toForum(postData.forum)">
<TMiImg :src="getGameIcon(postData.forum.game_id)" alt="gameIcon" />
<TMiImg :src="postData.forum.icon" alt="forumIcon" :ori="true" />
<span>{{ postData.forum.name }}</span>
<div class="mpm-forum">
<TMiImg
:src="getGameIcon(postData?.forum?.game_id || postData.post.game_id)"
alt="gameIcon"
@click="toGame(postData?.forum?.game_id || postData.post.game_id)"
/>
<div v-if="postData.forum" @click="toForum(postData.forum)">
<TMiImg :src="postData.forum.icon" alt="forumIcon" :ori="true" />
<span>{{ postData.forum.name }}</span>
</div>
</div>
<div class="mpm-item" :title="`浏览数:${postData?.stat?.view_num}`">
<v-icon>mdi-eye</v-icon>
@@ -189,6 +195,7 @@ onMounted(async () => {
return;
}
postData.value = resp;
console.log(resp);
isLike.value = postData.value.self_operation.upvote_type !== 0;
await showLoading.update("正在渲染数据");
renderPost.value = await getRenderPost(postData.value);
@@ -345,6 +352,10 @@ async function toTopic(topic: TGApp.BBS.Post.Topic): Promise<void> {
await emit("active_deep_link", `router?path=/posts/topic/${gid}/${topic.id}`);
}
async function toGame(gameId: number): Promise<void> {
await emit("active_deep_link", `router?path=/posts/forum/${gameId}`);
}
async function toForum(forum: TGApp.BBS.Post.Forum): Promise<void> {
await emit("active_deep_link", `router?path=/posts/forum/${forum.game_id}/${forum.id}`);
}