修改客服系统样式

pull/30/head
taoshihan1991 5 years ago
parent 99901aced5
commit ea9e81ede8

@ -56,13 +56,13 @@ func NewChatServer(c *gin.Context){
//接受消息 //接受消息
var receive []byte var receive []byte
var recevString string var recevString string
messageType, receive, err := conn.ReadMessage() _, receive, err := conn.ReadMessage()
if err != nil { if err != nil {
log.Println(err) log.Println(err)
return return
} }
recevString=string(receive) recevString=string(receive)
log.Println("客户端:", recevString,messageType) log.Println("客户端:", recevString)
message<-&Message{ message<-&Message{
conn:conn, conn:conn,
content: receive, content: receive,
@ -117,7 +117,7 @@ func SendNoticeToAllKefu() {
Type: "notice", Type: "notice",
} }
str, _ := json.Marshal(msg) str, _ := json.Marshal(msg)
conn.WriteMessage(1,str) conn.WriteMessage(websocket.TextMessage,str)
} }
} }
} }

@ -13,7 +13,8 @@
<style> <style>
html, body {height: 100%;padding: 0;margin: 0;background-color: #f5f5f5;} html, body {height: 100%;padding: 0;margin: 0;background-color: #f5f5f5;}
.el-row{width:100%}#app{margin-top: 10px;} .el-row{width:100%}#app{margin-top: 10px;}
.chatLeft{min-height: 100%;border-bottom: solid 1px #e6e6e6;overflow: hidden;border-top: solid 1px #e6e6e6;} .chatLeft{min-height: 100%;background: #fff;border: solid 1px #e6e6e6;overflow: hidden;}
.chatLeft .el-tabs__header{margin: 0;}
.sw-bg{background: #fff;border: solid 1px #e6e6e6;boder-top:none;padding:5px 10px;} .sw-bg{background: #fff;border: solid 1px #e6e6e6;boder-top:none;padding:5px 10px;}
.chatContext .el-row{margin-bottom: 5px;} .chatContext .el-row{margin-bottom: 5px;}
.chatUser{ .chatUser{
@ -28,7 +29,7 @@
color: #000; color: #000;
border: 1px solid rgb(152, 199, 230); border: 1px solid rgb(152, 199, 230);
padding: 8px 15px; padding: 8px 15px;
min-height: 35px; min-height: 26px;
word-break: break-all; word-break: break-all;
position: relative; position: relative;
border-radius: 5px; border-radius: 5px;
@ -54,6 +55,8 @@
.chatBoxMe .chatContent:after{left:auto;right: -10px;} .chatBoxMe .chatContent:after{left:auto;right: -10px;}
.chatArea{margin: 10px 0;} .chatArea{margin: 10px 0;}
.chatBox{max-height: 350px;overflow-y: auto;overflow-x: hidden;} .chatBox{max-height: 350px;overflow-y: auto;overflow-x: hidden;}
.onlineUsers{padding: 5px;height: 40px;line-height: 40px;font-size: 14px;border-bottom: solid 1px #e6e6e6;}
.onlineUsers:hover,.onlineUsers.cur{background-color: #f0f9eb;color: #67C23A;}
</style> </style>
</head> </head>
<body> <body>
@ -61,16 +64,24 @@
<template> <template>
<el-row :gutter="5"> <el-row :gutter="5">
<el-col :span="6"> <el-col :span="6">
<el-menu class="chatLeft" :default-active="currentGuest"> <div class="chatLeft">
<el-menu-item> <el-tabs v-model="leftTabActive">
<i class="el-icon-s-promotion"></i> <el-tab-pane label="在线用户" name="first">
<span slot="title">在线用户</span> <el-row v-for="item in users" :key="item.uid" class="">
</el-menu-item> <div style="cursor:pointer" class="onlineUsers" v-bind:class="{'cur': item.uid==currentGuest }" v-on:click="talkTo(item.uid)">
<el-menu-item :index="v.uid" v-for="v in users" v-bind:key="v.uid" v-on:click="talkTo(v.uid)"> <el-col :span="4">
<i class="el-icon-user"></i> <el-avatar :size="40" :src="item.avator"></el-avatar>
<span slot="title"><{v.username}></span> </el-col>
</el-menu-item> <el-col :span="16">
</el-menu> <{item.username}>
</el-col>
</div>
</el-row>
</el-tab-pane>
<el-tab-pane label="所有访客" name="second">
</el-tab-pane>
</el-tabs>
</div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="sw-bg chatContext"> <div class="sw-bg chatContext">
@ -112,6 +123,7 @@
delimiters:["<{","}>"], delimiters:["<{","}>"],
data: { data: {
fullscreenLoading:true, fullscreenLoading:true,
leftTabActive:"first",
users:[], users:[],
usersMap:[], usersMap:[],
server:"ws://127.0.0.1:8080/chat_server", server:"ws://127.0.0.1:8080/chat_server",

@ -103,7 +103,7 @@
var guest={}; var guest={};
guest.id = ""; guest.id = "";
guest.name = typeof(returnCitySN)!="undefined" ?returnCitySN["cip"]+"-"+returnCitySN["cname"]:"小米"; guest.name = typeof(returnCitySN)!="undefined" ?returnCitySN["cip"]+"-"+returnCitySN["cname"]:"小米";
guest.avator = "https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=1539628792,3031847515&fm=85&app=92&f=JPEG?w=121&h=75&s=65F03DC608BA199ED70C5D3703009040"; guest.avator = "https://www.wolive.cc/assets/upload/"+Math.floor(Math.random()*10)+".jpg";
guest.group = "1"; guest.group = "1";
guest.to_id=""; guest.to_id="";

Loading…
Cancel
Save