From 2a5bff108639a9cb973f8bce0ae6e13213b92487 Mon Sep 17 00:00:00 2001 From: tim Date: Sun, 10 Aug 2025 12:26:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E5=9C=B0=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AEfixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/components/CommentEditor.vue | 6 +++++- frontend_nuxt/components/CommentItem.vue | 6 ++++-- frontend_nuxt/components/MenuComponent.vue | 5 ----- frontend_nuxt/pages/posts/[id]/index.vue | 8 ++++++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/frontend_nuxt/components/CommentEditor.vue b/frontend_nuxt/components/CommentEditor.vue index 307b944b1..13b822c6e 100644 --- a/frontend_nuxt/components/CommentEditor.vue +++ b/frontend_nuxt/components/CommentEditor.vue @@ -47,6 +47,10 @@ export default { showLoginOverlay: { type: Boolean, default: false + }, + parentUserName: { + type: String, + default: '' } }, components: { LoginOverlay }, @@ -71,7 +75,7 @@ export default { if (!vditorInstance.value || isDisabled.value) return const value = vditorInstance.value.getValue() console.debug('CommentEditor submit', value) - emit('submit', value, () => { + emit('submit', props.parentUserName, value, () => { if (!vditorInstance.value) return vditorInstance.value.setValue('') text.value = '' diff --git a/frontend_nuxt/components/CommentItem.vue b/frontend_nuxt/components/CommentItem.vue index d2ee2d415..174189afb 100644 --- a/frontend_nuxt/components/CommentItem.vue +++ b/frontend_nuxt/components/CommentItem.vue @@ -44,7 +44,7 @@
+ :show-login-overlay="!loggedIn" :parent-user-name="comment.userName" />
@@ -164,7 +164,7 @@ const CommentItem = { toast.error('操作失败') } } - const submitReply = async (text, clear) => { + const submitReply = async (parentUserName, text, clear) => { if (!text.trim()) return isWaitingForReply.value = true const token = getToken() @@ -190,7 +190,9 @@ const CommentItem = { userName: data.author.username, time: TimeManager.format(data.createdAt), avatar: data.author.avatar, + medal: data.author.displayMedal, text: data.content, + parentUserName: parentUserName, reactions: [], reply: (data.replies || []).map(r => ({ id: r.id, diff --git a/frontend_nuxt/components/MenuComponent.vue b/frontend_nuxt/components/MenuComponent.vue index 3f78ecfa4..6d0297c34 100644 --- a/frontend_nuxt/components/MenuComponent.vue +++ b/frontend_nuxt/components/MenuComponent.vue @@ -153,11 +153,6 @@ export default { isLoadingTag.value = false } - onMounted(() => { - // fetchCategoryData() - // fetchTagData() - }) - const iconClass = computed(() => { switch (themeState.mode) { case ThemeMode.DARK: diff --git a/frontend_nuxt/pages/posts/[id]/index.vue b/frontend_nuxt/pages/posts/[id]/index.vue index da071cd27..3bc8bb7f5 100644 --- a/frontend_nuxt/pages/posts/[id]/index.vue +++ b/frontend_nuxt/pages/posts/[id]/index.vue @@ -21,11 +21,15 @@
-
订阅文章
+
+ {{ isMobile ? '订阅' : '订阅文章' }} +
-
取消订阅
+
+ {{ isMobile ? '退订' : '取消订阅' }} +