MemberController.js
3.7 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
"use strict";
var memberController = angular.module('memberController',[]);
memberController.controller('memberController', [
'$rootScope',
'$scope',
'MemberService',
function($rootScope, $scope, MemberService) {
$scope.currentPage = 1;
$scope.numPages = 1;
$scope.pageSize = 20;
$scope.totalRecord = 0;
$scope.pages = [];
$scope.members=[];
$scope.cardStatus='';
$scope.status=[
{name:'未认证', idCardStatus:'0'},
{name:'待审核', idCardStatus:'1'},
{name:'认证失败', idCardStatus:'2'},
{name:'认证成功', idCardStatus:'100'}
];
$scope.memberQuery={
keyword:'',
phone:'',
trueName:'',
wechat:'',
idCard:'',
pageNow:1,
pageSize:20
};
if(($scope.memberQuery.keyword!=null&&$scope.memberQuery.keyword!="")||($scope.memberQuery.phone!=null&&$scope.memberQuery.phone!="")
|| ($scope.memberQuery.trueName!=null&&$scope.memberQuery.trueName!="")|| ($scope.memberQuery.wechat!=null&&$scope.memberQuery.wechat!="")
||($scope.memberQuery.idCard!=null&&$scope.memberQuery.idCard!="")){
MemberService.memberPager($scope.memberQuery);
}
$scope.$on('member.list',function(){
$scope.members=MemberService.members.datas;
$scope.numPages=MemberService.members.totalPage;
$scope.totalRecord=MemberService.members.totalRecord;
});
//选当前页
$scope.onSelectPage = function(page) {
$scope.memberQuery.pageNow=page;
$scope.currentPage=page;
MemberService.memberPager($scope.memberQuery);
};
$scope.searchMember=function(){
$scope.memberQuery.pageNow=1;
MemberService.memberPager($scope.memberQuery);
};
$scope.changervar=function(){
$scope.memberQuery.idCard=$scope.cardStatus.idCardStatus;
}
}]
);
memberController.controller('memberDetailController',[
'$rootScope',
'$scope',
'MemberService',
function($rootScope, $scope, MemberService) {
var id = $rootScope.$stateParams.id;
$scope.editMemberInfo={
id:id,
phone:''
}
$scope.onSubmitMember=function(){
MemberService.updateMember($scope.editMemberInfo);
}
if(id) {
MemberService.getMemberDetail(id, function (data) {
$scope.editMemberInfo = data.data;
console.log(data.data)
});
}
}
]);
memberController.controller('memberAuditController',[
'$rootScope',
'$scope',
'MemberService',
'$state',
function($rootScope, $scope, MemberService,$state) {
var id = $rootScope.$stateParams.id;
$scope.memberDetail=[];
$scope.memberQuery={
keyword:'',
phone:'',
wechat:'',
pageNow:1,
pageSize:20
};
if(id) {
MemberService.getMemberDetail(id, function (data) {
$scope.memberDetail = data.data;
});
}
$scope.onSubmitMember=function(value){
$scope.memberDetail.idCardAuditStatus=value;
if(confirm("您确认要审核该用户吗")) {
MemberService.updateAuditIdCard($scope.memberDetail,function(res){
if(res.code == 0){
$state.go('listMember', $scope.memberQuery);
}else{
alert("小主,审核异常!!");
}
});
}
}
}
]);