From 278645230a9e4218e2ddd769197c1c63fb78fd28 Mon Sep 17 00:00:00 2001
From: jing <1683105490@qq.com>
Date: Mon, 14 Sep 2026 08:57:45 +0800
Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E5=9B=9E=E7=AD=94=E8=A1=8C?=
=?UTF-8?q?=E8=B7=9D=E5=8F=98=E5=B0=8F=EF=BC=8C=E5=8A=A0=E4=B8=8A=E6=B0=94?=
=?UTF-8?q?=E6=B3=A1=EF=BC=8C=E9=9A=90=E8=97=8F=E6=B0=94=E6=B3=A1=E4=B8=8B?=
=?UTF-8?q?=E9=9D=A2=E7=9A=84"..."?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages_tool/ai-chat/ai-chat-message.vue | 58 ++++++++++++++++++++++----
1 file changed, 49 insertions(+), 9 deletions(-)
diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue
index 3ce309c..33dd9a1 100644
--- a/pages_tool/ai-chat/ai-chat-message.vue
+++ b/pages_tool/ai-chat/ai-chat-message.vue
@@ -1219,6 +1219,18 @@ _handleStreamError(msg) {
const TEXT = '#1a1a1a'
const LINK = '#3a7afe'
+ // 微信小程序端: 回答更紧凑 (行高/段距收紧, 不改变颜色与字号)
+ let COMPACT = false
+ /* #ifdef MP-WEIXIN */
+ COMPACT = true
+ /* #endif */
+ const LH = COMPACT ? '1.6' : '1.75'
+ const LI_LH = COMPACT ? '1.55' : '1.75'
+ const P_MARGIN = COMPACT ? '1rpx 0' : '2rpx 0'
+ const HR_MARGIN = COMPACT ? '10rpx 0' : '16rpx 0'
+ const BQ_MARGIN = COMPACT ? '6rpx 0' : '8rpx 0'
+ const BQ_LH = COMPACT ? '1.6' : '1.7'
+
// 辅助:内联格式处理
// 思路: 先把"链接/图片/裸URL/电话"整体抽成占位符保护起来, 再做加粗/斜体等,
// 最后还原, 避免各规则互相串改对方的 href / 数字。
@@ -1300,7 +1312,7 @@ _handleStreamError(msg) {
while (buf.length > 0 && buf[buf.length - 1] === '') buf.pop()
if (buf.length === 0) return
const content = buf.map(l => parseInline(l)).join('
')
- out.push(`
${content}
`)
+ out.push(`${content}
`)
buf = []
}
const flushTable = () => {
@@ -1355,7 +1367,7 @@ _handleStreamError(msg) {
const lv = hMatch[1].length
const size = ['', '36rpx', '32rpx', '30rpx', '28rpx', '26rpx', '24rpx'][lv]
const wgt = ['', '700', '700', '600', '600', '500', '500'][lv]
- const mg = ['', '20rpx 0 10rpx', '16rpx 0 8rpx', '14rpx 0 6rpx', '12rpx 0 6rpx', '10rpx 0 4rpx', '8rpx 0 4rpx'][lv]
+ const mg = COMPACT ? ['', '14rpx 0 7rpx', '12rpx 0 6rpx', '10rpx 0 5rpx', '8rpx 0 5rpx', '7rpx 0 3rpx', '6rpx 0 3rpx'][lv] : ['', '20rpx 0 10rpx', '16rpx 0 8rpx', '14rpx 0 6rpx', '12rpx 0 6rpx', '10rpx 0 4rpx', '8rpx 0 4rpx'][lv]
out.push(`${parseInline(hMatch[2])}`)
continue
}
@@ -1363,7 +1375,7 @@ _handleStreamError(msg) {
// 分隔线
if (/^(-{3,}|\*{3,}|_{3,})\s*$/.test(trimmed)) {
flushBuf(); out.push(closeList())
- out.push('
')
+ out.push('
')
continue
}
@@ -1371,7 +1383,7 @@ _handleStreamError(msg) {
const bqMatch = line.match(/^>\s?(.+)$/)
if (bqMatch) {
flushBuf(); out.push(closeList())
- out.push(`${parseInline(bqMatch[1])}
`)
+ out.push(`${parseInline(bqMatch[1])}
`)
continue
}
@@ -1380,7 +1392,7 @@ _handleStreamError(msg) {
if (ulMatch) {
flushBuf()
if (!inList) { out.push(''); inList = 'ul' }
- out.push(`- ${parseInline(ulMatch[1])}
`)
+ out.push(`- ${parseInline(ulMatch[1])}
`)
continue
}
@@ -1389,7 +1401,7 @@ _handleStreamError(msg) {
if (olMatch) {
flushBuf()
if (!inList) { out.push(''); inList = 'ol' }
- out.push(`- ${parseInline(olMatch[1])}
`)
+ out.push(`- ${parseInline(olMatch[1])}
`)
continue
}
@@ -3205,9 +3217,9 @@ _handleStreamError(msg) {
line-height: 1;
}
- &.more-btn .iconfont {
- font-size: 32rpx;
- letter-spacing: -2rpx;
+ /* 隐藏"更多(···)"按钮: 只保留 复制 / 点赞 / 不喜欢 */
+ &.more-btn {
+ display: none !important;
}
&.active {
@@ -3942,4 +3954,32 @@ _handleStreamError(msg) {
letter-spacing: 0.8rpx;
}
}
+
+/* ========== AI 回答: 高级质感卡片 (替换生硬蓝框, 更大气) ==========
+ 微渐变卡面 + 极细中性描边 + 多层柔和阴影 + 24rpx 大圆角, 去掉高饱和蓝框 */
+.ai-chat-container .chat-messages .message-item .ai-message .message-content .message-bubble {
+ position: relative !important;
+ background: #f5f5f5 !important;
+ border: 1rpx solid rgba(17, 24, 39, 0.05) !important;
+ border-radius: 24rpx !important;
+ padding: 26rpx 28rpx 26rpx 30rpx !important;
+ box-shadow:
+ 0 1rpx 2rpx rgba(16, 24, 40, 0.04),
+ 0 10rpx 24rpx rgba(16, 24, 40, 0.05),
+ 0 28rpx 56rpx rgba(16, 24, 40, 0.045) !important;
+}
+
+/* 昵称更精致 */
+.ai-chat-container .chat-messages .message-item .ai-message .message-content .message-nickname .ai-nickname-text {
+ color: #3a4353 !important;
+ font-weight: 600;
+ letter-spacing: 0.4rpx;
+}
+
+/* #ifdef MP-WEIXIN */
+/* 微信小程序: 回答更紧凑 (内边距略收紧, 质感与颜色不变) */
+.ai-chat-container .chat-messages .message-item .ai-message .message-content .message-bubble {
+ padding: 20rpx 22rpx 20rpx 24rpx !important;
+}
+/* #endif */