From b49efc84f21e6ca70c040bce8ab25bc45d037264 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Fri, 7 May 2021 13:54:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=81=8A=E5=A4=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=BB=9A=E5=8A=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/install.go | 2 +- cmd/root.go | 1 - cmd/version.go | 15 -------- static/css/common.css | 12 +++++-- static/js/chat-page.js | 82 +++++++++++++++++++++++++++++++++--------- 5 files changed, 77 insertions(+), 35 deletions(-) delete mode 100644 cmd/version.go diff --git a/cmd/install.go b/cmd/install.go index caf5eee..7fea759 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -13,7 +13,7 @@ import ( var installCmd = &cobra.Command{ Use: "install", - Short: "example:go-fly install", + Short: "安装导入数据", Run: func(cmd *cobra.Command, args []string) { install() }, diff --git a/cmd/root.go b/cmd/root.go index 9efa387..4734e76 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -31,7 +31,6 @@ func Execute() { } } func init() { - rootCmd.AddCommand(versionCmd) rootCmd.AddCommand(serverCmd) rootCmd.AddCommand(installCmd) rootCmd.AddCommand(stopCmd) diff --git a/cmd/version.go b/cmd/version.go deleted file mode 100644 index f21f515..0000000 --- a/cmd/version.go +++ /dev/null @@ -1,15 +0,0 @@ -package cmd - -import ( - "fmt" - "github.com/spf13/cobra" - "github.com/taoshihan1991/imaptool/common" -) - -var versionCmd = &cobra.Command{ - Use: "version", - Short: "example:go-fly version", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("go-fly " + common.Version) - }, -} diff --git a/static/css/common.css b/static/css/common.css index 2c78d2f..b11e947 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -256,6 +256,8 @@ text-align: center; } /*客服聊天主板*/ +.chatBg{background: #fff;border: solid 1px #e6e6e6;overflow: hidden;} +.chatLeft{height:100%;overflow:auto;} .chatLeft .el-tabs__nav,.chatRight .el-tabs__nav { margin-left: 20px; } @@ -265,7 +267,7 @@ overflow: scroll!important; } .onlineUsers { - padding: 5px; + padding: 4px; height: 40px; line-height: 40px; font-size: 14px; @@ -297,8 +299,11 @@ background: rgb(245,245,245); /*margin-bottom: 80px;*/ } +.chatVisitorPage{ + height: calc(100% - 105px); + overflow-y: auto; +} .chatVisitorPage .chatBox{ - min-height: calc(100% - 105px); padding: 0 4px; } .chatBox .el-col{margin:10px 0;} @@ -309,6 +314,9 @@ text-align: left; margin-top: -15px; } +.chatMainPage{ + margin-top: 1px; +} .chatContent{ background-color: rgb(255,255,255); color: #000; diff --git a/static/js/chat-page.js b/static/js/chat-page.js index 1a16c89..1222562 100644 --- a/static/js/chat-page.js +++ b/static/js/chat-page.js @@ -36,11 +36,15 @@ new Vue({ this.ping(); }, OnOpen:function() { + console.log("ws:onopen"); this.chatTitle=GOFLY_LANG[LANG]['connectok']; + this.showTitle(this.chatTitle); + this.socketClosed=false; this.focusSendConn=false; }, OnMessage:function(e) { + console.log("ws:onmessage"); this.socketClosed=false; this.focusSendConn=false; const redata = JSON.parse(e.data); @@ -55,6 +59,13 @@ new Vue({ this.scrollBottom(); this.showKfonline=true; } + if (redata.type == "transfer") { + var kefuId = redata.data + if(!kefuId){ + return; + } + this.visitor.to_id=kefuId; + } if (redata.type == "notice") { let msg = redata.data if(!msg){ @@ -79,6 +90,9 @@ new Vue({ notify(msg.name, { body: msg.content, icon: msg.avator + },function(notification) { + window.focus(); + notification.close(); }); this.scrollBottom(); flashTitle();//标题闪烁 @@ -178,6 +192,7 @@ new Vue({ this.socket.send(JSON.stringify(message)); }, OnClose:function() { + console.log("ws:onclose"); this.focusSendConn=true; //this.socketClosed=true; // this.chatTitle="连接关闭!请重新打开页面"; @@ -247,12 +262,13 @@ new Vue({ content.content = replaceContent(visitorMes["content"]); content.time = visitorMes["time"]; _this.msgList.push(content); - if(_this.msgList.length>=4){ - _this.scrollBottom(); - } + _this.scrollBottom(); } - _this.$nextTick(function(){ - $(".chatBox").append("