好友

好友列表

var _ = this ;
var options = {
    success:function(data){
        _.loading = 0;
        _.users = data;
        _.users_search = _.users;
    },
    fail:function(){
        _.loading = 0;
        _.$alert(res.errmsg);
    }
};
IM.friendManager.getFriendList(options);

搜索人员

var _ = this ;
var options = {
    key:_.searchkey,
    success:function(data){
        _.loading = 0;
        _.users = data.list;
    },
    fail:function(res){
        _.loading = 0;
        _.$alert(res.errmsg);
    }
};
_.loading = 1;
IM.friendManager.searchUser(options);

添加好友

var _ = this ;
var options = {
    linkman_account:user.account,
    request_reason:"",
    success:function(data){
        _.users[key].isrequest = 1;
        _.$alert("申请已经发送");
    },
    fail:function(res){
        _.$alert(res.errmsg);
    }
};
IM.friendManager.addFriend(options);

删除好友

var _ = this ;
var options = {
    linkman_account:_.user.account,
    success:function(res){
        _.$router.push({ path:"/contact"});
    }
};
IM.friendManager.deleteFriend(options);

好友请求列表

var _ = this ;
var options = {
    success:function(data){
        _.loading = 0 ;
        _.requests = data;
        _.requests_search = _.requests;
    },
    fail:function(res){
        _.loading = 0 ;
        _.$alert(res.errmsg);
    }
};
_.loading = 1 ;
IM.friendManager.getFriendRequestList(options);

处理好友请求

var _ = this;
var options = {
    user_account:request.account,
    deal_status:status,
    deal_reason:"",
    success:function(res){
        request.deal_status = status;
    },
    fail:function(res){
        _.$alert(res.errmsg);
    }
};
IM.friendManager.dealFriendRequest(options);

加入黑名单

var _ = this;
var options = {
    block_account:request.account,
    success:function(res){
        request.deal_status = 2;
    },
    fail:function(res){
        _.$alert(res.errmsg);
    }
};
IM.friendManager.setFriendBlock(options);

相关事件

参数 说明
onFriendInvite 收到新的朋友
onFriendReply 收到新的朋友回复
onFriendRemove 你被好友移除
onNotifyChanage 收到通知

results matching ""

    No results matching ""