From d8f4a4c2bfc53a400786476aa3903cb7203751b5 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 14 Mar 2026 13:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E8=B0=83=E6=95=B4=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=A4=84=E7=90=86=E7=82=B9=E5=87=BB=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/app/t-postcard.vue | 39 +++++++++---------- src/components/viewPost/tp-avatar.vue | 4 +- .../viewPost/vp-overlay-collection.vue | 12 +++++- src/components/viewPost/vp-overlay-follow.vue | 6 +-- .../viewPost/vp-overlay-lottery.vue | 9 ++++- src/components/viewPost/vp-overlay-search.vue | 15 +++++-- src/components/viewPost/vp-overlay-user.vue | 7 ++-- src/pages/common/PostCollect.vue | 5 +-- src/pages/common/PostForum.vue | 2 +- src/pages/common/PostNews.vue | 4 +- src/pages/common/PostTopic.vue | 2 +- 11 files changed, 64 insertions(+), 41 deletions(-) diff --git a/src/components/app/t-postcard.vue b/src/components/app/t-postcard.vue index 86db6a88..cd64f45d 100644 --- a/src/components/app/t-postcard.vue +++ b/src/components/app/t-postcard.vue @@ -19,23 +19,18 @@
mdi-folder-multiple-image - {{ props.modelValue.post.images.length }} + {{ props.post.post.images.length }}
{{ card.title }}
- +
@@ -104,9 +99,9 @@ @click.stop="trySelect()" />
- {{ props.modelValue.post.post_id }} + {{ props.post.post.post_id }}
@@ -126,10 +121,12 @@ import { storeToRefs } from "pinia"; import { computed, onMounted, ref, shallowRef, watch } from "vue"; import { useRoute, useRouter } from "vue-router"; +/** 帖子卡片参数 */ type TPostCardProps = { - modelValue: TGApp.BBS.Post.FullData; + /** 帖子数据 */ + post: TGApp.BBS.Post.FullData; + /** 是否开启选择模式 */ selectMode?: boolean; - userClick?: boolean; }; type TPostCardEmits = { (e: "onSelected", v: string): void; @@ -178,17 +175,17 @@ const cardBg = computed(() => { const forumBg = computed(() => str2Color(`${card.value?.forum?.id}${card.value?.forum?.icon}${card.value?.forum?.name}`, -60), ); -const idBg = computed(() => str2Color(`${props.modelValue.post.post_id}`, 0)); +const idBg = computed(() => str2Color(`${props.post.post.post_id}`, 0)); -onMounted(async () => (card.value = getPostCard(props.modelValue))); +onMounted(async () => (card.value = getPostCard(props.post))); watch( - () => props.modelValue, - async () => (card.value = getPostCard(props.modelValue)), + () => props.post, + async () => (card.value = getPostCard(props.post)), ); function trySelect(): void { - if (props.selectMode) emits("onSelected", props.modelValue.post.post_id); + if (props.selectMode) emits("onSelected", props.post.post.post_id); isSelected.value = !isSelected.value; } @@ -293,20 +290,20 @@ async function shareCard(): Promise { async function toTopic(topic: TGApp.BBS.Post.Topic): Promise { if (props.selectMode) return; - const gid = props.modelValue.post.game_id; + const gid = props.post.post.game_id; await emit("active_deep_link", `router?path=/posts/topic/${gid}/${topic.id}`); } async function toForum(forum: RenderForum): Promise { if (props.selectMode) return; - const gid = props.modelValue.post.game_id; + const gid = props.post.post.game_id; await emit("active_deep_link", `router?path=/posts/forum/${gid}/${forum.id}`); } function onUserClick(): void { if (props.selectMode) return; if (!card.value || card.value.user === null) return; - emits("onUserClick", card.value.user, props.modelValue.post.game_id); + emits("onUserClick", card.value.user, props.post.post.game_id); }