feat: 探索发现的接口 呼叫服务
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
.create-service-order {
|
.create-service-order {
|
||||||
margin-left: 12px;
|
// margin-left: 12px;
|
||||||
margin-right: 12px;
|
// margin-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-service-wrapper {
|
.create-service-wrapper {
|
||||||
box-sizing: border-box;
|
// box-sizing: border-box;
|
||||||
padding: 12px 12px 16px;
|
padding: 12px 0 16px;
|
||||||
background-color: #eff6fa;
|
// background-color: #eff6fa;
|
||||||
box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.1);
|
// box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 4px 20px 20px 20px;
|
// border-radius: 4px 20px 20px 20px;
|
||||||
border: 1px solid #fff;
|
// border: 1px solid #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-header {
|
.order-header {
|
||||||
|
|||||||
@@ -12,5 +12,7 @@ export const MessageType = {
|
|||||||
|
|
||||||
|
|
||||||
export const CompName = {
|
export const CompName = {
|
||||||
quickBookingCard: 'quickBookingCard'
|
quickBookingCard: 'quickBookingCard',
|
||||||
|
createWorkOrderCard: 'createWorkOrderCard',
|
||||||
|
discoveryCard: 'discoveryCard',
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
import QuickBookingContentList from './QuickBookingContentList.vue'
|
import QuickBookingContentList from './QuickBookingContentList.vue'
|
||||||
import { ref, nextTick } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { quickBookingComponent } from '../../request/api/QuickBookingComponent'
|
import { quickBookingComponent } from '../../request/api/MainPageDataApi'
|
||||||
import { SCROLL_TO_BOTTOM } from '../../constant/constant'
|
import { SCROLL_TO_BOTTOM } from '../../constant/constant'
|
||||||
|
|
||||||
const commodityGroupDTOList = ref([])
|
const commodityGroupDTOList = ref([])
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="chat-ai">
|
<view class="container">
|
||||||
<ChatMarkdown :text="text"></ChatMarkdown>
|
<view class="chat-ai">
|
||||||
<slot></slot>
|
<ChatMarkdown :text="text"></ChatMarkdown>
|
||||||
|
<slot name="content"></slot>
|
||||||
|
</view>
|
||||||
|
<slot name="footer"></slot>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -15,34 +18,26 @@
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.chat-ai {
|
.container {
|
||||||
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;
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: 100%; // ✅ 限制最大宽度
|
max-width: 100%; // ✅ 限制最大宽度
|
||||||
overflow-x: hidden; // ✅ 防止横向撑开
|
overflow-x: hidden; // ✅ 防止横向撑开
|
||||||
|
|
||||||
text {
|
.chat-ai {
|
||||||
font-family: PingFang SC, PingFang SC;
|
margin: 6px 12px;
|
||||||
font-weight: 400;
|
padding: 0 12px;
|
||||||
font-size: 14px;
|
|
||||||
color: #333333;
|
min-width: 80px;
|
||||||
line-height: 22px;
|
background: rgba(255,255,255,0.4);
|
||||||
text-align: justify;
|
box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.1);
|
||||||
font-style: normal;
|
border-radius: 4px 20px 20px 20px;
|
||||||
text-transform: none;
|
border: 1px solid;
|
||||||
|
border-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -27,8 +27,13 @@
|
|||||||
<view class="area-msg-list-content" v-for="item in chatMsgList" :key="item.msgId" :id="item.msgId">
|
<view class="area-msg-list-content" v-for="item in chatMsgList" :key="item.msgId" :id="item.msgId">
|
||||||
<template v-if="item.msgType === MessageRole.AI">
|
<template v-if="item.msgType === MessageRole.AI">
|
||||||
<ChatCardAI class="message-item-ai" :text="item.msg">
|
<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"/>
|
<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>
|
</template>
|
||||||
</ChatCardAI>
|
</ChatCardAI>
|
||||||
</template>
|
</template>
|
||||||
@@ -37,6 +42,7 @@
|
|||||||
<ChatCardMine class="message-item-mine" :text="item.msg">
|
<ChatCardMine class="message-item-mine" :text="item.msg">
|
||||||
</ChatCardMine>
|
</ChatCardMine>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<ChatCardOther class="message-item-other" :text="item.msg">
|
<ChatCardOther class="message-item-other" :text="item.msg">
|
||||||
<OneFeelMK001 v-if="mainPageDataModel.activityList.length > 0" :activityList="mainPageDataModel.activityList"/>
|
<OneFeelMK001 v-if="mainPageDataModel.activityList.length > 0" :activityList="mainPageDataModel.activityList"/>
|
||||||
@@ -73,6 +79,9 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { defineEmits } from 'vue'
|
import { defineEmits } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
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 ChatTopWelcome from './ChatTopWelcome.vue';
|
||||||
import ChatTopBgImg from './ChatTopBgImg.vue';
|
import ChatTopBgImg from './ChatTopBgImg.vue';
|
||||||
import ChatTopNavBar from './ChatTopNavBar.vue';
|
import ChatTopNavBar from './ChatTopNavBar.vue';
|
||||||
@@ -84,16 +93,19 @@
|
|||||||
import ChatInputArea from './ChatInputArea.vue'
|
import ChatInputArea from './ChatInputArea.vue'
|
||||||
import CommandWrapper from '@/components/CommandWrapper/index.vue'
|
import CommandWrapper from '@/components/CommandWrapper/index.vue'
|
||||||
import QuickBookingComponent from '../booking/QuickBookingComponent.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 OneFeelMK001 from '../module/OneFeelMK001.vue';
|
||||||
import OneFeelMK002 from '../module/OneFeelMK002.vue';
|
import OneFeelMK002 from '../module/OneFeelMK002.vue';
|
||||||
|
|
||||||
import { agentChatStream } from '../../request/api/AgentChatStream';
|
import { agentChatStream } from '../../request/api/AgentChatStream';
|
||||||
import { mainPageData } from '../../request/api/MainPageData';
|
import { mainPageData } from '../../request/api/MainPageDataApi';
|
||||||
import { conversationMsgList } from '../../request/api/ConversationMsgList';
|
import { conversationMsgList, recentConversation } from '../../request/api/ConversationApi';
|
||||||
import { recentConversation } from '../../request/api/RecentConversation';
|
|
||||||
import { SCROLL_TO_BOTTOM } from '../../constant/constant'
|
|
||||||
|
|
||||||
/// 导航栏相关
|
/// 导航栏相关
|
||||||
const statusBarHeight = ref(20);
|
const statusBarHeight = ref(20);
|
||||||
|
|||||||
42
pages/discovery/DiscoveryCardComponent.vue
Normal file
42
pages/discovery/DiscoveryCardComponent.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view v-for="item in themeDTOList" :key="item.title">
|
||||||
|
<DiscoveryCradContentList :recommendTheme="item" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, nextTick } from 'vue'
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
import { discoveryCradComponent } from '../../request/api/MainPageDataApi'
|
||||||
|
import { SCROLL_TO_BOTTOM } from '../../constant/constant'
|
||||||
|
import DiscoveryCradContentList from './DiscoveryCradContentList.vue'
|
||||||
|
|
||||||
|
const themeDTOList = ref([])
|
||||||
|
|
||||||
|
const loadDiscoveryCradComponent = async () => {
|
||||||
|
const res = await discoveryCradComponent()
|
||||||
|
if(res.code === 0 && res.data) {
|
||||||
|
themeDTOList.value.push(...res.data.themeDTOList)
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
uni.$emit(SCROLL_TO_BOTTOM, true)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
console.log('=============')
|
||||||
|
loadDiscoveryCradComponent()
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
flex: 1;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
85
pages/discovery/DiscoveryCradContentList.vue
Normal file
85
pages/discovery/DiscoveryCradContentList.vue
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="mk-title">
|
||||||
|
<text class="title"> {{ recommendTheme.themeName }}</text>
|
||||||
|
<image class="wave" src="@/static/wave_icon.png" mode="widthFix"/>
|
||||||
|
</view>
|
||||||
|
<view class="container-scroll">
|
||||||
|
<view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index">
|
||||||
|
<image :src="item.coverPhoto" mode="widthFix"></image>
|
||||||
|
<text>{{ item.topic }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { defineProps } from 'vue'
|
||||||
|
const props = defineProps({
|
||||||
|
recommendTheme: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.container {
|
||||||
|
.mk-title {
|
||||||
|
padding: 4px 0;
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
.title {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #000000;
|
||||||
|
z-index: 2;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.wave {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 2px;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-scroll {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
overflow-x: auto;
|
||||||
|
margin-top: 4px;
|
||||||
|
|
||||||
|
/* 隐藏滚动条 */
|
||||||
|
scrollbar-width: none;
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mk-card-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: start;
|
||||||
|
width: 188px;
|
||||||
|
height: 154px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-right: 8px;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 188px;
|
||||||
|
height: 112px;
|
||||||
|
}
|
||||||
|
text {
|
||||||
|
padding: 12px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
16
request/api/ConversationApi.js
Normal file
16
request/api/ConversationApi.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import request from "../base/request";
|
||||||
|
|
||||||
|
/// 最近会话
|
||||||
|
function recentConversation() {
|
||||||
|
return request.get('/hotelBiz/chat/recentConversation');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 会话消息列表
|
||||||
|
function conversationMsgList(args) {
|
||||||
|
return request.post('/hotelBiz/chat/conversationMessageList', args);
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
recentConversation,
|
||||||
|
conversationMsgList
|
||||||
|
};
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import request from "../base/request";
|
|
||||||
|
|
||||||
function conversationMsgList(args) {
|
|
||||||
return request.post('/hotelBiz/chat/conversationMessageList', args);
|
|
||||||
}
|
|
||||||
|
|
||||||
export { conversationMsgList }
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import request from "../base/request";
|
|
||||||
|
|
||||||
function mainPageData(sceneId) {
|
|
||||||
const args = { sceneId : sceneId}
|
|
||||||
return request.post('/hotelBiz/mainScene/mainPageData', args);
|
|
||||||
}
|
|
||||||
|
|
||||||
export { mainPageData }
|
|
||||||
26
request/api/MainPageDataApi.js
Normal file
26
request/api/MainPageDataApi.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import request from "../base/request";
|
||||||
|
|
||||||
|
/// 主页数据
|
||||||
|
function mainPageData(sceneId) {
|
||||||
|
const args = { sceneId : sceneId}
|
||||||
|
return request.post('/hotelBiz/mainScene/mainPageData', args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// 快速预订组件
|
||||||
|
function quickBookingComponent(selectedData) {
|
||||||
|
const args = { selectedData: selectedData }
|
||||||
|
return request.post('/hotelBiz/mainScene/quickBookingComponent', args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 探索发现卡片组件
|
||||||
|
function discoveryCradComponent() {
|
||||||
|
return request.get('/hotelBiz/mainScene//discoveryComponent', {});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export {
|
||||||
|
mainPageData,
|
||||||
|
quickBookingComponent,
|
||||||
|
discoveryCradComponent
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import request from "../base/request";
|
|
||||||
|
|
||||||
function quickBookingComponent(selectedData) {
|
|
||||||
const args = { selectedData: selectedData }
|
|
||||||
return request.post('/hotelBiz/mainScene/quickBookingComponent', args);
|
|
||||||
}
|
|
||||||
|
|
||||||
export { quickBookingComponent }
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import request from "../base/request";
|
|
||||||
|
|
||||||
function recentConversation() {
|
|
||||||
return request.get('/hotelBiz/chat/recentConversation');
|
|
||||||
}
|
|
||||||
|
|
||||||
export{ recentConversation }
|
|
||||||
Reference in New Issue
Block a user