客服界面访客列表

pull/30/head v0.2.1-alpha
taoshihan1991 4 years ago
parent 35df7f3e0c
commit db0b023b3d

@ -81,7 +81,7 @@
</div> </div>
</el-row> </el-row>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="所有访客" name="second"> <el-tab-pane label="已接访客" name="second">
<el-row v-for="item in visitors" :key="item.uid" class=""> <el-row v-for="item in visitors" :key="item.uid" class="">
<div style="cursor:pointer" class="onlineUsers" v-bind:class="{'cur': item.visitor_id==currentGuest }" v-on:click="talkTo(item.visitor_id,item.name)"> <div style="cursor:pointer" class="onlineUsers" v-bind:class="{'cur': item.visitor_id==currentGuest }" v-on:click="talkTo(item.visitor_id,item.name)">
<el-col :span="4"> <el-col :span="4">

@ -195,15 +195,25 @@ var app=new Vue({
}, },
//处理当前在线用户列表 //处理当前在线用户列表
addOnlineUser:function (retData) { addOnlineUser:function (retData) {
var flag=false;
retData.last_message="新访客"; retData.last_message="新访客";
let vid=retData.uid; retData.status=1;
this.users.push(retData); retData.name=retData.username;
for(let i=0;i<this.users.length;i++){
if(this.users[i].uid==retData.uid){
flag=true;
}
}
if(!flag){
this.users.unshift(retData);
}
for(let i=0;i<this.visitors.length;i++){ for(let i=0;i<this.visitors.length;i++){
if(this.visitors[i].visitor_id==vid){ if(this.visitors[i].visitor_id==retData.uid){
this.visitors[i].status=1; this.visitors[i].status=1;
break; break;
} }
} }
}, },
//处理当前在线用户列表 //处理当前在线用户列表
removeOfflineUser:function (retData) { removeOfflineUser:function (retData) {

Loading…
Cancel
Save