群组管理

获取群组列表

IM.store.groups

获取群组详情


var groupInfo = IM.getGroupById(id);

创建群组

this.info = {name:"",owner:"",user_limit:200,intro:"",avatar:"",users:[]},
IM.createGroup(this.info,function(res){
	
	if (res.status == 1){
		router.push({ path: '/chat/group/' + res.data.id });
		_.closeDialog();
	}else{
		_.$message(res.msg);
	}
	this.loading = false ;
})

解散群组


var data = {"group_id":this.group.id};
var _ = this;
IM.dissolveGroup(data,function(res){
	if (res.status == 1){
		_.$message('解散群组成功');
		router.push({ path: '/group' });
	}else{
		_.$message(res.msg);
	}
})

退出群组

var data = {"group_id":this.group.id,"user_id":this.myId};
var _ = this;
IM.leaveGroup(data,function(res){
	if (res.status == 1){
		_.$message('退出群组成功');
		router.push({ path: '/group' });
	}else{
		_.$message(res.msg);
	}
})