From 524280d81667669e3693b7711db082ff19914d5e Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Thu, 16 Apr 2026 11:00:50 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E6=99=BA=E8=83=BD=E5=8A=A9?= =?UTF-8?q?=E6=89=8B=E5=8A=A0=E4=BA=86=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_tool/ai-chat/ai-chat-message.vue | 41 ++++++++++++++++---------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index eacbd24..c7ca09e 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -30,7 +30,14 @@ - {{ localUserNickname }} + + {{ localUserNickname }} + {{ formatTime(message.timestamp) }} + + + + {{ formatTime(message.timestamp) }} + {{ message.content }} @@ -51,7 +58,10 @@ - 智能助手 + + 智能助手 + {{ formatTime(message.timestamp) }} + @@ -1032,20 +1042,9 @@ async loadChatHistoryIfExist() { // 格式化时间 formatTime(timestamp) { const date = new Date(timestamp) - const now = new Date() - const diff = now - date - - if (diff < 60000) { // 1分钟内 - return '刚刚' - } else if (diff < 3600000) { // 1小时内 - return Math.floor(diff / 60000) + '分钟前' - } else if (diff < 86400000) { // 1天内 - return Math.floor(diff / 3600000) + '小时前' - } else { - return date.getMonth() + 1 + '月' + date.getDate() + '日 ' + - date.getHours().toString().padStart(2, '0') + ':' + - date.getMinutes().toString().padStart(2, '0') - } + const hours = date.getHours().toString().padStart(2, '0') + const minutes = date.getMinutes().toString().padStart(2, '0') + return hours + ':' + minutes }, // 格式化文件大小 @@ -2093,11 +2092,20 @@ $radius-lg: 36rpx; color: $color-text-light; margin-bottom: 8rpx; letter-spacing: 0.5rpx; + display: flex; + align-items: center; + gap: 12rpx; + + .message-time { + font-size: 20rpx; + color: #999; + } } /* 用户昵称:右对齐 */ .user-message .message-nickname { text-align: right; + justify-content: flex-end; } /* AI 昵称:使用 .ai-nickname 类控制 */ @@ -2107,6 +2115,7 @@ $radius-lg: 36rpx; padding-left: 0; align-self: flex-start; margin-bottom: 4rpx; + justify-content: flex-start; } /* 用户消息特有样式 */