feat: 代码调整

This commit is contained in:
2025-07-24 23:59:31 +08:00
parent 17f4f0fb8b
commit 5321b27176
5 changed files with 68 additions and 26 deletions

View File

@@ -23,19 +23,20 @@
<view class="area-msg-list-content" v-for="item in chatMsgList" :key="item.msgId" :id="item.msgId">
<template v-if="item.msgType === MessageRole.AI">
<ChatCardAI class="message-item message-item-ai" :text="item.msg">
<ChatCardAI class="message-item-ai" :text="item.msg">
<image v-if="item.msgContent && item.msgContent.type === MessageType.IMAGE" src="/static/logo.png" style="width: 100px;height: 100px;"></image>
</ChatCardAI>
</template>
<template v-else-if="item.msgType === MessageRole.ME">
<ChatCardMine class="message-item message-item-mine" :text="item.msg">
<ChatCardMine class="message-item-mine" :text="item.msg">
</ChatCardMine>
</template>
<template v-else>
<text class="message-item message-item-other">{{item.msg}}</text>
<ChatCardOther class="message-item-other" :text="item.msg"></ChatCardOther>
</template>
</view>
<!-- 底部锚点用于滚动到底部 -->
<view :id="lastMsgId"></view>
</scroll-view>
@@ -65,6 +66,7 @@
import ChatTopNavBar from './ChatTopNavBar.vue';
import ChatCardAI from './ChatCardAI.vue';
import ChatCardMine from './ChatCardMine.vue';
import ChatCardOther from './ChatCardOther.vue';
import ChatQuickAccess from './ChatQuickAccess.vue';
import ChatMoreTips from './ChatMoreTips.vue';
import ChatInputArea from './ChatInputArea.vue'
@@ -167,10 +169,9 @@
}
chatMsgList.value.push(newMsg)
sendChat('酒店一共有哪些温泉?')
console.log("发送的新消息:",JSON.stringify(newMsg))
sendChat(text)
}
const scrollToBottom = () => {