MemberService.js
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"use strict";
var MemberService = angular.module('MemberService',[]);
MemberService.service("MemberService", [
'$rootScope',
'BaseService',
function ($rootScope,BaseService) {
var _service = {
members:[],
member:[],
memberPager:function(query){
BaseService.request({
url:BaseService.url.memberPager_url,
method:'post',
mark:true,
data:query,
fn:function(response) {
if(response.code == 0) {
_service.members = response.data;
$rootScope.$broadcast('member.list');
}
}
});
},
getMemberDetail:function(id,callback){
BaseService.request({
url:BaseService.url.memberDetail_url+id,
method:'POST',
mark:true,
fn:function(response) {
if(callback) {
callback.call(this, response);
}
}
});
},
updateMember:function(memberInfo){
BaseService.request({
url:BaseService.url.updateMember_url,
method:'POST',
data:memberInfo,
mark:false,
fn:function(data) {
BaseService.updateAlert(data.message,data.code);
}
});
},
updateAuditIdCard:function(memberDetail,callback){
BaseService.request({
url:BaseService.url.updateAuditIdCard_url,
method:'POST',
data:memberDetail,
mark:false,
fn:function(data) {
callback.call(this,data);
}
});
}
}
return _service;
}]);