Refactor(云灵AI):换一换动态效果实现

This commit is contained in:
lifizer
2026-04-27 15:42:01 +08:00
parent 0d1dfae3bd
commit 3b935811e3
4 changed files with 92 additions and 29 deletions
+19 -5
View File
@@ -252,7 +252,8 @@ export const chatMixinsV2 = {
type: -2,
showMoreInfo: {},
currentSwiperIndex: 0,
showChangeBtn: true
showChangeBtn: true,
changeIsRotate: false
})
_this.loading = true
_this.showCursor = false
@@ -408,6 +409,18 @@ export const chatMixinsV2 = {
this.chatMessageList[index].currentSwiperIndex = e.detail.current
},
analyzeKeywordsChangeHandle(conversationId, item) {
let idx = -1
this.chatMessageList.map((item, index) => {
if (item.conversationId === conversationId) {
idx = index
}
})
if (idx > -1) {
this.$set(this.chatMessageList[idx], 'changeIsRotate', true)
if (this.chatMessageList[idx].changeIsRotate) {
return
}
}
let listKey = ''
// 抽奖和订单查询没有换一换
if (item.goodsList.length > 0) {
@@ -431,17 +444,18 @@ export const chatMixinsV2 = {
const { success, data } = res
if (success) {
let changeList = []
let idx = -1
this.chatMessageList.map((item, index) => {
this.chatMessageList.map((item) => {
if (item.conversationId === conversationId) {
changeList = data.list || []
idx = index
}
})
if (idx > -1 && listKey) {
this.$set(this.chatMessageList[idx], 'listKey', changeList)
this.$set(this.chatMessageList[idx], listKey, changeList)
this.$forceUpdate()
}
setTimeout(() => {
this.$set(this.chatMessageList[idx], 'changeIsRotate', false)
}, 1000)
}
})
},