pull/23/head
taoshihan1991 4 years ago
parent d3fa16d4a3
commit 98c27f483e

@ -43,7 +43,9 @@
<el-row v-for="item in users" :key="item.uid" class=""> <el-row v-for="item in users" :key="item.uid" class="">
<div :title="item.last_message" style="cursor:pointer" class="onlineUsers hasLastMsg" v-bind:class="{'cur': item.uid==currentGuest }" v-on:click="talkTo(item.uid,item.username)"> <div :title="item.last_message" style="cursor:pointer" class="onlineUsers hasLastMsg" v-bind:class="{'cur': item.uid==currentGuest }" v-on:click="talkTo(item.uid,item.username)">
<el-col :span="4"> <el-col :span="4">
<el-avatar :size="40" :src="item.avator"></el-avatar> <el-badge value="new" :hidden="item.hidden_new_message" class="item">
<el-avatar :size="40" :src="item.avator"></el-avatar>
</el-badge>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<div style="height:20px;overflow: hidden"><{item.username}></div> <div style="height:20px;overflow: hidden"><{item.username}></div>

@ -134,6 +134,7 @@ var app=new Vue({
for(let i=0;i<this.users.length;i++){ for(let i=0;i<this.users.length;i++){
if(this.users[i].uid==msg.id){ if(this.users[i].uid==msg.id){
this.$set(this.users[i],'last_message',msg.content); this.$set(this.users[i],'last_message',msg.content);
this.$set(this.users[i],'hidden_new_message',false);
} }
} }
this.scrollBottom(); this.scrollBottom();
@ -165,6 +166,11 @@ var app=new Vue({
this.getVistorInfo(guestId); this.getVistorInfo(guestId);
//获取当前客户消息 //获取当前客户消息
this.getMesssagesByVisitorId(guestId); this.getMesssagesByVisitorId(guestId);
for(var i=0;i<this.users.length;i++){
if(this.users[i].uid==guestId){
this.$set(this.users[i],'hidden_new_message',true);
}
}
}, },
//发送给客户 //发送给客户
chatToUser() { chatToUser() {

Loading…
Cancel
Save