diff --git a/static/html/chat_page.html b/static/html/chat_page.html index 46e2921..2914e82 100644 --- a/static/html/chat_page.html +++ b/static/html/chat_page.html @@ -76,5 +76,5 @@ var KEFU_ID='{{.KEFU_ID}}'; var REFER='{{.Refer}}'; - + diff --git a/static/js/chat-page.js b/static/js/chat-page.js index 1bf853e..3eff92f 100644 --- a/static/js/chat-page.js +++ b/static/js/chat-page.js @@ -14,6 +14,7 @@ new Vue({ face:[], showKfonline:false, socketClosed:false, + timer:null, }, methods: { //初始化websocket @@ -126,6 +127,7 @@ new Vue({ //_this.saveHistory(content); _this.scrollBottom(); _this.messageContent = ""; + clearInterval(_this.timer); }); }, @@ -231,14 +233,21 @@ new Vue({ //debugger; if (res.result != null) { let msg = res.result; - for(let i=0;i0){ + _this.timer=setInterval(function(){ + if(i>=len){ + clearInterval(_this.timer); + } + let content = msg[i]; + content.content = replaceContent(content.content); _this.msgList.push(content); _this.scrollBottom(); - }, 5000*(i+1)); + i++; + },3000); } + } }); },