Compare commits

..

No commits in common. "64225300577a0c4f8fa24f96159cdfab1169505d" and "42c5354978e83ac2081feca06cf79af19fdf88fb" have entirely different histories.

4 changed files with 5 additions and 78 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<view class="chat-ai"> <view class="chat-ai">
<ChatMarkdown :text="text"></ChatMarkdown> <ChatMarkdown v-if="text.length > 0" :text="text"></ChatMarkdown>
<slot name="content"></slot> <slot name="content"></slot>
</view> </view>
<slot name="footer"></slot> <slot name="footer"></slot>

View File

@ -33,8 +33,7 @@
<CreateServiceOrder v-else-if="item.toolCall.componentName === CompName.createWorkOrderCard"/> <CreateServiceOrder v-else-if="item.toolCall.componentName === CompName.createWorkOrderCard"/>
</template> </template>
<template #footer > <template #footer >
<!-- 这个是底部 --> <!-- <text> 这个是底部 </text> -->
<AttachListComponent v-if="item.question" :question="item.question" @replySent="handleReply"/>
</template> </template>
</ChatCardAI> </ChatCardAI>
</template> </template>
@ -94,7 +93,6 @@
import DiscoveryCardComponent from '../module/discovery/DiscoveryCardComponent.vue'; import DiscoveryCardComponent from '../module/discovery/DiscoveryCardComponent.vue';
import ActivityListComponent from '../module/banner/ActivityListComponent.vue'; import ActivityListComponent from '../module/banner/ActivityListComponent.vue';
import RecommendPostsComponent from '../module/recommend/RecommendPostsComponent.vue'; import RecommendPostsComponent from '../module/recommend/RecommendPostsComponent.vue';
import AttachListComponent from '../module/attach/AttachListComponent.vue';
import CreateServiceOrder from '@/components/CreateServiceOrder/index.vue' import CreateServiceOrder from '@/components/CreateServiceOrder/index.vue'
@ -367,6 +365,7 @@
if (chunk && chunk.finish) { if (chunk && chunk.finish) {
// //
const finishInterval = setInterval(() => { const finishInterval = setInterval(() => {
console.log('aiMsgBuffer.length:', aiMsgBuffer.length)
if (aiMsgBuffer.length === 0) { if (aiMsgBuffer.length === 0) {
clearInterval(finishInterval); clearInterval(finishInterval);
clearInterval(loadingTimer); clearInterval(loadingTimer);
@ -383,19 +382,12 @@
chatMsgList.value[aiMsgIndex].msg = ''; chatMsgList.value[aiMsgIndex].msg = '';
} }
} }
//
if(chunk.toolCall) { if(chunk.toolCall) {
console.log('chunk.toolCall:', chunk.toolCall) console.log('chunk.toolCall:', chunk.toolCall)
chatMsgList.value[aiMsgIndex].toolCall = chunk.toolCall chatMsgList.value[aiMsgIndex].toolCall = chunk.toolCall
} }
console.log("============>", chunk.question)
//
if(chunk.question && chunk.question.length > 0) {
chatMsgList.value[aiMsgIndex].question = chunk.question
}
isSessionActive = false; isSessionActive = false;
scrollToBottom(); scrollToBottom();
} }

View File

@ -4,7 +4,7 @@
<!-- :style="backgroundStyle" --> <!-- :style="backgroundStyle" -->
<view class="top-item1-left"> <view class="top-item1-left">
<image :src="initPageImages.welcomeImageUrl"></image> <image :src="initPageImages.welcomeImageUrl"></image>
<text>{{ currentDate }} 多云 -36 ff </text> <text>{{ currentDate }} 多云 -36 cc </text>
</view> </view>
<view class="top-item1-right"> <view class="top-item1-right">
<image :src="initPageImages.logoImageUrl"></image> <image :src="initPageImages.logoImageUrl"></image>

View File

@ -1,65 +0,0 @@
<template>
<view class="tag-list">
<view
v-for="(item, index) in tags"
:key="index"
class="tag-item"
@click="handleClick(item)"
>
<text class="tag-text">{{ item }}</text>
</view>
</view>
</template>
<script setup>
import { ref, nextTick, defineEmits } from 'vue'
import { onMounted } from 'vue'
import { SCROLL_TO_BOTTOM } from '@/constant/constant'
const props = defineProps({
question: {
type: String,
default: ''
}
})
const tags = ref([])
const emits = defineEmits(['replySent']);
const handleClick = (item) => {
emits('replySent', item)
}
onMounted(() => {
tags.value = props.question.split('&').filter(tag => tag.trim() !== '')
nextTick(() => {
setTimeout(() => {
uni.$emit(SCROLL_TO_BOTTOM, true)
}, 300)
});
})
</script>
<style scoped lang="scss">
.tag-list {
display: flex;
flex-wrap: wrap;
padding: 6px 12px;
}
.tag-item {
background-color: #ffffff;
border-radius: 8px;
padding: 4px 10px;
margin-right: 8px;
margin-bottom: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.tag-text {
color: #00A6FF; /* 蓝色文字,可根据设计调整 */
font-size: 14px;
}
</style>