feat: 探索发现的接口 呼叫服务

This commit is contained in:
2025-08-02 16:23:37 +08:00
parent b8f2af1f95
commit ec3413833d
13 changed files with 217 additions and 69 deletions

View File

@@ -1,7 +1,10 @@
<template>
<view class="chat-ai">
<ChatMarkdown :text="text"></ChatMarkdown>
<slot></slot>
<view class="container">
<view class="chat-ai">
<ChatMarkdown :text="text"></ChatMarkdown>
<slot name="content"></slot>
</view>
<slot name="footer"></slot>
</view>
</template>
@@ -15,34 +18,26 @@
default: ''
}
})
</script>
<style lang="scss" scoped>
.chat-ai {
margin: 6px 12px;
padding: 0 12px;
min-width: 80px;
background: rgba(255,255,255,0.4);
box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.1);
border-radius: 4px 20px 20px 20px;
border: 1px solid;
border-color: #FFFFFF;
.container {
display: flex;
flex-direction: column;
max-width: 100%; // ✅ 限制最大宽度
overflow-x: hidden; // ✅ 防止横向撑开
text {
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 22px;
text-align: justify;
font-style: normal;
text-transform: none;
.chat-ai {
margin: 6px 12px;
padding: 0 12px;
min-width: 80px;
background: rgba(255,255,255,0.4);
box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.1);
border-radius: 4px 20px 20px 20px;
border: 1px solid;
border-color: #FFFFFF;
}
}
</style>

View File

@@ -27,8 +27,13 @@
<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-ai" :text="item.msg">
<template v-if="item.toolCall">
<template #content v-if="item.toolCall">
<QuickBookingComponent v-if="item.toolCall.componentName === CompName.quickBookingCard"/>
<DiscoveryCardComponent v-else-if="item.toolCall.componentName === CompName.discoveryCard"/>
<CreateServiceOrder v-else-if="item.toolCall.componentName === CompName.createWorkOrderCard"/>
</template>
<template #footer >
<text> 这个是底部 </text>
</template>
</ChatCardAI>
</template>
@@ -37,6 +42,7 @@
<ChatCardMine class="message-item-mine" :text="item.msg">
</ChatCardMine>
</template>
<template v-else>
<ChatCardOther class="message-item-other" :text="item.msg">
<OneFeelMK001 v-if="mainPageDataModel.activityList.length > 0" :activityList="mainPageDataModel.activityList"/>
@@ -73,6 +79,9 @@
import { ref } from 'vue'
import { defineEmits } from 'vue'
import { onLoad } from '@dcloudio/uni-app';
import { SCROLL_TO_BOTTOM } from '../../constant/constant'
import { MessageRole, MessageType, CompName } from '../../model/ChatModel';
import ChatTopWelcome from './ChatTopWelcome.vue';
import ChatTopBgImg from './ChatTopBgImg.vue';
import ChatTopNavBar from './ChatTopNavBar.vue';
@@ -84,16 +93,19 @@
import ChatInputArea from './ChatInputArea.vue'
import CommandWrapper from '@/components/CommandWrapper/index.vue'
import QuickBookingComponent from '../booking/QuickBookingComponent.vue'
import DiscoveryCardComponent from '../discovery/DiscoveryCardComponent.vue';
import CreateServiceOrder from '@/components/CreateServiceOrder/index.vue'
import { MessageRole, MessageType, CompName } from '../../model/ChatModel';
import OneFeelMK001 from '../module/OneFeelMK001.vue';
import OneFeelMK002 from '../module/OneFeelMK002.vue';
import { agentChatStream } from '../../request/api/AgentChatStream';
import { mainPageData } from '../../request/api/MainPageData';
import { conversationMsgList } from '../../request/api/ConversationMsgList';
import { recentConversation } from '../../request/api/RecentConversation';
import { SCROLL_TO_BOTTOM } from '../../constant/constant'
import { mainPageData } from '../../request/api/MainPageDataApi';
import { conversationMsgList, recentConversation } from '../../request/api/ConversationApi';
/// 导航栏相关
const statusBarHeight = ref(20);