diff --git a/aiChat/mixins/chatMixinsV2.js b/aiChat/mixins/chatMixinsV2.js index a9b2fb0..379ee32 100644 --- a/aiChat/mixins/chatMixinsV2.js +++ b/aiChat/mixins/chatMixinsV2.js @@ -245,10 +245,13 @@ export const chatMixinsV2 = { prizeList: [], // 店铺 shopList: [], + // 地标好物--屏蔽原因:实现此功能时,后端通过AI动态返回的图片不满足需求,后面就不要了 + landmarksList: [], // 订单 orderList: [], type: -2, - showMoreInfo: {} + showMoreInfo: {}, + currentSwiperIndex: 0 }) _this.loading = true _this.showCursor = false @@ -316,30 +319,59 @@ export const chatMixinsV2 = { console.log('-------------监听 WebSocket 接受到服务器的消息事件') const resData = JSON.parse(res.data) if (resData) { - console.log(resData) const message = resData.message + console.log(message) if (message && this.chatMessageListLength > 1) { const mesContent = message.content const contentType = message.contentType const finish = message.finish - // todo:判断是文本还是列表 - if (contentType ==='text') { + if (contentType === 'text') { if (!finish && mesContent) { this.chatMessageList[this.chatMessageListLength - 1].nodes = formatAiMsgContent(mesContent) this.chatMessageList[this.chatMessageListLength - 1].content = mesContent this.chatMessageList[this.chatMessageListLength - 1].listQuestion = message.listQuestion || [] } } - if (contentType ==='order') { + if (contentType === 'order') { if (!finish && message.listCards) { this.chatMessageList[this.chatMessageListLength - 1].orderList = message.listCards || [] } } - if (contentType ==='shop') { + if (contentType === 'shop') { if (!finish && message.listCards) { this.chatMessageList[this.chatMessageListLength - 1].shopList = message.listCards || [] } } + if (contentType === 'gift') { + if (!finish && message.listCards) { + this.chatMessageList[this.chatMessageListLength - 1].giftGoodsList = message.listCards || [] + } + } + if (contentType === 'discount') { + if (!finish && message.listCards) { + this.chatMessageList[this.chatMessageListLength - 1].prizeList = message.listCards || [] + } + } + if (contentType === 'goods') { + if (!finish && message.listCards) { + this.chatMessageList[this.chatMessageListLength - 1].goodsList = message.listCards || [] + } + } + if (contentType === 'famous') { + if (!finish && message.listCards) { + this.chatMessageList[this.chatMessageListLength - 1].qianxianList = message.listCards || [] + } + } + if (contentType === 'ich') { + if (!finish && message.listCards) { + this.chatMessageList[this.chatMessageListLength - 1].ichList = message.listCards || [] + } + } + if (contentType === 'landmarks') { + if (!finish && message.listCards) { + this.chatMessageList[this.chatMessageListLength - 1].landmarksList = message.listCards || [] + } + } this.$forceUpdate() this.$nextTick(() => { this.scrollToBottomHandle() @@ -371,6 +403,9 @@ export const chatMixinsV2 = { console.log('send failed (' + err.code + ')') } }, + onSwiperChange(index, e) { + this.chatMessageList[index].currentSwiperIndex = e.detail.current + }, analyzeKeywordsChangeHandle(conversationId, item) { let listKey = '' // 抽奖和订单查询没有换一换 diff --git a/aiChat/views/index.vue b/aiChat/views/index.vue index dda3512..beb39c3 100644 --- a/aiChat/views/index.vue +++ b/aiChat/views/index.vue @@ -38,7 +38,7 @@ })">播放 --> -