From 1756875ee31985eefeb9aef65bbe2bbc228f59ea Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Wed, 30 Sep 2020 14:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E5=90=8E=E5=8F=B0=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E8=AE=BF=E5=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/html/chat_main.html | 10 ++++++---- static/js/chat-main.js | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/static/html/chat_main.html b/static/html/chat_main.html index c9707c2..74e1616 100644 --- a/static/html/chat_main.html +++ b/static/html/chat_main.html @@ -170,10 +170,12 @@ 时间:<{visitor.created_at}> - - - 状态:<{visitor.status}> - + + + + 状态:<{visitor.status}> + + diff --git a/static/js/chat-main.js b/static/js/chat-main.js index 366d0db..6ddf63c 100644 --- a/static/js/chat-main.js +++ b/static/js/chat-main.js @@ -20,6 +20,7 @@ var app=new Vue({ to_id : "", }, visitor:{ + visitor_id:"", refer:"", client_ip:"", city:"", @@ -337,6 +338,7 @@ var app=new Vue({ _this.visitor.client_ip=r.client_ip; _this.visitor.source_ip=r.source_ip; _this.visitor.status=r.status==1?"在线":"离线"; + _this.visitor.visitor_id=r.visitor_id; } if(data.code!=200){ _this.$message({ @@ -347,6 +349,26 @@ var app=new Vue({ } }); }, + //关闭访客 + closeVisitor(visitorId){ + let _this=this; + $.ajax({ + type:"get", + url:"/message_close", + data:{visitor_id:visitorId}, + headers:{ + "token":localStorage.getItem("token") + }, + success: function(data) { + if(data.code!=200){ + _this.$message({ + message: data.msg, + type: 'error' + }); + } + } + }); + }, //处理tab切换 handleTabClick(tab, event){ let _this=this;