From e301ddc6ec55539cb7f6c9510e80c8b4e1622dd9 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Sat, 31 Jan 2026 17:04:50 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E5=BE=AE=E4=BF=A1=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=A0=87=E7=AD=BE=E6=A0=8F=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_tool/ai-chat/ai-chat-message.vue | 97 +++++++++++++------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index 579da6e..7730b65 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -1514,25 +1514,6 @@ $radius-lg: 36rpx; min-width: 0; width: 0; /* 添加这个属性防止flex元素溢出 */ - .message-nickname { - font-size: 24rpx; - color: $color-text-light; - margin-bottom: 8rpx; - letter-spacing: 0.5rpx; - // 用户昵称右对齐,AI昵称左对齐 - &:not(.ai-message .message-nickname) { - text-align: right; - } - // AI昵称专属样式 - 左移到气泡上方 - &.ai-nickname { - text-align: left; - margin-left: 0; - padding-left: 0; - align-self: flex-start; - margin-bottom: 4rpx; - } - } - .message-bubble { padding: 24rpx 32rpx; max-width: 100%; @@ -1952,6 +1933,28 @@ $radius-lg: 36rpx; } } + /* ========== 关键修复:拆分 .message-nickname 样式 ========== */ + .message-nickname { + font-size: 24rpx; + color: $color-text-light; + margin-bottom: 8rpx; + letter-spacing: 0.5rpx; + } + + /* 用户昵称:右对齐 */ + .user-message .message-nickname { + text-align: right; + } + + /* AI 昵称:使用 .ai-nickname 类控制 */ + .ai-nickname { + text-align: left; + margin-left: 0; + padding-left: 0; + align-self: flex-start; + margin-bottom: 4rpx; + } + /* 用户消息特有样式 */ .user-message { flex-direction: row-reverse; @@ -1963,19 +1966,19 @@ $radius-lg: 36rpx; .message-bubble { background: #c4e0ff !important; /* 浅蓝色 */ - color: black !important; - border-radius: 16rpx 16rpx 4rpx 16rpx; /* 右对齐气泡尖角适配 */ - box-shadow: 0 8rpx 20rpx rgba(196, 224, 255, 0.3) !important; - border: none !important; - /* ✅ 关键:允许内容撑开高度 */ - min-height: auto; - height: auto; - padding: 24rpx 32rpx; /* 保留内边距 */ - display: inline-block; /* 让宽度也随内容收缩(可选) */ - max-width: 80%; /* 防止过宽 */ - word-break: break-word; - white-space: pre-wrap; /* 保留用户输入的换行符 */ - line-height: 1.6; + color: black !important; + border-radius: 16rpx 16rpx 4rpx 16rpx; /* 右对齐气泡尖角适配 */ + box-shadow: 0 8rpx 20rpx rgba(196, 224, 255, 0.3) !important; + border: none !important; + /* ✅ 关键:允许内容撑开高度 */ + min-height: auto; + height: auto; + padding: 24rpx 32rpx; /* 保留内边距 */ + display: inline-block; /* 让宽度也随内容收缩(可选) */ + max-width: 80%; /* 防止过宽 */ + word-break: break-word; + white-space: pre-wrap; /* 保留用户输入的换行符 */ + line-height: 1.6; &::before { content: ''; position: absolute; @@ -2017,18 +2020,18 @@ $radius-lg: 36rpx; .message-bubble { background: white !important; /* 白色 */ - color: black !important; - border-radius: 16rpx 16rpx 16rpx 4rpx; /* 左对齐气泡尖角适配 */ - box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.1) !important; - border: 1rpx solid #e0e0e0 !important; + color: black !important; + border-radius: 16rpx 16rpx 16rpx 4rpx; /* 左对齐气泡尖角适配 */ + box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.1) !important; + border: 1rpx solid #e0e0e0 !important; min-height: auto; - height: auto; - padding: 24rpx 32rpx; - display: inline-block; - max-width: 80%; - word-break: break-word; - white-space: pre-wrap; - line-height: 1.6; + height: auto; + padding: 24rpx 32rpx; + display: inline-block; + max-width: 80%; + word-break: break-word; + white-space: pre-wrap; + line-height: 1.6; &::before { content: ''; position: absolute; @@ -2136,10 +2139,10 @@ $radius-lg: 36rpx; font-size: 28rpx; font-weight: 500; border: none; - text-align: center; /* 兼容多端文字居中 */ - white-space: nowrap; /* 强制文字单行横向显示 */ - line-height: 1; /* 重置行高,避免文字垂直偏移 */ - top:-10px; + text-align: center; /* 兼容多端文字居中 */ + white-space: nowrap; /* 强制文字单行横向显示 */ + line-height: 1; /* 重置行高,避免文字垂直偏移 */ + top: -10px; &.disabled { background-color: $color-primary-light;