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,7 +27,7 @@
27 27
				    <li class="mui-table-view-cell" id="identity">
28 28
				        <a class="mui-navigate-right">
29 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 31
				        </a>
32 32
				    </li>
33 33
				</ul>

+ 18 - 15
app/js/security.js

@ -5,12 +5,12 @@ var changePass = document.getElementById("changepass");
5 5
var phoneName = document.getElementById("phonename");
6 6
var emailName = document.getElementById("emailname");
7 7
var verified = document.getElementById("verified");
8
var identity = document.getElementById("identity");
9 8
var userType = document.getElementById("userType");
10 9

11 10
var phoneCookie = "";
12 11
var emailCookie = "";
13 12
var authStatus;
13
var typenum;
14 14
/*退出绑定手机页面*/
15 15
window.addEventListener('xsphone', function(event) {
16 16
	phoneCookie = event.detail.phonetel;
@ -61,9 +61,11 @@ mui.plusReady(function() {
61 61
	/*身份认证*/
62 62
	
63 63
	identity.addEventListener('tap', function() {
64
			var typenum = document.querySelector("#userType span").getAttribute("typenum");
64
			
65 65
			console.log(authStatus)
66
			if(authStatus==0){
66
			console.log(typenum)
67
			
68
			if(authStatus==0 && authStatus==4 && authStatus==5){
67 69
				mui.openWindow({
68 70
					url: '../html/identity.html',
69 71
					id: '../html/identity.html',
@ -75,8 +77,6 @@ mui.plusReady(function() {
75 77
					}
76 78
				});
77 79
			}else if(authStatus==1){ 
78
				
79
			}else{
80 80
				var btn = ["确认", "取消"];
81 81
				mui.confirm("您的身份已认证,确认要重新认证?", "提示", btn, function(e) {
82 82
					if(e.index == 0) {
@ -92,6 +92,8 @@ mui.plusReady(function() {
92 92
					});
93 93
					}
94 94
				});
95
			}else{
96
				
95 97
			}
96 98
			
97 99
		})	
@ -147,7 +149,7 @@ mui.plusReady(function() {
147 149
	function istyle() {
148 150
		var userId = plus.storage.getItem('userid');
149 151
		var isrenzheng = document.getElementById("isrenzheng");
150
		var istypes = document.getElementById("istypes");
152
		//var istypes = document.getElementById("istypes");
151 153
		mui.ajax(baseUrl + "/ajax/professor/auth", {
152 154
			data:{"id":userId},
153 155
			dataType: 'json', //数据格式类型
@ -158,23 +160,24 @@ mui.plusReady(function() {
158 160
				console.log(JSON.stringify(data));
159 161
				var $info = data.data || {};
160 162
				if(data.success && data.data) {
161
					istypes.setAttribute('typenum',$info.authentication)
163
					//istypes.setAttribute('typenum',$info.authentication)
162 164
					authStatus=$info.authStatus;
165
					console.log(authStatus)
163 166
					if($info.authStatus==0){
164 167
						isrenzheng.innerHTML="未认证";
165 168
					}else if($info.authStatus==1){
166 169
						isrenzheng.innerHTML="已认证";
167 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 183
			error: function() {