diff --git a/static/css/common.css b/static/css/common.css index 1b4c53a..417577c 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -422,4 +422,6 @@ background: #fff; } .kefuFuncBox .el-textarea{width: 99%;} +.kefuFolderBtn{vertical-align: middle;} +.iconBtnsBox .kefuSendBtn{margin-right: 4px;float: right;} .clear{clear:both;} \ No newline at end of file diff --git a/static/css/gofly-front.css b/static/css/gofly-front.css index 48144a5..6d20b42 100644 --- a/static/css/gofly-front.css +++ b/static/css/gofly-front.css @@ -147,6 +147,32 @@ .launchPointer.offline{ background: #ce3c39; } +.folderBtn { + display: inline-block; + background-color: transparent; + overflow: hidden; + font-size: 1px; +} +.folderBtn:before { + content: ''; + float: left; + background-color: #9da0a0; + width: 15px; + height: 3px; + margin-left: 2px; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + box-shadow: 2px 2px 0 0 #9da0a0; +} +.folderBtn:after { + content: ''; + float: left; + clear: left; + background-color: #d4d6d6; + width: 33px; + height: 22px; + border-radius: 1px; +} @-webkit-keyframes bounce-up { 25% {-webkit-transform: translateY(4px);} 50%, 100% {-webkit-transform: translateY(0);} diff --git a/static/html/chat_main.html b/static/html/chat_main.html index e70f0b6..56fbb2b 100644 --- a/static/html/chat_main.html +++ b/static/html/chat_main.html @@ -110,7 +110,8 @@
- 发送 +
+ 发送
diff --git a/static/js/chat-main.js b/static/js/chat-main.js index 3a15fdf..1131ab2 100644 --- a/static/js/chat-main.js +++ b/static/js/chat-main.js @@ -200,6 +200,7 @@ var app=new Vue({ message: res.msg, type: 'error' }); + return; } _this.messageContent = ""; _this.sendSound(); @@ -559,6 +560,42 @@ var app=new Vue({ }); }); }, + //上传文件 + uploadFile:function (url){ + let _this=this; + $('#uploadFile').after(''); + $("#uploadRealFile").click(); + $("#uploadRealFile").change(function (e) { + var formData = new FormData(); + var file = $("#uploadRealFile")[0].files[0]; + formData.append("realfile",file); //传给后台的file的key值是可以自己定义的 + console.log(formData); + $.ajax({ + url: url || '', + type: "post", + data: formData, + contentType: false, + processData: false, + dataType: 'JSON', + mimeType: "multipart/form-data", + success: function (res) { + + if(res.code!=200){ + _this.$message({ + message: res.msg, + type: 'error' + }); + }else{ + _this.messageContent+='file[/' + res.result.path + ']'; + _this.chatToUser(); + } + }, + error: function (data) { + console.log(data); + } + }); + }); + }, addIpblack(ip){ let _this=this; $.ajax({ diff --git a/static/js/functions.js b/static/js/functions.js index c84cc0a..781f837 100644 --- a/static/js/functions.js +++ b/static/js/functions.js @@ -81,11 +81,11 @@ function replaceContent (content,baseUrl) {// 转义聊天内容中的特殊字 }) .replace(/img\[([^\s\[\]]+?)\]/g, function (face) { // 转义图片 var src = face.replace(/^img\[/g, '').replace(/\]/g, '');; - return ''; + return ''; }) .replace(/file\[([^\s\[\]]+?)\]/g, function (face) { // 转义图片 var src = face.replace(/^file\[/g, '').replace(/\]/g, '');; - return '
'; + return '
'; }) .replace(/\[([^\s\[\]]+?)\]+link\[([^\s\[\]]+?)\]/g, function (face) { // 转义超链接 var text = face.replace(/link\[.*?\]/g, '').replace(/\[|\]/g, '');