From 02273e018f899e69039b433618c4344eaa915207 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 22 Aug 2025 13:11:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=89=8D=E7=AB=AFui=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/components/HeaderComponent.vue | 4 +- frontend_nuxt/components/MessageEditor.vue | 3 +- frontend_nuxt/pages/message-box/[id].vue | 48 ++++--------- frontend_nuxt/pages/message-box/index.vue | 71 ++++++++++---------- 4 files changed, 49 insertions(+), 77 deletions(-) diff --git a/frontend_nuxt/components/HeaderComponent.vue b/frontend_nuxt/components/HeaderComponent.vue index 5ec4446fb..5963eb5bc 100644 --- a/frontend_nuxt/components/HeaderComponent.vue +++ b/frontend_nuxt/components/HeaderComponent.vue @@ -47,9 +47,9 @@ - +
- + {{ unreadMessageCount }} diff --git a/frontend_nuxt/components/MessageEditor.vue b/frontend_nuxt/components/MessageEditor.vue index 865b1c127..d58a0b0bf 100644 --- a/frontend_nuxt/components/MessageEditor.vue +++ b/frontend_nuxt/components/MessageEditor.vue @@ -147,7 +147,6 @@ export default { .message-editor-container { border: 1px solid var(--border-color); border-radius: 8px; - margin-top: 20px; } .message-bottom-container { @@ -180,4 +179,4 @@ export default { .message-submit:not(.disabled):hover { background-color: var(--primary-color-hover); } - \ No newline at end of file + diff --git a/frontend_nuxt/pages/message-box/[id].vue b/frontend_nuxt/pages/message-box/[id].vue index 023eaea85..ff054ad85 100644 --- a/frontend_nuxt/pages/message-box/[id].vue +++ b/frontend_nuxt/pages/message-box/[id].vue @@ -22,7 +22,7 @@ {{ TimeManager.format(item.createdAt) }}
-
+
@@ -335,21 +335,22 @@ onUnmounted(() => { .chat-container { display: flex; flex-direction: column; - height: calc(100vh - 80px); /* Adjust based on your header/footer height */ margin: 0 auto; - border: 1px solid var(--border-color); - border-radius: 8px; - overflow: hidden; - background-color: var(--bg-color); + overflow: auto; + height: calc(100vh - var(--header-height)); position: relative; } .chat-header { display: flex; + position: sticky; + top: 0; + z-index: 100; align-items: center; padding: 10px 20px; - border-bottom: 1px solid var(--border-color); - background-color: var(--bg-color-soft); + border-bottom: 1px solid var(--normal-border-color); + background-color: var(--background-color-blur); + backdrop-filter: var(--blur-10); } .back-button { @@ -366,17 +367,13 @@ onUnmounted(() => { } .messages-list { - position: absolute; - top: 60px; /* Header height */ - bottom: 250px; /* Increased space for input area */ - left: 0; - right: 0; overflow-y: auto; padding: 20px; - padding-bottom: 40px; /* Extra padding at bottom */ + padding-bottom: 100px; display: flex; flex-direction: column; gap: 20px; + margin-bottom: 10px; } .load-more-container { @@ -415,16 +412,6 @@ onUnmounted(() => { flex-direction: column; } -.message-text { - font-size: 15px; - line-height: 1.5; - word-wrap: break-word; -} - -.message-text :deep(p) { - margin: 0; -} - .message-timestamp { font-size: 11px; color: var(--text-color-secondary); @@ -432,7 +419,6 @@ onUnmounted(() => { opacity: 0.6; } -/* Sent messages */ .message-item.sent { align-self: flex-end; flex-direction: row-reverse; @@ -458,17 +444,7 @@ onUnmounted(() => { } .message-input-area { - position: absolute; - bottom: 0; - left: 0; - right: 0; - min-height: 200px; - max-height: 400px; - padding: 10px 20px; - border-top: 1px solid var(--border-color); - background-color: var(--bg-color); - box-sizing: border-box; - overflow: visible; + margin-left: 20px; } .loading-container, diff --git a/frontend_nuxt/pages/message-box/index.vue b/frontend_nuxt/pages/message-box/index.vue index 6bb4958ee..36c4d5244 100644 --- a/frontend_nuxt/pages/message-box/index.vue +++ b/frontend_nuxt/pages/message-box/index.vue @@ -12,41 +12,39 @@
暂无会话
-
-
-
- +
+
+ +
+ +
+
+
+ {{ getOtherParticipant(convo)?.username || '未知用户' }} +
+
+ {{ formatTime(convo.lastMessage?.createdAt || convo.createdAt) }} +
-
-
-
- {{ getOtherParticipant(convo)?.username || '未知用户' }} -
-
- {{ formatTime(convo.lastMessage?.createdAt || convo.createdAt) }} -
+
+
+ {{ + convo.lastMessage ? stripMarkdownLength(convo.lastMessage.content, 100) : '暂无消息' + }}
- -
-
- {{ - convo.lastMessage ? stripMarkdownLength(convo.lastMessage.content, 100) : '暂无消息' - }} -
-
- {{ convo.unreadCount }} -
+
+ {{ convo.unreadCount }}
@@ -55,7 +53,7 @@