chore:微信小程序真机可以自定义复制

This commit is contained in:
2026-09-23 15:04:27 +08:00
parent f8115f47fd
commit c0e432cc22

View File

@@ -157,7 +157,8 @@
<text v-if="!message.isStreaming" class="thought-toggle">{{ message.thoughtExpanded === false ? '▶' : '▼' }}</text>
</view>
<view v-if="message.isStreaming || message.thoughtExpanded !== false" class="thought-content">
<text>{{ message.thoughtsText }}</text>
<!-- PR-CHAT-SELECTABLE (2026-09-23): 思考过程文本同样支持长按选中复制 -->
<text selectable>{{ message.thoughtsText }}</text>
</view>
</view>
@@ -169,7 +170,9 @@
<!-- 文本消息:小程序用 text selectable,H5 用可选择的 HTML 渲染 -->
<view v-if="message.type === 'text'" class="text-content">
<!-- #ifdef MP-WEIXIN -->
<rich-text class="ai-message-rich" :nodes="getAIDisplayContent(message.content)"></rich-text>
<!-- PR-CHAT-SELECTABLE (2026-09-23): rich-text 不支持文本选中, 改用 mp-html + selectable
开启原生长按选中(剪切/复制/粘贴/全选); force 同时兼容微信 iOS -->
<mp-html class="ai-message-rich" :content="getAIDisplayContent(message.content)" selectable="force" />
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="ai-message-text selectable-md" v-html="getAIDisplayContent(message.content)"></view>
@@ -184,7 +187,8 @@
</view>
<view class="markdown-body">
<!-- #ifdef MP-WEIXIN -->
<rich-text class="ai-message-rich" :nodes="getAIDisplayContent(message.content)"></rich-text>
<!-- PR-CHAT-SELECTABLE (2026-09-23): 同上, mp-html + selectable 支持长按选中复制 -->
<mp-html class="ai-message-rich" :content="getAIDisplayContent(message.content)" selectable="force" />
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="selectable-md" v-html="getAIDisplayContent(message.content)"></view>
@@ -3989,10 +3993,10 @@ _handleStreamError(msg) {
margin-bottom: 16rpx;
padding: 12rpx 24rpx;
background: #ffffff;
border: 1rpx solid #1E9FFF;
border: 1rpx solid #1a1a1a;
border-radius: 32rpx;
font-size: 26rpx;
color: #1E9FFF;
color: #1a1a1a;
cursor: pointer;
transition: all 0.2s ease;
max-width: 100%;
@@ -4012,10 +4016,10 @@ _handleStreamError(msg) {
}
.quick-question-chip--hover {
background: #1E9FFF;
background: #1a1a1a;
color: #ffffff;
transform: translateY(-1rpx);
box-shadow: 0 4rpx 12rpx rgba(30, 159, 255, 0.2);
box-shadow: 0 4rpx 12rpx rgba(26, 26, 26, 0.2);
}
}
@@ -5153,9 +5157,11 @@ _handleStreamError(msg) {
}
}
// H5 下允许 rich-text / v-html 内容文本选择(鼠标拖选复制)
// H5 下允许 rich-text / v-html 内容文本选择(鼠标/长按拖选, 复制、全选等由浏览器原生菜单提供)
.text-content,
.markdown-content,
.markdown-body,
.ai-message-text,
.selectable-md {
user-select: text;
-webkit-user-select: text;
@@ -5560,4 +5566,5 @@ _handleStreamError(msg) {
border-radius: 0 0 0 14rpx;
}
}
</style>