限制聊天框提示出现一次

pull/30/head
陶士涵 4 years ago
parent 3f8721a14e
commit 4bc87ed87f

@ -12,7 +12,7 @@ func InitApiRouter(engine *gin.Engine){
engine.POST("/check", controller.LoginCheckPass)
engine.POST("/check_auth",middleware.JwtApiMiddleware, controller.MainCheckAuth)
//前后聊天
engine.GET("/chat_server", controller.NewChatServer)
engine.GET("/chat_server",middleware.Ipblack, controller.NewChatServer)
//获取消息
engine.GET("/messages", controller.GetVisitorMessage)
//发送单条消息

@ -14,6 +14,7 @@
.el-menu--horizontal>.el-menu-item.is-active{
border-bottom: 3px solid #409EFF;
}
.chatBg .el-tabs__header{margin: 0;}
.faceBtn, .faceBtn:after, .faceBtn {
border: 1px solid;
}

@ -16,7 +16,6 @@
.el-row{width:100%}#app{margin-top: 10px;}
.chatBg{min-height: 100%;background: #fff;border: solid 1px #e6e6e6;overflow: hidden;}
.chatLeft{ margin-left: 4px;}
.chatLeft .el-tabs__header{margin: 0;}
.sw-bg{background: #fff;border: solid 1px #e6e6e6;boder-top:none;padding:5px 10px;}
.chatContext .el-row{margin-bottom: 5px;}
.chatContext{position: relative;}
@ -138,7 +137,7 @@
</el-col>
<el-col :span="6">
<div class="chatBg chatRight">
<el-tabs v-model="rightTabActive">
<el-tabs v-model="rightTabActive" @tab-click="handleTabClick">
<el-tab-pane label="访客信息" name="visitorInfo">
<el-menu>
<el-tooltip content="点击加入黑名单" placement="left">
@ -180,7 +179,11 @@
</el-menu>
</el-tab-pane>
<el-tab-pane label="黑名单" name="blackList">
待开发
<el-row v-for="item in visitors" :key="item.uid" class="">
<div style="cursor:pointer" class="onlineUsers imgGray">
待开发
</div>
</el-row>
</el-tab-pane>
</el-tabs>
@ -530,6 +533,8 @@
if(tab.name=="second"){
this.getVisitorPage(1);
}
if(tab.name=="blackList"){
}
},
//所有访客分页展示
visitorPage(page){

@ -163,6 +163,7 @@
chatTitle:"正在连接...",
visitor:{},
face:[],
showKfonline:false,
},
methods: {
//初始化websocket
@ -189,10 +190,14 @@
const redata = JSON.parse(e.data);
if (redata.type == "kfOnline") {
let msg = redata.data
if(this.showKfonline && guest.to_id==msg.id){
return;
}
guest.to_id=msg.id;
this.chatTitle=msg.name+",正在与您沟通!"
$(".chatBox").append("<div class=\"chatTime\">"+this.chatTitle+"</div>");
this.scrollBottom();
this.showKfonline=true;
}
if (redata.type == "message") {
let msg = redata.data

Loading…
Cancel
Save