Browse Source

身份认证修改

xuchunyang 8 years ago
parent
commit
8b81085e09
2 changed files with 19 additions and 16 deletions
  1. 1 1
      app/html/security.html
  2. 18 15
      app/js/security.js

+ 1 - 1
app/html/security.html

27
				    <li class="mui-table-view-cell" id="identity">
27
				    <li class="mui-table-view-cell" id="identity">
28
				        <a class="mui-navigate-right">
28
				        <a class="mui-navigate-right">
29
				        	<span class="mui-pull-left">身份认证 </span> 
29
				        	<span class="mui-pull-left">身份认证 </span> 
30
				        	<span class="rightword verified" id="userType"><span typenum="" id="istypes"></span>,<span id="isrenzheng"></span></span>
30
				        	<span class="rightword verified" id="userType"><span id="isrenzheng"></span></span>
31
				        </a>
31
				        </a>
32
				    </li>
32
				    </li>
33
				</ul>
33
				</ul>

+ 18 - 15
app/js/security.js

5
var phoneName = document.getElementById("phonename");
5
var phoneName = document.getElementById("phonename");
6
var emailName = document.getElementById("emailname");
6
var emailName = document.getElementById("emailname");
7
var verified = document.getElementById("verified");
7
var verified = document.getElementById("verified");
8
var identity = document.getElementById("identity");
9
var userType = document.getElementById("userType");
8
var userType = document.getElementById("userType");
10

9

11
var phoneCookie = "";
10
var phoneCookie = "";
12
var emailCookie = "";
11
var emailCookie = "";
13
var authStatus;
12
var authStatus;
13
var typenum;
14
/*退出绑定手机页面*/
14
/*退出绑定手机页面*/
15
window.addEventListener('xsphone', function(event) {
15
window.addEventListener('xsphone', function(event) {
16
	phoneCookie = event.detail.phonetel;
16
	phoneCookie = event.detail.phonetel;
61
	/*身份认证*/
61
	/*身份认证*/
62
	
62
	
63
	identity.addEventListener('tap', function() {
63
	identity.addEventListener('tap', function() {
64
			var typenum = document.querySelector("#userType span").getAttribute("typenum");
64
			
65
			console.log(authStatus)
65
			console.log(authStatus)
66
			if(authStatus==0){
66
			console.log(typenum)
67
			
68
			if(authStatus==0 && authStatus==4 && authStatus==5){
67
				mui.openWindow({
69
				mui.openWindow({
68
					url: '../html/identity.html',
70
					url: '../html/identity.html',
69
					id: '../html/identity.html',
71
					id: '../html/identity.html',
75
					}
77
					}
76
				});
78
				});
77
			}else if(authStatus==1){ 
79
			}else if(authStatus==1){ 
78
				
79
			}else{
80
				var btn = ["确认", "取消"];
80
				var btn = ["确认", "取消"];
81
				mui.confirm("您的身份已认证,确认要重新认证?", "提示", btn, function(e) {
81
				mui.confirm("您的身份已认证,确认要重新认证?", "提示", btn, function(e) {
82
					if(e.index == 0) {
82
					if(e.index == 0) {
92
					});
92
					});
93
					}
93
					}
94
				});
94
				});
95
			}else{
96
				
95
			}
97
			}
96
			
98
			
97
		})	
99
		})	
147
	function istyle() {
149
	function istyle() {
148
		var userId = plus.storage.getItem('userid');
150
		var userId = plus.storage.getItem('userid');
149
		var isrenzheng = document.getElementById("isrenzheng");
151
		var isrenzheng = document.getElementById("isrenzheng");
150
		var istypes = document.getElementById("istypes");
152
		//var istypes = document.getElementById("istypes");
151
		mui.ajax(baseUrl + "/ajax/professor/auth", {
153
		mui.ajax(baseUrl + "/ajax/professor/auth", {
152
			data:{"id":userId},
154
			data:{"id":userId},
153
			dataType: 'json', //数据格式类型
155
			dataType: 'json', //数据格式类型
158
				console.log(JSON.stringify(data));
160
				console.log(JSON.stringify(data));
159
				var $info = data.data || {};
161
				var $info = data.data || {};
160
				if(data.success && data.data) {
162
				if(data.success && data.data) {
161
					istypes.setAttribute('typenum',$info.authentication)
163
					//istypes.setAttribute('typenum',$info.authentication)
162
					authStatus=$info.authStatus;
164
					authStatus=$info.authStatus;
165
					console.log(authStatus)
163
					if($info.authStatus==0){
166
					if($info.authStatus==0){
164
						isrenzheng.innerHTML="未认证";
167
						isrenzheng.innerHTML="未认证";
165
					}else if($info.authStatus==1){
168
					}else if($info.authStatus==1){
166
						isrenzheng.innerHTML="已认证";
169
						isrenzheng.innerHTML="已认证";
167
					}else if($info.authStatus==2){
170
					}else if($info.authStatus==2){
168
						isrenzheng.innerHTML="认证中";
171
						isrenzheng.innerHTML="待审核";
172
					}else if($info.authStatus==3){
173
						isrenzheng.innerHTML="审核中";
174
					}else if($info.authStatus==4){
175
						isrenzheng.innerHTML="认证通过";
176
					}else if($info.authStatus==5){
177
						isrenzheng.innerHTML="认证失败";
169
					}
178
					}
170
					
179
					
171
					if($info.authentication==1){
172
						istypes.innerHTML="科研工作者";
173
					}else if($info.authentication==2){
174
						istypes.innerHTML="在企人员";
175
					}else if($info.authentication==3){ 
176
						istypes.innerHTML="在校生";
177
					}
180
					typenum = $info.authentication;
178
				}
181
				}
179
			},
182
			},
180
			error: function() {
183
			error: function() {