mirror of
http://112.124.100.131/ebiz-ai/ebiz-base-ai.git
synced 2025-12-06 17:36:48 +08:00
feat: 添加 messagestatus 状态
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</span>
|
||||
<div class="text-right fs12 mb5 mr10" style="font-size: 10px; color: #f6aa21">
|
||||
<!-- 新增点赞和踩按钮 -->
|
||||
<div class="reaction-buttons mb10" v-if="message.type !== 'user'">
|
||||
<div class="reaction-buttons mb10" v-if="message.type !== 'user' && messageStatus === 'stop'">
|
||||
<button @click="handleReaction(message, 'like')" class="like">
|
||||
<svg-icon :icon-class="message.isLike ? 'fillLike' : 'like'" class-name="chat-icon"></svg-icon>
|
||||
</button>
|
||||
@@ -66,6 +66,10 @@ export default {
|
||||
isDeep: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
messageStatus: {
|
||||
type: String,
|
||||
default: 'stop'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -8,15 +8,9 @@
|
||||
<main class="chat-main">
|
||||
<div class="chat-content">
|
||||
<div class="message-area" ref="messageArea" @scroll="handleScroll">
|
||||
<messageComponent
|
||||
:messagesList="messages"
|
||||
:is-deep="isDeep"
|
||||
:is-search="isSearching"
|
||||
:think-ok="isThink"
|
||||
@setProductName="setProductName"
|
||||
@reload-message="reloadMessage"
|
||||
v-if="messages.length > 1"
|
||||
></messageComponent>
|
||||
<messageComponent :message-status="messageStatus" :messagesList="messages" :is-deep="isDeep"
|
||||
:is-search="isSearching" :think-ok="isThink" @setProductName="setProductName"
|
||||
@reload-message="reloadMessage" v-if="messages.length > 1"></messageComponent>
|
||||
<div class="mb20" v-else>
|
||||
HI,我是长生产品助手,可以为你推荐产品、答疑解惑,请点击以下功能体检。
|
||||
</div>
|
||||
@@ -32,7 +26,8 @@
|
||||
|
||||
<chatMessage ref="chatMessage" :messages.sync="messages" :messageStatus.sync="messageStatus" :is-deep.sync="isDeep"
|
||||
:conversation-id.sync="conversationId" :is-searching.sync="isSearching" :product-name.sync="productName"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled" @getIsThink="getIsThink" action="normal_chat" @initBotMessage="initBotMessage"/>
|
||||
:autoScrollEnabled.sync="autoScrollEnabled" @getIsThink="getIsThink" action="normal_chat"
|
||||
@initBotMessage="initBotMessage" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -138,9 +133,9 @@ export default {
|
||||
},
|
||||
initBotMessage() {
|
||||
this.messages = []
|
||||
},
|
||||
reloadMessage({message,index}){
|
||||
this.$refs.chatMessage.reloadMessage({message,index})
|
||||
},
|
||||
reloadMessage({ message, index }) {
|
||||
this.$refs.chatMessage.reloadMessage({ message, index })
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -1,26 +1,15 @@
|
||||
<template>
|
||||
<div class="chat-page">
|
||||
<van-nav-bar title="产品知识助手" left-text="返回" left-arrow @click-left="$router.history.go(-1)" />
|
||||
<sticky
|
||||
:hotList="hotList"
|
||||
:productName="productName"
|
||||
:messagesList.sync="messages"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled"
|
||||
@setProductName="setProductName"
|
||||
:isDisabled="messageStatus === 'send'"
|
||||
:conversationId="conversationId"
|
||||
></sticky>
|
||||
<sticky :hotList="hotList" :productName="productName" :messagesList.sync="messages"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled" @setProductName="setProductName"
|
||||
:isDisabled="messageStatus === 'send'" :conversationId="conversationId"></sticky>
|
||||
|
||||
<main class="chat-main">
|
||||
<div class="chat-content">
|
||||
<div class="message-area" ref="messageArea" @scroll="handleScroll">
|
||||
<messageComponent
|
||||
:messagesList="messages"
|
||||
:is-deep="isDeep"
|
||||
:is-search="isSearching"
|
||||
:think-ok="isThink"
|
||||
@setProductName="setProductName"
|
||||
></messageComponent>
|
||||
<messageComponent :message-status="messageStatus" :messagesList="messages" :is-deep="isDeep"
|
||||
:is-search="isSearching" :think-ok="isThink" @setProductName="setProductName"></messageComponent>
|
||||
<!-- <HotProducts class="mb10" :messagesList.sync="messages" @getHotList="getHotProducts"></HotProducts> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,18 +19,10 @@
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<chatMessage
|
||||
:messages.sync="messages"
|
||||
:messageStatus.sync="messageStatus"
|
||||
:is-deep.sync="isDeep"
|
||||
:conversation-id.sync="conversationId"
|
||||
:is-searching.sync="isSearching"
|
||||
:product-name.sync="productName"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled"
|
||||
@getIsThink="getIsThink"
|
||||
action="chat"
|
||||
@initBotMessage="initBotMessage"
|
||||
/>
|
||||
<chatMessage :messages.sync="messages" :messageStatus.sync="messageStatus" :is-deep.sync="isDeep"
|
||||
:conversation-id.sync="conversationId" :is-searching.sync="isSearching" :product-name.sync="productName"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled" @getIsThink="getIsThink" action="chat"
|
||||
@initBotMessage="initBotMessage" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,26 +1,15 @@
|
||||
<template>
|
||||
<div class="chat-page">
|
||||
<van-nav-bar title="产品推荐助手-保障型" left-text="返回" left-arrow @click-left="$router.history.go(-1)" />
|
||||
<sticky
|
||||
:hotList="hotList"
|
||||
:productName="productName"
|
||||
:messagesList.sync="messages"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled"
|
||||
@setProductName="setProductName"
|
||||
:isDisabled="messageStatus === 'send'"
|
||||
:conversationId="conversationId"
|
||||
></sticky>
|
||||
<sticky :hotList="hotList" :productName="productName" :messagesList.sync="messages"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled" @setProductName="setProductName"
|
||||
:isDisabled="messageStatus === 'send'" :conversationId="conversationId"></sticky>
|
||||
|
||||
<main class="chat-main">
|
||||
<div class="chat-content">
|
||||
<div class="message-area" ref="messageArea" @scroll="handleScroll">
|
||||
<messageComponent
|
||||
:messagesList="messages"
|
||||
:is-deep="isDeep"
|
||||
:is-search="isSearching"
|
||||
:think-ok="isThink"
|
||||
@setProductName="setProductName"
|
||||
></messageComponent>
|
||||
<messageComponent :message-status="messageStatus" :messagesList="messages" :is-deep="isDeep"
|
||||
:is-search="isSearching" :think-ok="isThink" @setProductName="setProductName"></messageComponent>
|
||||
<!-- <HotProducts class="mb10" :messagesList.sync="messages" @getHotList="getHotProducts"></HotProducts> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,18 +19,10 @@
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<chatMessage
|
||||
:messages.sync="messages"
|
||||
:messageStatus.sync="messageStatus"
|
||||
:is-deep.sync="isDeep"
|
||||
:conversation-id.sync="conversationId"
|
||||
:is-searching.sync="isSearching"
|
||||
:product-name.sync="productName"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled"
|
||||
@getIsThink="getIsThink"
|
||||
action="product_recommend"
|
||||
@initBotMessage="initBotMessage"
|
||||
>
|
||||
<chatMessage :messages.sync="messages" :messageStatus.sync="messageStatus" :is-deep.sync="isDeep"
|
||||
:conversation-id.sync="conversationId" :is-searching.sync="isSearching" :product-name.sync="productName"
|
||||
:autoScrollEnabled.sync="autoScrollEnabled" @getIsThink="getIsThink" action="product_recommend"
|
||||
@initBotMessage="initBotMessage">
|
||||
</chatMessage>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user