From e2bffed69e46455ef26d48569d82be55827756b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B6=E5=A3=AB=E6=B6=B5?= <630892807@qq.com> Date: Sat, 12 Sep 2020 19:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=82=B9=E5=87=BB=E6=96=B0?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/css/common.css | 11 +++++++++++ static/html/chat_main.html | 5 +++++ static/html/chat_page.html | 3 +-- static/js/functions.js | 14 ++++++++++++-- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/static/css/common.css b/static/css/common.css index 27b3261..f634d76 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -209,6 +209,17 @@ font-size: 24px; margin-bottom: 10px; } +.bigPic{ + background: #ccc; + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + z-index: 999; + display: none; + text-align: center; +} /*客服聊天主板*/ .chatLeft .el-tabs__nav,.chatRight .el-tabs__nav { margin-left: 20px; diff --git a/static/html/chat_main.html b/static/html/chat_main.html index 62a2b03..74c7f6f 100644 --- a/static/html/chat_main.html +++ b/static/html/chat_main.html @@ -190,6 +190,11 @@ + +
+ +
+ diff --git a/static/html/chat_page.html b/static/html/chat_page.html index dc60b3f..46c72c8 100644 --- a/static/html/chat_page.html +++ b/static/html/chat_page.html @@ -136,7 +136,6 @@
- @@ -206,7 +205,7 @@ let content = {} content.avator = msg.avator; content.name = msg.name; - content.content =replaceContent(msg.content); + content.content =replaceContent(msg.content,true); content.is_kefu = false; content.time = msg.time; this.msgList.push(content); diff --git a/static/js/functions.js b/static/js/functions.js index 4b8ae50..fb9c50c 100644 --- a/static/js/functions.js +++ b/static/js/functions.js @@ -75,14 +75,24 @@ function replaceContent (content) {// 转义聊天内容中的特殊字符 }) .replace(/img\[([^\s\[\]]+?)\]/g, function (face) { // 转义图片 var src = face.replace(/^img\[/g, '').replace(/\]/g, '');; - return ''; + return ''; }) .replace(html(), '\<$1 $2\>').replace(html('/'), '\') // 转移HTML代码 .replace(/\n/g, '
') // 转义换行 return content; } - +function bigPic(src,isVisitor){ + if (isVisitor) { + window.open(src); + return; + } + // $("#bigPic img").attr("src",src); + // $("#bigPic").show(); + // $("#bigPic img").click(function(){ + // $("#bigPic").hide(); + // }); +} function filter (obj){ var imgType = ["image/jpeg","image/png","image/jpg","image/gif"]; var filetypes = imgType;