申请会议
/**
* @param _.options.type :Audio||Video
* @param _.options.user:{id:"",name:"",avatar:""}
* @param _.options.status:0, // 0 没有 1 申请中 2 接收
*/
//
showRequest:function(options){
var _ = this ;
var fn = function(res){
_.options.type = options.type;
_.options.user = options.user;
_.options.issend = 1 ;
_.options.status = 1 ;
_.options.data = res;
}
IM.sendCallRequest(options,fn);
}
显示回复
showReply:function(options){
this.options.issend = 0 ;
this.options.status = 1 ;
this.options.type = options.type ;
this.options.user = options.user ;
this.options.data = options.data ;
},
处理请求 开始请求/结束请求
dealRequest:function(options){
var _ = this ;
if (options.status == 1){
_.options.type = options.type;
_.options.user = options.user;
_.options.data = options.data;
_.options.issend = 0 ;
_.options.status = 1 ;
}else{
_.$alert("对方已取消[" + (_.options.type == 'Audio'?"语音":"视频")+ "]通话");
_.options.status = 0 ;
}
},
处理回复
/**
* @return
*/
dealReply:function(data){//对方同意拒绝我方处理
var _ = this ;
if (data.status == 1){
this.win = window.open(this.options.data.pc_url);
this.options.status = 2 ;
}else{
this.$alert("对方拒绝接收");
this.options.status = 0 ;
}
},
取消
cancel:function(){
var _ = this ;
var fn = function(res){
if (res.status == 1){
// _.$alert("对方拒绝接收");
_.options.status = 0;
}else{
_.$alert(res.msg);
}
}
var options = {};
IM.sendCallCancel(options,fn);
},
同意/拒绝
agress:function(){//同意
this.options.status = 0 ;//不显示
this.sendReply(1);
this.win = window.open(this.options.data.pc_url);
},
refuse:function(){//拒绝
this.options.status = 0 ;
this.sendReply(0);
},
sendReply:function(status){
var options = {"status":status,"type":this.options.type,"user":this.options.user};
IM.sendCallReply(options);
}