From 52cbd7e937f2b0c06049d2040cae1a7cae062f30 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Mon, 6 Jul 2020 19:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=92=A8=E8=AF=A2=E9=A1=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/html/chat_page.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/static/html/chat_page.html b/static/html/chat_page.html index d269f92..90300d3 100644 --- a/static/html/chat_page.html +++ b/static/html/chat_page.html @@ -73,6 +73,8 @@ .chatTitle{height: 30px;line-height: 30px;color: #1989fa} .chatBoxSend{position: fixed;bottom: 0;left: 0;width: 100%;height: 70px;} .chatBoxSendBtn{position: absolute;bottom: 1px;right: 2px;} + .chatTime{text-align: center;color: #bbb;margin: 5px 0;font-size: 12px;} + .chatTimeHide{display: none;} @@ -94,6 +96,7 @@ type="success"> +
<{v.time}>
<{v.name}>
@@ -230,6 +233,18 @@ if(history==null){ history=[]; } + $.each(history,function(i,val){ + history[i]["show_time"]=false; + + let lastKey=(i+1)>=history.length?i:i+1; + let lastTime=new Date(history[lastKey]["time"]).getTime(); + let curTime=new Date(val["time"]).getTime(); + let diffTime=lastTime-curTime + if(diffTime>(1000*60*5)){ + history[i]["show_time"]=true; + } + }); + console.log(history); return history; }, //保存历史