Feat(云灵AI):县域AI和平台AI逻辑区分
This commit is contained in:
@@ -112,6 +112,10 @@ export default {
|
|||||||
keyboardHeight: {
|
keyboardHeight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
voiceException: {
|
||||||
|
type: String,
|
||||||
|
default: '没有听清您说了什么,请再说一遍'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -262,11 +266,11 @@ export default {
|
|||||||
fail: err => {
|
fail: err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -282,7 +286,7 @@ export default {
|
|||||||
_this.getTransResultReq()
|
_this.getTransResultReq()
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTransResultReq() {
|
getTransResultReq() {
|
||||||
@@ -296,7 +300,7 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.clearIntervalFn()
|
_this.clearIntervalFn()
|
||||||
if (data === '__NULL__') {
|
if (data === '__NULL__') {
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
} else {
|
} else {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
const prompt = data[0].Text
|
const prompt = data[0].Text
|
||||||
@@ -308,7 +312,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -112,7 +112,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getChatList,
|
getChatList,
|
||||||
deleteChatListByType
|
deleteChatListByType,
|
||||||
|
getCountyAiChatList
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiHistoryList',
|
name: 'AiHistoryList',
|
||||||
@@ -125,6 +126,10 @@ export default {
|
|||||||
formModule: {
|
formModule: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
countyId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -142,7 +147,17 @@ export default {
|
|||||||
this.getChatListReq()
|
this.getChatListReq()
|
||||||
},
|
},
|
||||||
getChatListReq() {
|
getChatListReq() {
|
||||||
getChatList().then(res => {
|
let reqFn = null
|
||||||
|
let params = {}
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = getCountyAiChatList
|
||||||
|
params = {
|
||||||
|
countyId: this.countyId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reqFn = getChatList
|
||||||
|
}
|
||||||
|
reqFn(params).then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
this.todayList = data['今天'] || []
|
this.todayList = data['今天'] || []
|
||||||
@@ -160,7 +175,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
historyItemClick(item) {
|
historyItemClick(item) {
|
||||||
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1`
|
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1&countyId=${this.countyId}`
|
||||||
if (!this.formModule) {
|
if (!this.formModule) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/aiChat/views/history' + paramsStr
|
url: '/aiChat/views/history' + paramsStr
|
||||||
|
|||||||
@@ -3,8 +3,15 @@ import {
|
|||||||
getCompletionsV3,
|
getCompletionsV3,
|
||||||
deleteChatItemByConversationId,
|
deleteChatItemByConversationId,
|
||||||
// getAnalyzeKeywordsV1,
|
// getAnalyzeKeywordsV1,
|
||||||
getAnalyzeKeywordsChangeV3
|
getAnalyzeKeywordsChangeV3,
|
||||||
|
getSseCountyAiConfigV1,
|
||||||
|
getCountyAiCompletionsV1,
|
||||||
|
getGiftRecommendOptions
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
|
import {
|
||||||
|
getExceptionConfig,
|
||||||
|
getBottomNavigationConfigList
|
||||||
|
} from '@/api/public'
|
||||||
import {
|
import {
|
||||||
postCartAdd
|
postCartAdd
|
||||||
} from '@/api/store'
|
} from '@/api/store'
|
||||||
@@ -21,35 +28,7 @@ export const chatMixinsV2 = {
|
|||||||
token: cookie.get('login_status'),
|
token: cookie.get('login_status'),
|
||||||
userInfo: cookie.get('userInfo'),
|
userInfo: cookie.get('userInfo'),
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
bottomTools: [
|
bottomTools: [],
|
||||||
{
|
|
||||||
name: '我要送礼',
|
|
||||||
icon: 'https://resource.xdd618.com/3/20260526/1779781836792_icon-50.png',
|
|
||||||
navType: 'prompt',
|
|
||||||
promptContent: '我要送礼,请给我推荐一些平台的礼品',
|
|
||||||
url: '',
|
|
||||||
giftCardEnabled: 1,
|
|
||||||
display: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '订单查询',
|
|
||||||
icon: 'https://resource.xdd618.com/3/20260526/1779781836793_icon-51.png',
|
|
||||||
navType: 'prompt',
|
|
||||||
promptContent: '帮我查询我的待发货、待收货订单信息',
|
|
||||||
url: '',
|
|
||||||
giftCardEnabled: 0,
|
|
||||||
display: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '拍照识图',
|
|
||||||
icon: 'https://resource.xdd618.com/3/20260526/1779781836794_icon-52.png',
|
|
||||||
navType: 'url',
|
|
||||||
promptContent: '',
|
|
||||||
url: '/aiChat/views/imageRecognition',
|
|
||||||
giftCardEnabled: 0,
|
|
||||||
display: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
scrollData: {},
|
scrollData: {},
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
isScrollToBottom: false,
|
isScrollToBottom: false,
|
||||||
@@ -63,31 +42,17 @@ export const chatMixinsV2 = {
|
|||||||
loading: false,
|
loading: false,
|
||||||
chatNumber: '',
|
chatNumber: '',
|
||||||
infoResData: {},
|
infoResData: {},
|
||||||
chatMessageList: [
|
chatMessageList: [],
|
||||||
/*
|
|
||||||
{
|
|
||||||
type: -2,
|
|
||||||
isError: false,
|
|
||||||
showCursor: false,
|
|
||||||
conversationId: '',
|
|
||||||
prompt: '',
|
|
||||||
nodes: '-------------监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
content: '-------------监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
listQuestion: [
|
|
||||||
'监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
'监听 WebSocket 接受到服务器的消息事件',
|
|
||||||
'监听 WebSocket 接受到服务器的消息事件'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
],
|
|
||||||
errorMsg: Object.freeze('您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!'),
|
|
||||||
audioAyy: [],
|
audioAyy: [],
|
||||||
isPlayAudio: false,
|
isPlayAudio: false,
|
||||||
audioContext: null,
|
audioContext: null,
|
||||||
audioPlayId: '',
|
audioPlayId: '',
|
||||||
showGiftBtn: false,
|
showGiftBtn: false,
|
||||||
buyLoading: false
|
buyLoading: false,
|
||||||
|
exceptionConfig: {
|
||||||
|
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
|
||||||
|
voice_exception: ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -137,7 +102,37 @@ export const chatMixinsV2 = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createdCallbak() {
|
createdCallbak() {
|
||||||
console.log('页面初始话回调')
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
getExceptionConfig().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.exceptionConfig = data || {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 县域AI没有底部快捷操作和送礼配置
|
||||||
|
if (!this.countyId) {
|
||||||
|
getBottomNavigationConfigList().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.bottomTools = data || []
|
||||||
|
this.bottomTools.forEach(item => {
|
||||||
|
item.display = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getGiftRecommendOptions().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.giftBuyOptions = data || {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.extraReqFn()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
extraReqFn() {
|
||||||
|
console.log('首页/历史详情页面单独请求接口逻辑')
|
||||||
},
|
},
|
||||||
inputFocusHandle(value) {
|
inputFocusHandle(value) {
|
||||||
this.onFocus = value === 1
|
this.onFocus = value === 1
|
||||||
@@ -263,21 +258,49 @@ export const chatMixinsV2 = {
|
|||||||
})
|
})
|
||||||
_this.loading = true
|
_this.loading = true
|
||||||
_this.showCursor = false
|
_this.showCursor = false
|
||||||
getSseConfigV1({
|
let reqFn = null
|
||||||
'chatNumber': _this.chatNumber,
|
let postData = {}
|
||||||
prompt
|
if (_this.countyId) {
|
||||||
}).then(resConfig => {
|
reqFn = getSseCountyAiConfigV1
|
||||||
|
postData = {
|
||||||
|
'countyId': _this.countyId,
|
||||||
|
'chatNumber': _this.chatNumber,
|
||||||
|
prompt
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reqFn = getSseConfigV1
|
||||||
|
postData = {
|
||||||
|
'chatNumber': _this.chatNumber,
|
||||||
|
prompt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reqFn(postData).then(resConfig => {
|
||||||
const conversationId = resConfig.data.conversationId
|
const conversationId = resConfig.data.conversationId
|
||||||
_this.chatNumber = resConfig.data.chatNumber || ''
|
_this.chatNumber = resConfig.data.chatNumber || ''
|
||||||
_this.chatMessageList[_this.chatMessageListLength - 1].showCursor = true
|
_this.chatMessageList[_this.chatMessageListLength - 1].showCursor = true
|
||||||
_this.chatMessageList[_this.chatMessageListLength - 1].conversationId = conversationId
|
_this.chatMessageList[_this.chatMessageListLength - 1].conversationId = conversationId
|
||||||
if (conversationId) {
|
if (conversationId) {
|
||||||
_this.initWebSocket(conversationId, () => {
|
_this.initWebSocket(conversationId, () => {
|
||||||
getCompletionsV3({
|
|
||||||
conversationId,
|
let completionsReqFn = null
|
||||||
ws: true,
|
let completionsPostData = {}
|
||||||
isNoNeedPublicErrorNotification: 1
|
if (_this.countyId) {
|
||||||
}).then(sseRes => {
|
completionsReqFn = getCountyAiCompletionsV1
|
||||||
|
completionsPostData = {
|
||||||
|
conversationId,
|
||||||
|
countyId: _this.countyId,
|
||||||
|
ws: true,
|
||||||
|
isNoNeedPublicErrorNotification: 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
completionsReqFn = getCompletionsV3
|
||||||
|
completionsPostData = {
|
||||||
|
conversationId,
|
||||||
|
ws: true,
|
||||||
|
isNoNeedPublicErrorNotification: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
completionsReqFn(completionsPostData).then(sseRes => {
|
||||||
console.log(sseRes)
|
console.log(sseRes)
|
||||||
// _this.closeWsFn()
|
// _this.closeWsFn()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@@ -576,8 +599,8 @@ export const chatMixinsV2 = {
|
|||||||
},
|
},
|
||||||
chatErrorSetContent() {
|
chatErrorSetContent() {
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
|
this.chatMessageList[this.chatMessageListLength - 1].content = this.exceptionConfig.model_exception
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.errorMsg
|
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.exceptionConfig.model_exception
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
},
|
},
|
||||||
closeWsFn() {
|
closeWsFn() {
|
||||||
|
|||||||
@@ -365,6 +365,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
v-if="!countyId"
|
||||||
:class="{
|
:class="{
|
||||||
'focus': onFocus
|
'focus': onFocus
|
||||||
}"
|
}"
|
||||||
@@ -411,6 +412,7 @@
|
|||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:keyboard-height="keyboardHeight"
|
:keyboard-height="keyboardHeight"
|
||||||
|
:voice-exception="exceptionConfig.voice_exception"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@focus="inputFocusHandle"
|
@focus="inputFocusHandle"
|
||||||
@@ -418,10 +420,12 @@
|
|||||||
<AiHistoryList
|
<AiHistoryList
|
||||||
ref="historyView"
|
ref="historyView"
|
||||||
:status-bar-height="statusBarHeight"
|
:status-bar-height="statusBarHeight"
|
||||||
|
:county-id="countyId"
|
||||||
form-module="history"
|
form-module="history"
|
||||||
@enter-history="audioStopHandle"
|
@enter-history="audioStopHandle"
|
||||||
/>
|
/>
|
||||||
<ProductWindow
|
<ProductWindow
|
||||||
|
v-if="!countyId"
|
||||||
ref="attrWindow"
|
ref="attrWindow"
|
||||||
:attr="attr"
|
:attr="attr"
|
||||||
:cart-num="cart_num"
|
:cart-num="cart_num"
|
||||||
@@ -445,7 +449,8 @@ import BottomSend from '../components/bottomSend.vue'
|
|||||||
import OrderItem from '../components/orderItem.vue'
|
import OrderItem from '../components/orderItem.vue'
|
||||||
import ProductWindow from '@/components/ProductWindow'
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
import {
|
import {
|
||||||
historyChatMessage
|
historyChatMessage,
|
||||||
|
getCountyAiHistoryChatMessage
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
import { formatAiMsgContent } from '../utils/aiChat'
|
import { formatAiMsgContent } from '../utils/aiChat'
|
||||||
export default {
|
export default {
|
||||||
@@ -459,19 +464,27 @@ export default {
|
|||||||
mixins: [chatMixinsV2, goCartMixin],
|
mixins: [chatMixinsV2, goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageTitle: ''
|
pageTitle: '',
|
||||||
|
countyId: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.chatNumber = options.chatNumber
|
this.chatNumber = options.chatNumber
|
||||||
this.pageTitle = options.title
|
this.pageTitle = options.title || ''
|
||||||
|
this.countyId = options.countyId || ''
|
||||||
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
historyChatMessage({
|
let reqFn = null
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = getCountyAiHistoryChatMessage
|
||||||
|
} else {
|
||||||
|
reqFn = historyChatMessage
|
||||||
|
}
|
||||||
|
reqFn({
|
||||||
chatNumber: this.chatNumber
|
chatNumber: this.chatNumber
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { success, data = [] } = res
|
const { success, data = [] } = res
|
||||||
|
|||||||
+121
-155
@@ -40,12 +40,20 @@
|
|||||||
conversationId: '123'
|
conversationId: '123'
|
||||||
})">播放</button> -->
|
})">播放</button> -->
|
||||||
<block v-if="chatMessageListLength < 1">
|
<block v-if="chatMessageListLength < 1">
|
||||||
<view class="home-wrap">
|
<view
|
||||||
|
:class="{
|
||||||
|
'county-home-wrap': !!countyId
|
||||||
|
}"
|
||||||
|
class="home-wrap"
|
||||||
|
>
|
||||||
<view class="home-focus-wrap">
|
<view class="home-focus-wrap">
|
||||||
<view class="focus-guide-wrap">
|
<view class="focus-guide-wrap">
|
||||||
<view class="guide-left">
|
<view class="guide-left">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/logo-transition.png'"
|
:src="webUrl + '/aiChat/logo-transition.png'"
|
||||||
|
:class="{
|
||||||
|
'county-avatar': !!countyId
|
||||||
|
}"
|
||||||
class="avatar avatar-bounce"
|
class="avatar avatar-bounce"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -99,7 +107,8 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view v-if="!showGiftSteps" class="topic-wrap">
|
<!-- 大家都在问 -->
|
||||||
|
<view v-if="!showGiftSteps && !countyId" class="topic-wrap">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view class="title-left">大家都在问</view>
|
<view class="title-left">大家都在问</view>
|
||||||
<view class="title-right" @click="loadData('click')">
|
<view class="title-right" @click="loadData('click')">
|
||||||
@@ -133,6 +142,24 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 县域 -->
|
||||||
|
<view v-if="!showGiftSteps && countyId" class="county-tools-wrap">
|
||||||
|
<view class="list-cont">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in countyTools"
|
||||||
|
:key="index"
|
||||||
|
class="list-item"
|
||||||
|
@click="countyToolItemClickHandle(item)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="item.icon"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
<view class="name">{{ item.name }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<!-- 在这里实现送礼步骤 -->
|
<!-- 在这里实现送礼步骤 -->
|
||||||
<view v-if="showGiftSteps" class="gift-steps-wrap">
|
<view v-if="showGiftSteps" class="gift-steps-wrap">
|
||||||
<view class="gift-step-title">{{ giftBuyOptions[currentGiftStepIndex].title }}</view>
|
<view class="gift-step-title">{{ giftBuyOptions[currentGiftStepIndex].title }}</view>
|
||||||
@@ -518,6 +545,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
v-if="!countyId"
|
||||||
:class="{
|
:class="{
|
||||||
'focus': onFocus
|
'focus': onFocus
|
||||||
}"
|
}"
|
||||||
@@ -567,6 +595,7 @@
|
|||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:keyboard-height="keyboardHeight"
|
:keyboard-height="keyboardHeight"
|
||||||
|
:voice-exception="exceptionConfig.voice_exception"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@add="createNewHandle"
|
@add="createNewHandle"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@@ -575,9 +604,11 @@
|
|||||||
<AiHistoryList
|
<AiHistoryList
|
||||||
ref="historyView"
|
ref="historyView"
|
||||||
:status-bar-height="statusBarHeight"
|
:status-bar-height="statusBarHeight"
|
||||||
|
:county-id="countyId"
|
||||||
@enter-history="audioStopHandle"
|
@enter-history="audioStopHandle"
|
||||||
/>
|
/>
|
||||||
<ProductWindow
|
<ProductWindow
|
||||||
|
v-if="!countyId"
|
||||||
ref="attrWindow"
|
ref="attrWindow"
|
||||||
:attr="attr"
|
:attr="attr"
|
||||||
:cart-num="cart_num"
|
:cart-num="cart_num"
|
||||||
@@ -600,6 +631,9 @@ import {
|
|||||||
getAiSystemInfoSetting,
|
getAiSystemInfoSetting,
|
||||||
getAiSystemInfoTopic
|
getAiSystemInfoTopic
|
||||||
} from '@/api/public'
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getCountyAiDetail
|
||||||
|
} from '@/api/chat/index'
|
||||||
import AiHistoryList from '../components/historyList'
|
import AiHistoryList from '../components/historyList'
|
||||||
import BottomSend from '../components/bottomSend.vue'
|
import BottomSend from '../components/bottomSend.vue'
|
||||||
import OrderItem from '../components/orderItem.vue'
|
import OrderItem from '../components/orderItem.vue'
|
||||||
@@ -616,6 +650,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cityName: '',
|
cityName: '',
|
||||||
|
countyId: '',
|
||||||
animationWidth: '150%',
|
animationWidth: '150%',
|
||||||
animationStr: '',
|
animationStr: '',
|
||||||
settingInfo: {},
|
settingInfo: {},
|
||||||
@@ -626,153 +661,13 @@ export default {
|
|||||||
currentGiftStepIndex: 0,
|
currentGiftStepIndex: 0,
|
||||||
giftSelections: {},
|
giftSelections: {},
|
||||||
giftBudget: '',
|
giftBudget: '',
|
||||||
giftBuyOptions: [
|
giftBuyOptions: [],
|
||||||
{
|
countyTools: []
|
||||||
"id": 1,
|
|
||||||
"sort": 1,
|
|
||||||
"title": "礼品是送给谁的呢?",
|
|
||||||
"type": "option_card",
|
|
||||||
"status": 1,
|
|
||||||
"createTime": 1779777608000,
|
|
||||||
"updateTime": 1779850697000,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"configId": 1,
|
|
||||||
"optionName": "送长辈",
|
|
||||||
"sort": 1,
|
|
||||||
"createTime": 1779777924000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"configId": 1,
|
|
||||||
"optionName": "送朋友",
|
|
||||||
"sort": 2,
|
|
||||||
"createTime": 1779777924000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"configId": 1,
|
|
||||||
"optionName": "送同事",
|
|
||||||
"sort": 3,
|
|
||||||
"createTime": 1779777924000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"configId": 1,
|
|
||||||
"optionName": "送亲戚",
|
|
||||||
"sort": 4,
|
|
||||||
"createTime": 1779777924000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"configId": 1,
|
|
||||||
"optionName": "送爱人",
|
|
||||||
"sort": 5,
|
|
||||||
"createTime": 1779777924000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"configId": 1,
|
|
||||||
"optionName": "送领导",
|
|
||||||
"sort": 6,
|
|
||||||
"createTime": 1779777924000
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"sort": 2,
|
|
||||||
"title": "有什么特别的场合吗?",
|
|
||||||
"type": "option_card",
|
|
||||||
"status": 1,
|
|
||||||
"createTime": 1779777608000,
|
|
||||||
"updateTime": 1779789421000,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 11,
|
|
||||||
"configId": 2,
|
|
||||||
"optionName": "生日",
|
|
||||||
"sort": 1,
|
|
||||||
"createTime": 1779789420000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 12,
|
|
||||||
"configId": 2,
|
|
||||||
"optionName": "节日",
|
|
||||||
"sort": 2,
|
|
||||||
"createTime": 1779789420000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 13,
|
|
||||||
"configId": 2,
|
|
||||||
"optionName": "乔迁",
|
|
||||||
"sort": 3,
|
|
||||||
"createTime": 1779789420000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 14,
|
|
||||||
"configId": 2,
|
|
||||||
"optionName": "感谢",
|
|
||||||
"sort": 4,
|
|
||||||
"createTime": 1779789420000
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"sort": 3,
|
|
||||||
"title": "对礼品类型有什么偏好?",
|
|
||||||
"type": "option_card",
|
|
||||||
"status": 1,
|
|
||||||
"createTime": 1779777608000,
|
|
||||||
"updateTime": 1779789393000,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"configId": 3,
|
|
||||||
"optionName": "特色礼盒",
|
|
||||||
"sort": 1,
|
|
||||||
"createTime": 1779789393000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 8,
|
|
||||||
"configId": 3,
|
|
||||||
"optionName": "商务",
|
|
||||||
"sort": 2,
|
|
||||||
"createTime": 1779789393000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 9,
|
|
||||||
"configId": 3,
|
|
||||||
"optionName": "茶叶",
|
|
||||||
"sort": 3,
|
|
||||||
"createTime": 1779789393000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 10,
|
|
||||||
"configId": 3,
|
|
||||||
"optionName": "精美实惠",
|
|
||||||
"sort": 4,
|
|
||||||
"createTime": 1779789393000
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"sort": 4,
|
|
||||||
"title": "预算大概在什么范围?",
|
|
||||||
"type": "price_input",
|
|
||||||
"status": 1,
|
|
||||||
"createTime": 1779777608000,
|
|
||||||
"updateTime": 1779777608000,
|
|
||||||
"options": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.cityName = options.cityName || ''
|
this.cityName = options.cityName || ''
|
||||||
|
this.countyId = options.countyId || ''
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// 1-新对话,2-我要送礼
|
// 1-新对话,2-我要送礼
|
||||||
@@ -792,18 +687,31 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createdCallbak() {
|
extraReqFn() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollToBottomHandle()
|
this.scrollToBottomHandle()
|
||||||
getAiSystemInfoSetting().then(res => {
|
if (this.countyId) {
|
||||||
const { success, data } = res
|
getCountyAiDetail({
|
||||||
if (success) {
|
countyId: this.countyId
|
||||||
this.settingInfo = data
|
}).then(res => {
|
||||||
this.animationWidth = `${data.systemTopicDivMaxWidth * 750}rpx`
|
const { success, data } = res
|
||||||
this.animationStr = `TranslateXSwiper-${data.systemTopicDivMaxWidth * 10} ${data.systemTopicDivScrollDuration}s infinite linear alternate`
|
if (success) {
|
||||||
}
|
this.settingInfo.helloMessageTitle = data.title || ''
|
||||||
})
|
this.settingInfo.helloMessageContent = data.introduction || ''
|
||||||
this.loadData()
|
this.countyTools = data.modules || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
getAiSystemInfoSetting().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.settingInfo = data
|
||||||
|
this.animationWidth = `${data.systemTopicDivMaxWidth * 750}rpx`
|
||||||
|
this.animationStr = `TranslateXSwiper-${data.systemTopicDivMaxWidth * 10} ${data.systemTopicDivScrollDuration}s infinite linear alternate`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loadData()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadData(type = '') {
|
loadData(type = '') {
|
||||||
@@ -881,6 +789,19 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
countyToolItemClickHandle(item) {
|
||||||
|
if (item.moduleType === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.promptContent,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.moduleType === 'url') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -937,6 +858,9 @@ export default {
|
|||||||
display: block;
|
display: block;
|
||||||
width: 430rpx;
|
width: 430rpx;
|
||||||
}
|
}
|
||||||
|
.county-avatar {
|
||||||
|
width: 360rpx;
|
||||||
|
}
|
||||||
.avatar-bounce {
|
.avatar-bounce {
|
||||||
animation: bounce 2s infinite ease-in-out;
|
animation: bounce 2s infinite ease-in-out;
|
||||||
}
|
}
|
||||||
@@ -1032,4 +956,46 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.county-home-wrap {
|
||||||
|
justify-content: flex-start;
|
||||||
|
.guide-right {
|
||||||
|
.content {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.county-tools-wrap {
|
||||||
|
width: 100%;
|
||||||
|
padding: 40rpx 0 0 0;
|
||||||
|
.list-cont {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 60rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.list-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 28%;
|
||||||
|
padding: 20rpx 0 12rpx 0;
|
||||||
|
margin: 0 0 24rpx 0;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 12rpx rgba(0, 0, 0, 0.1);
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
padding: 8rpx 0 0 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -59,3 +59,29 @@ export function getAnalyzeKeywordsChangeV3(data) {
|
|||||||
export function getAnalyzeByImageV3(data) {
|
export function getAnalyzeByImageV3(data) {
|
||||||
return request.post('/v1/chat/image/recognition', data, { login: true })
|
return request.post('/v1/chat/image/recognition', data, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取送礼选项配置
|
||||||
|
export function getGiftRecommendOptions(params) {
|
||||||
|
return request.get('/ai/gift-recommend/options', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取县域AI详情
|
||||||
|
export function getCountyAiDetail(params) {
|
||||||
|
return request.get('/county-ai/detail', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSseCountyAiConfigV1(data) {
|
||||||
|
return request.post('/county-ai/chat', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiCompletionsV1(params) {
|
||||||
|
return request.get('/county-ai/chat/recognize', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiChatList(params) {
|
||||||
|
return request.get('/county-ai/chat/list', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiHistoryChatMessage(params) {
|
||||||
|
return request.get('/county-ai/chat/message', params, { login: true })
|
||||||
|
}
|
||||||
|
|||||||
@@ -223,6 +223,16 @@ export function getAiSystemInfoTopic() {
|
|||||||
return request.get('/ai/systemTopic', {}, { login: false })
|
return request.get('/ai/systemTopic', {}, { login: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取异常提示配置
|
||||||
|
export function getExceptionConfig() {
|
||||||
|
return request.get('/ai/exceptionConfig', {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取已启用的底部导航配置列表
|
||||||
|
export function getBottomNavigationConfigList() {
|
||||||
|
return request.get('/ai/bottom-navigation/list', {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
// 获取通用分享配置
|
// 获取通用分享配置
|
||||||
export function getWeixinShareConfig() {
|
export function getWeixinShareConfig() {
|
||||||
return request.get('/weixinShareConfig', {}, { login: false })
|
return request.get('/weixinShareConfig', {}, { login: false })
|
||||||
|
|||||||
@@ -13,12 +13,19 @@
|
|||||||
import {
|
import {
|
||||||
getAiSystemInfoSetting
|
getAiSystemInfoSetting
|
||||||
} from '@/api/public'
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getCountyAiDetail
|
||||||
|
} from '@/api/chat/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiEntrance',
|
name: 'AiEntrance',
|
||||||
props: {
|
props: {
|
||||||
cityName: {
|
cityName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
countyId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -33,6 +40,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
if (this.countyId) {
|
||||||
|
getCountyAiDetail({
|
||||||
|
countyId: this.countyId
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
const aiImage = data.aiImage || ''
|
||||||
|
this.settingInfo.mainImage = aiImage
|
||||||
|
this.showImg = !!aiImage
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
getAiSystemInfoSetting().then(res => {
|
getAiSystemInfoSetting().then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -43,7 +63,7 @@ export default {
|
|||||||
},
|
},
|
||||||
enterAiChat() {
|
enterAiChat() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName)
|
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName) + '&countyId=' + (this.countyId || '')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -904,7 +904,10 @@
|
|||||||
@ok="handleOk"
|
@ok="handleOk"
|
||||||
/>
|
/>
|
||||||
<FunctionGuide @hide="setGuide('countyFamousIndex')" :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
|
<FunctionGuide @hide="setGuide('countyFamousIndex')" :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
|
||||||
<AiEntrance />
|
<AiEntrance
|
||||||
|
v-if="isLoad"
|
||||||
|
:county-id="inn.areaId"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user