Feat(AI):关键词搜索匹配相关模块列表
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import {
|
||||
getSseConfigV1,
|
||||
getCompletionsV2,
|
||||
deleteChatItemByConversationId
|
||||
deleteChatItemByConversationId,
|
||||
getAnalyzeKeywordsV1,
|
||||
getAnalyzeKeywordsChangeV1
|
||||
} from '@/api/chat/index'
|
||||
import { VUE_APP_API_URL } from '@/config'
|
||||
import settings from '@/config/baseSetting.js'
|
||||
@@ -104,10 +106,21 @@ export const chatMixins = {
|
||||
copyContentHandle(data) {
|
||||
uni.setClipboardData({
|
||||
data,
|
||||
success: () =>
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '已复制'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
copyMoreInfoHandle(item) {
|
||||
uni.setClipboardData({
|
||||
data: JSON.stringify(item.showMoreInfo),
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '已复制'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
shareHandle() {
|
||||
@@ -181,7 +194,8 @@ export const chatMixins = {
|
||||
conversationId: '',
|
||||
prompt,
|
||||
listQuestion: [],
|
||||
type: -2
|
||||
type: -2,
|
||||
showMoreInfo: {}
|
||||
})
|
||||
_this.loading = true
|
||||
_this.showCursor = false
|
||||
@@ -207,6 +221,32 @@ export const chatMixins = {
|
||||
_this.chatErrorSetContent()
|
||||
})
|
||||
})
|
||||
getAnalyzeKeywordsV1({
|
||||
'chatNumber': _this.chatNumber,
|
||||
conversationId,
|
||||
prompt
|
||||
}).then(keywordRes => {
|
||||
if (keywordRes.success) {
|
||||
const keywordResData = keywordRes.data
|
||||
const show = (keywordResData.searchArtworks ||
|
||||
keywordResData.searchDiscount ||
|
||||
keywordResData.searchGoods ||
|
||||
keywordResData.searchLandmark ||
|
||||
keywordResData.searchTowns ||
|
||||
keywordResData.searchTravelGuide
|
||||
) && (keywordResData.resultItems && keywordResData.resultItems.length > 0)
|
||||
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo = keywordResData
|
||||
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo.show = show
|
||||
// 展示类型
|
||||
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo.showType = ''
|
||||
if (show && keywordResData.resultItems) {
|
||||
keywordResData.resultItems.map(resItem => {
|
||||
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo.showType = resItem.type
|
||||
})
|
||||
}
|
||||
console.log(_this.chatMessageList[_this.chatMessageListLength - 1])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.chatErrorSetContent()
|
||||
}
|
||||
@@ -215,6 +255,60 @@ export const chatMixins = {
|
||||
_this.chatErrorSetContent()
|
||||
})
|
||||
},
|
||||
analyzeKeywordsChangeHandle(conversationId, showMoreInfo) {
|
||||
getAnalyzeKeywordsChangeV1({
|
||||
conversationId,
|
||||
...showMoreInfo
|
||||
}).then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
let resultItems = []
|
||||
let idx = -1
|
||||
this.chatMessageList.map((item, index) => {
|
||||
if (item.conversationId === conversationId) {
|
||||
resultItems = data.resultItems || []
|
||||
idx = index
|
||||
}
|
||||
})
|
||||
if (idx > -1) {
|
||||
this.$set(this.chatMessageList[idx].showMoreInfo, 'resultItems', resultItems)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
productItemClickHandle(item) {
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsCon/index',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
},
|
||||
hotelItemClickHandle(item) {
|
||||
this.$yrouter.push({
|
||||
path: '/pagesInn/inn/innHome',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
},
|
||||
ichItemClickHandle(item) {
|
||||
this.$yrouter.push({
|
||||
path: '/pkg_product/views/heritage/details',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
},
|
||||
qianxianItemClickHandle(item) {
|
||||
this.$yrouter.push({
|
||||
path: '/pkg_product/views/famousQianxianShop',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
},
|
||||
chatErrorSetContent() {
|
||||
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
||||
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
|
||||
|
||||
Reference in New Issue
Block a user