chore: 保留ai-chat-popup 及 ai-chat-flaot组件

This commit is contained in:
2025-11-04 16:16:03 +08:00
parent 1c2fee28ec
commit 29280f6f57
12 changed files with 1735 additions and 661 deletions

View File

@@ -162,7 +162,7 @@
v-for="action in message.actions"
:key="action.id"
class="action-btn"
:class="action.type"
:class="[`iconfont`, action.icon, action.type]"
@click="handleAction(action, message)">
{{ action.text }}
</button>
@@ -246,7 +246,7 @@
</view>
<!-- 语音输入面板 -->
<view v-if="showVoicePanel" class="voice-popup">
<view v-if="enalbeVoicePanelShow" class="voice-popup">
<view class="voice-mask" @click="hideVoicePanel"></view>
<view class="voice-input-panel">
<view class="voice-header">
@@ -332,7 +332,7 @@ export default {
currentAudio: null,
messageId: 0,
showToolsPanel: false,
showVoicePanel: false,
enalbeVoicePanelShow: false,
streamingMessage: null, // 流式消息对象
streamInterval: null, // 流式更新定时器
streamContent: '', // 流式内容缓存
@@ -540,12 +540,12 @@ export default {
// 显示语音面板
showVoicePanel() {
this.showVoicePanel = true
this.enalbeVoicePanelShow = true
},
// 隐藏语音面板
hideVoicePanel() {
this.showVoicePanel = false
this.enalbeVoicePanelShow = false
this.voiceInputing = false
},
@@ -779,11 +779,16 @@ export default {
/* 页面样式 */
.ai-chat-container {
height: 100%;
height: 100vh;
display: flex;
flex-direction: column;
background-color: #f8f8f8;
overflow: hidden;
/* 微信小程序安全区域适配 */
padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
/* 确保在微信小程序中正确布局 */
position: relative;
}
.chat-messages {
@@ -791,7 +796,8 @@ export default {
padding: 20rpx;
overflow-y: auto;
box-sizing: border-box;
height: calc(100% - 200rpx); /* 减去输入区域高度 */
/* 微信小程序需要明确的flex布局 */
min-height: 0; /* 重要防止flex元素溢出 */
}
.load-more {
@@ -1162,11 +1168,13 @@ export default {
gap: 10rpx;
.action-btn {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
border: 2rpx solid #e9ecef;
// border: 2rpx solid #e9ecef;
background-color: white;
padding: 10rpx 20rpx;
display: flex;
align-items: center;
&.like {
color: #ff4544;
@@ -1185,6 +1193,13 @@ export default {
background-color: white;
border-top: 2rpx solid #eeeeee;
padding: 20rpx;
/* 确保在微信小程序中紧贴底部 */
flex-shrink: 0;
/* 微信小程序安全区域适配 */
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
/* 确保输入区域正确显示 */
position: relative;
z-index: 10;
}
.input-tools {