diff --git a/pages/index/detail.vue b/pages/index/detail.vue index 8195018..0609552 100644 --- a/pages/index/detail.vue +++ b/pages/index/detail.vue @@ -30,7 +30,8 @@ stepCircle: index > active, }">{{ index + 1 }} - {{ item.title||'' }} + + {{ item.title||'' }} @@ -58,12 +59,13 @@ - + - {{ text||'' }} + {{ text||'' }} + @@ -104,8 +106,8 @@ - 确认 清空 + 确认 @@ -141,13 +143,13 @@ - - {{ dataYinDao.title }} - - - - {{ dataYinDao.content }} - + + {{ dataYinDao.title }} + + + + {{ dataYinDao.content }} + @@ -189,7 +191,7 @@ title: "工单生成", }, ], - isShowYindao:false, + isShowYindao: false, inputValue: "", es: null, msgList: [], @@ -234,9 +236,9 @@ // this.SSE("开始隐患排查," + str, "1"); if (params.id != "undefined") { console.log('2222222222222222222222222222222') - setTimeout(() =>{ + setTimeout(() => { this.queryChat("开始隐患排查," + str); - },500) + }, 500) } else { this.$.toast('缺少相关信息'); @@ -267,12 +269,12 @@ // }, methods: { clickYinDao(data) { - console.log('data12121 ========>',data) + console.log('data12121 ========>', data) this.showYinDao = true // let newData = data.content + data.reference.content // const timer = setInterval(() => { // data.content += data.reference.content - + // if (newdata == data.content) { // clearInterval(timer); // } @@ -281,7 +283,7 @@ this.dataYinDao = data // const timer = setInterval(() => { // data += data.reference ? data.reference.content :'' - + // if (this.dataYinDao == data.content) { // clearInterval(timer); // } @@ -291,7 +293,7 @@ // icon: "none", // duration: 2000, // }); - + // data.content += data.reference.content }, // 建立SSE长连接 @@ -322,7 +324,7 @@ openWhenHidden: true, onopen: () => {}, onmessage: (ev) => { - console.log('ev ==========》',ev); + console.log('ev ==========》', ev); this.loading = true; const res = JSON.parse(ev.data); if (res?.code == 200 && res.result) { @@ -424,10 +426,10 @@ id += 2 }) this.msgList = arr - console.log('msgList =========>',this.msgList) + console.log('msgList =========>', this.msgList) } }, - + async queryChat(voiceText) { // console.log(voiceText,"voiceText"); @@ -499,7 +501,7 @@ this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0; } if (data.content) { - console.log('1212111111111111111111111 ===========>',data) + console.log('1212111111111111111111111 ===========>', data) this.changeMsgList( data.answerId || "1", data.content, @@ -508,13 +510,21 @@ data.reference ); } - if(JSON.stringify(data.reference) != '{}'){ - if(data.reference.content != null && data.reference.title != null) { + if (JSON.stringify(data.reference) != '{}') { + if (data.reference.content != null && data.reference.title != null) { this.isShowYindao = true + this.$nextTick(() => { + if (item.isOver) { + this.msgList.forEach(item => { + item.data = item.data + + `` + }) + } + }) } else { this.isShowYindao = false } - }else{ + } else { this.isShowYindao = false } this.loading = false; @@ -586,11 +596,11 @@ data = data.replace("undefined", '') data = data.replace("null", '') this.msgList = [...this.msgList] - console.log('this.msgList ==========>',this.msgList) + console.log('this.msgList ==========>', this.msgList) if (this.msgList.length > 0) { id = this.msgList[this.msgList.length - 1].id + 1; } - console.log('id ========>',id) + console.log('id ========>', id) if (answerId == "1") { // 后台返回来的消息 let newdata = ""; @@ -614,8 +624,10 @@ this.scrollBottom(); if (newdata == data) { - this.msgList[this.msgList.length - 1].data += `` - console.log('this.msgList[this.msgList.length - 1].data', this.msgList[this.msgList.length - 1].data) + this.msgList[this.msgList.length - 1].data += + `` + console.log('this.msgList[this.msgList.length - 1].data', this.msgList[this.msgList + .length - 1].data) if (optionType == 0 || optionType == 1) { this.msgList[this.msgList.length - 1].optionType = optionType; this.msgList[this.msgList.length - 1].answerOptions = @@ -831,15 +843,15 @@ bottom: -44px; .btn { - color: #2663BF!important; - background-color: rgba(0, 102, 255, 0.1)!important; + color: #2663BF !important; + background-color: rgba(0, 102, 255, 0.1) !important; display: flex; justify-content: center; align-items: center; // width: 132px; min-width: 72rpx; padding: 10rpx 14rpx; - margin: 10rpx ; + margin: 10rpx; border-radius: 4rpx; font-size: 30rpx; } @@ -986,7 +998,8 @@ transform: scale(1); } } - .yindao{ + + .yindao { padding: 15rpx; margin: 0 5px; font-size: 15px; @@ -994,25 +1007,29 @@ word-spacing: 0.1em; color: rgba(0, 102, 255, 1) } + .custom-pop-head { - width: 100%; - padding: 20rpx 0; - display: flex; - align-items: center; - justify-content: space-between; - border-bottom: 1px solid #E6E6E6; - margin-bottom: 20rpx; - .left { - color: #666666; - font-size: 16px; - margin-right: 20rpx; - } - .title { - font-size: 18px; - margin-left: 20rpx; - } + width: 100%; + padding: 20rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 1px solid #E6E6E6; + margin-bottom: 20rpx; + + .left { + color: #666666; + font-size: 16px; + margin-right: 20rpx; + } + + .title { + font-size: 18px; + margin-left: 20rpx; + } } - .custom-pop-content{ + + .custom-pop-content { margin: 20rpx; font-size: 16px; line-height: 2.3;