Bläddra i källkod

update pc_chat

luke 6 år sedan
förälder
incheckning
bfd6de5197
1 ändrade filer med 10 tillägg och 4 borttagningar
  1. 10 4
      pc_chat/src/components/chat.vue

+ 10 - 4
pc_chat/src/components/chat.vue

@@ -47,7 +47,7 @@
 						<!-------------------机器人聊天板块 ----------------------->
 						<div v-if="machineAndAtl == 10">
 							<!--··············· 欢迎语 ············-->
-							<div class="conversationBox">
+							<div id="welcome" class="conversationBox">
 								<div class="row" v-for="(item,index) in machine" :key="index">
 									<div class="conversation row">
 										<div class="headImg">
@@ -1215,6 +1215,7 @@
 					this.websock.send('{"type":"pong"}')
 					return false;
 				}
+				if (redata.type == 'pong') return false;
 
 				if (redata.type != 'pong' || redata.message_type != "ping") {
 					console.log(redata)
@@ -1302,8 +1303,6 @@
 				}
 				//接收客服会话
 				if (redata.message_type == 'chatMessage') {
-					// 转接的时候清除历史信息
-					this.hisSviceChat = [];
 					// 接收提示音
 					this.receiveAudio();
 					//存储会话超时间
@@ -1432,7 +1431,11 @@
 					this.historyMsgtext = obj.data.content;
 
 					obj.data.chatLog.forEach(res => {
-						res.content = JSON.parse(res.content)
+						let content = JSON.parse(res.content)
+						if (content.text) {
+							content.text = this.turnFace(content.text)
+							res.content = content
+						}
 						this.hisSviceChat.push(res)
 					})
 					this.customerSviceChat.push({type: 'system', str: 'historyMsg'})
@@ -1747,6 +1750,9 @@
 	}
 </script>
 <style scoped>
+	#welcome .row{
+		margin-bottom: 5px;
+	}
 	.chatBox {
 		width: 700px;
 		position: relative;