Browse Source

我的里面的页面,搜索页面修改

xuchunyang 8 years ago
parent
commit
e126abdd34

+ 8 - 8
app/html/attentions.html

@ -26,16 +26,16 @@
26 26
			</ul>
27 27
		</div>
28 28
		<div class="alllist" id="pullrefresh">
29
	        <div  class="mui-card-content conblock childlist mui-scroll-wrapper" style="display: block;"><!--当前x显示列表   'childlist'的显示隐藏-->
30
		        <ul class="mui-table-view protable list mui-scroll">
31
		            
32
		        </ul>
29
	        <div  class="mui-card-content conblock childlist " style="display: block;"><!--当前x显示列表   'childlist'的显示隐藏-->
30
		      	<ul class="mui-table-view protable list ">
31
			            
32
			    </ul>
33 33
			</div>
34
			<div class="mui-card-content conblock childlist mui-scroll-wrapper" >
35
			        <ul class="mui-table-view protable list2 mui-scroll">
34
			<div class="mui-card-content conblock childlist " >
35
			    <ul class="mui-table-view protable list2 ">
36 36
			           
37
			        </ul>
38
			 </div>
37
			    </ul>
38
			</div>
39 39
		</div>
40 40
		<!--<a id="scrollToTop" class="backTop hide"> <span class="mui-icon mui-icon-arrowup"></span> </a>-->
41 41
    </div>

+ 6 - 1
app/html/fillinfo.html

@ -6,6 +6,7 @@
6 6
		<title>完善个人信息</title>
7 7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
9 10
		<link href="../css/app.css" rel="stylesheet" />
10 11
	</head>
11 12
@ -31,7 +32,9 @@
31 32
						<li><label>职称</label></li>
32 33
						<li class="basicfrm"><input type="text"  class="mui-input-clear frmtype" id="userTitle"></li>
33 34
						<li><label>所在地</label></li>
34
						<li class="basicfrm"><input type="text"  class="mui-input-clear frmtype"></li>
35
						<li class="basicfrm"><input type="text" class="mui-input-clear frmtype"  id ="showCityPicker" value=""></li>
36
					    <input type="hidden"  class="mui-input-clear frmtype" id="data-province">
37
					    <input type="hidden"  class="mui-input-clear frmtype" id="data-address">
35 38
					</ul>
36 39
			        
37 40
		        </div>
@ -41,6 +44,8 @@
41 44
			</div>
42 45
		</div>
43 46
		<script src="../js/public/mui.min.js"></script>
47
		<script src="../js/public/mui.picker.min.js"></script>
48
		<script src="../js/public/city.data.js" ></script>
44 49
		<script src="../js/public/base.js"></script>
45 50
		<script src="../js/fillinfo.js"></script>
46 51
	</body>

+ 1 - 1
app/html/index_home.html

@ -66,7 +66,7 @@
66 66
            <div class="mui-indicator"></div>
67 67
          </div>
68 68
        </div>
69
         
69
         <!--<a href="../html/fillinfo.html">ddddd</a>-->
70 70
        <!-- 九宫格排版-->
71 71
        <div class="mui-card-content conblock">
72 72
        	<div class="maintitbox">

+ 5 - 10
app/html/myaccount.html

@ -86,12 +86,12 @@
86 86
				        	<span class="mui-pull-left">我的关注</span>
87 87
				        </a>
88 88
				    </li>
89
				    <li class="mui-table-view-cell" id="goNewuser">
89
				   <!-- <li class="mui-table-view-cell" id="goNewuser">
90 90
				        <a class="mui-navigate-right">
91 91
				        	<em class="mui-icon iconfont icon-friendfavor actionicon addicon mui-pull-left"></em>
92 92
				        	<span class="mui-pull-left">邀请新用户</span>
93 93
				        </a>
94
				    </li> 
94
				    </li> -->
95 95
				</ul>
96 96
		    </div>
97 97
		    <div class="mui-input-group  marginbox">
@ -117,12 +117,7 @@
117 117
		                    <img class="mui-pull-left headimg2" src="../images/default-photo.jpg" >
118 118
		                    <div class="mui-pull-left "  style="color:#797979; margin: 10% 5%;"><span id="goreg">注册</span> / <span id="gologin">登录</span> </div>
119 119
		                </a>
120
		                <div class="mui-pull-right updatebtn">
121
			        		<a class="editbox" id="editbox">
122
			        			<!--<img src="../images/edit.png" />-->
123
			        			<span class="mui-icon iconfont icon-edit"></span>
124
			        		</a>
125
			        	</div>
120
		              
126 121
			        </div>
127 122
		        </div>
128 123
		        <ul class="mui-table-view">
@ -172,12 +167,12 @@
172 167
				        	<span class="mui-pull-left">我的关注</span>
173 168
				        </a>
174 169
				    </li>
175
				    <li class="mui-table-view-cell">
170
				   <!-- <li class="mui-table-view-cell">
176 171
				        <a class="mui-navigate-right">
177 172
				        	<em class="mui-icon iconfont icon-friendfavor actionicon addicon mui-pull-left"></em>
178 173
				        	<span class="mui-pull-left">邀请新用户</span>
179 174
				        </a>
180
				    </li> 
175
				    </li> -->
181 176
				</ul>
182 177
		    </div>
183 178
		    <div class="mui-input-group  marginbox">

+ 2 - 13
app/html/search-home.html

@ -87,19 +87,8 @@
87 87
		mui(".hotsearch").on('tap', 'li', function() {
88 88
			plus.nativeUI.showWaiting();
89 89
			key = this.innerHTML;
90
			mui.openWindow({
91
				url: '../html/search.html',
92
				id: '../html/search.html',
93
				show:{
94
			      autoShow:false,
95
			      aniShow:"fade-in",
96
			    },
97
				extras:{
98
			      key:key,
99
			      bigClass:bigClass
100
			    }
101
			});
102
			
90
			plus.nativeUI.showWaiting();//显示原生等待框
91
            plus.webview.create("../html/search.html",'search.html',{},{key:key,bigClass:bigClass});
103 92
		});
104 93
		/*按键字搜索*/
105 94
		searchval.addEventListener("keyup", function() {

+ 0 - 13
app/html/search.html

@ -31,19 +31,6 @@
31 31
    <!-- 主页面内容容器 -->
32 32
    <div class="mui-content">
33 33
    	
34
    	<!--<div class="filterbox" style=" position: fixed; z-index:1; top:45px; width:100%">
35
			<ul class="filterblock" style="width:100%">
36
				<li style="width:33.3333%;">
37
					<a href="#middlePopovercity" class="mui-btn mui-btn-block mui-btn-outlined filterlist2 mui-ellipsis"><span id="addressid">全国</span><em class="mui-icon mui-icon-arrowdown"></em></a>	
38
				</li>
39
				<li style="width:33.3333%;">
40
					<a href="#middlePopoveracad" class="mui-btn mui-btn-block mui-btn-outlined filterlist2 mui-ellipsis"><span id="subjectid">学术领域</span><em class="mui-icon mui-icon-arrowdown"></em></a>
41
				</li>
42
				<li style="width:33.3333%;">
43
					<a href="#middlePopoveruse" class="mui-btn mui-btn-block mui-btn-outlined filterlist2 mui-ellipsis"><span id="industryid">应用行业</span><em class="mui-icon mui-icon-arrowdown"></em></a>
44
				</li>
45
			</ul>
46
		</div>-->
47 34
		
48 35
		<div class="filterbox" style=" position: fixed; z-index:1; top:45px; width:100%">
49 36
			<ul class="filterblock" style="width:100%">

+ 2 - 2
app/html/security.html

@ -42,7 +42,7 @@
42 42
				    </li>
43 43
				</ul>
44 44
		    </div>
45
		    <div class="mui-input-group marginbox">
45
		    <!--<div class="mui-input-group marginbox">
46 46
				<ul class="mui-table-view">
47 47
				    <li class="mui-table-view-cell">
48 48
				        <a class="mui-navigate-right">
@ -63,7 +63,7 @@
63 63
				        </a>
64 64
				    </li>
65 65
				</ul>
66
		    </div>
66
		    </div>-->
67 67
		    <div class="mui-input-group marginbox">
68 68
				<ul class="mui-table-view">
69 69
				    <li class="mui-table-view-cell">

+ 2 - 3
app/html/setup.html

@ -24,13 +24,12 @@
24 24
				    </li>
25 25
				</ul>
26 26
		    </div>
27
		    <div class="mui-input-group marginbox" style="margin-bottom: 4px;">
27
		    <!--<div class="mui-input-group marginbox" style="margin-bottom: 4px;">
28 28
				<ul class="mui-table-view">
29 29
				    <li class="mui-table-view-cell">
30 30
				        <a class="mui-navigate-right rightnone" href="setup.html">
31 31
				        	<span class="mui-pull-left">推送消息设置</span>
32 32
				        	<div class="mui-pull-right">
33
				        		<!-- 开关打开状态 -->
34 33
								<div class="mui-switch mui-switch-mini witchbg mui-active">
35 34
								   <div class="mui-switch-handle"></div>
36 35
								</div>
@ -41,7 +40,7 @@
41 40
		    </div>
42 41
		    <div class="marginbox litlabel" style="margin:0 10px 20px 10px;">
43 42
		    	<span class="listtit2">有新的咨询或回复时通知您</span>
44
		    </div>
43
		    </div>-->
45 44
		    <div class="mui-input-group marginbox">
46 45
				<ul class="mui-table-view">
47 46
				    <li class="mui-table-view-cell">

+ 5 - 8
app/js/attentions.js

@ -5,12 +5,9 @@ var allPages = 1, // 总页数;
5 5
    checkedindex = 0
6 6
var table = document.body.querySelector('.list');
7 7
var table1 = document.body.querySelector('.list2');
8
var deceleration = mui.os.ios?0.003:0.0009;
9
mui('.mui-scroll-wrapper').scroll({
10
	bounce: false,
11
	indicators: true, //是否显示滚动条
12
	deceleration:deceleration
13
});
8

9
//mui('.mui-scroll-wrapper').scroll({});
10

14 11
mui.init({
15 12
	pullRefresh: {
16 13
		container: '#pullrefresh',
@ -94,7 +91,7 @@ function getOneExpert(pageNo, pageSize) {
94 91
			},
95 92
			dataType: 'json', //数据格式类型
96 93
			type: 'GET', //http请求类型
97
			timeout: 10000,
94
			//timeout: 10000,
98 95
			success: function(data) {
99 96
				if(data.success && data.data.data != "") {
100 97
					var datalist = data.data.data;
@ -122,7 +119,7 @@ function getOneResources(pageNo, pageSize) {
122 119
			},
123 120
			dataType: 'json', //数据格式类型
124 121
			type: 'GET', //http请求类型
125
			timeout: 10000,
122
			//timeout: 10000,
126 123
			success: function(data) {
127 124
				plus.nativeUI.closeWaiting();
128 125
				plus.webview.currentWebview().show("slide-in-right", 150);

+ 31 - 7
app/js/bindmail.js

@ -4,24 +4,46 @@ mui.ready(function() {
4 4
	var inputEmail = document.getElementById("inputemail");
5 5
	var sendCode = document.getElementById("sendcode");
6 6

7
	/*发送按钮*/
8
	sendCode.addEventListener("tap", function() {
9
		userEmail();
10
	});
11

12 7
	mui.plusReady(function() {
8
		
9
		/*发送按钮*/
10
		sendCode.addEventListener("tap", function() {
11
			userEmail();
12
		});
13 13

14 14
		/*校验用户账号*/
15 15
		function userEmail() {
16 16
			var gunf = /^\w+@\w+\.((cn)|(com)|(com\.cn))$/;
17 17
			if(gunf.test(inputEmail.value)) {
18
				sendEmail();
18
				isReg();
19 19
			} else {
20 20
				plus.nativeUI.toast("请输入正确的邮箱", toastStyle);
21 21
				return;
22 22
			}
23 23
		}
24 24

25
		/*判断账号是否注册*/
26
		function isReg() {
27
			mui.ajax(baseUrl + '/ajax/isReg?key=' + inputEmail.value, {
28
				dataType: 'json', //数据格式类型
29
				type: 'GET', //http请求类型
30
				timeout: 10000, //超时设置
31
				async: false,
32
				success: function(data) {
33
					console.log(data.data);
34
					if(data.data == false) {
35
						plus.nativeUI.toast("您的邮箱已被绑定", toastStyle);
36
						return;
37
					} else {
38
						sendEmail();
39
					}
40
				},
41
				error: function() {
42
					plus.nativeUI.toast("服务器链接超时", toastStyle);
43
				}
44
			});
45
		}
46

25 47
		/*判断账号是否注册*/
26 48
		function sendEmail() {
27 49
			var userId = plus.storage.getItem('userid');
@ -36,8 +58,8 @@ mui.ready(function() {
36 58
				success: function(data) {
37 59
					if(data.success && data.data) {
38 60
						plus.nativeUI.toast("发送成功,请登录邮箱验证", toastStyle);
39
						return;
40 61
						mui.currentWebview.close();
62
						return;
41 63
					}
42 64
				},
43 65
				error: function() {
@ -47,6 +69,8 @@ mui.ready(function() {
47 69
			});
48 70
		}
49 71

72
	
73
	
50 74
	});
51 75

52 76
});

+ 4 - 5
app/js/bindphone.js

@ -170,12 +170,11 @@ mui.ready(function() {
170 170
					console.log(data.data);
171 171
					if(data.success && data.data) {
172 172
						plus.nativeUI.toast("手机绑定成功", toastStyle);
173
						var securityPage = plus.webview.getWebviewById('html/security.html');
174
						mui.fire(securityPage, 'closeUser', {
175
							phoneName: phoneName.value
173
						var securityPage = plus.webview.getWebviewById('../html/security.html');
174
						mui.fire(securityPage,'xsphone', {
175
							phonetel:phoneName.value
176 176
						});
177
						mui.currentWebview.close();
178
						return;
177
						mui.back();
179 178
					}else{
180 179
						plus.nativeUI.toast("手机绑定失败", toastStyle);
181 180
						return;

+ 20 - 2
app/js/fillinfo.js

@ -8,7 +8,21 @@ mui.ready(function() {
8 8
	var userPosition = document.getElementById("userPosition");
9 9
	var userTitle = document.getElementById("userTitle");
10 10
	var goIndex = document.getElementById("goIndex");
11
	
11
	var dataProvince = document.getElementById("data-province");
12
	var dataAddress = document.getElementById("data-address");
13
	/*选择地址*/
14
	var cityPicker = new mui.PopPicker({layer: 2});
15
	cityPicker.setData(cityData);
16
	var showCityPickerButton = document.getElementById('showCityPicker');
17
	showCityPickerButton.addEventListener('tap', function(event) {
18
		cityPicker.show(function(items) {
19
			showCityPickerButton.value = items[0].text + " " + items[1].text;
20
			dataProvince.value = items[0].text;
21
			dataAddress.value = items[1].text;
22
			//返回 false 可以阻止选择框的关闭
23
			//return false;
24
		});
25
	}, false);
12 26
	mui.plusReady(function() {
13 27
		
14 28
		var self = plus.webview.currentWebview();
@ -20,6 +34,7 @@ mui.ready(function() {
20 34

21 35
		/*提交个人信息*/
22 36
		goIndex.addEventListener('tap', function() {
37
			var d = document.getElementById('showCityPicker').value;
23 38
			goVal();
24 39
		});
25 40

@ -29,8 +44,11 @@ mui.ready(function() {
29 44
			$data.orgName = userMechanism.value;
30 45
			$data.title = userTitle.value;
31 46
			$data.department = userDepartment.value;
32
			$data.address = userPosition.value;
47
			$data.office = userPosition.value;
48
			$data.province = dataProvince.value;
49
			$data.address = dataAddress.value;
33 50
			$data.id = self.userid;
51
			console.log(JSON.stringify($data))
34 52
			mui.ajax(baseUrl + '/ajax/professor', {
35 53
				data: $data,
36 54
				dataType: 'json', //数据格式类型

+ 1 - 1
app/js/index.js

@ -20,7 +20,7 @@ mui('.list').on('tap','a',function(){
20 20
/*点击搜索按钮*/
21 21
search.addEventListener('focus', function() {
22 22
	var nwaiting = plus.nativeUI.showWaiting();//显示原生等待框
23
    webviewShow = plus.webview.create("../html/search-home.html");//后台创建webview并打开show.html
23
    webviewShow = plus.webview.create("../html/search-home.html","../html/search-home.html");//后台创建webview并打开show.html
24 24
    webviewShow.addEventListener("loaded", function() {
25 25
        nwaiting.close(); //新webview的载入完毕后关闭等待框
26 26
        webviewShow.show("slide-in-right",150); //把新webview窗体显示出来,显示动画效果为速度150毫秒的右侧移入动画

+ 6 - 5
app/js/myaccount.js

@ -19,7 +19,7 @@ mui.ready(function() {
19 19
		loginStatus();
20 20

21 21
		/*用户信息初始化*/
22
		userInformation()
22
		userInformation();
23 23

24 24
		/*登录按钮*/
25 25
		goLogin.addEventListener('tap', function() {
@ -29,7 +29,6 @@ mui.ready(function() {
29 29
		/*注册按钮*/
30 30
		goReg.addEventListener('tap', function() {
31 31
			goRegFun();
32

33 32
		})
34 33

35 34
		/*退出登录刷新页面*/
@ -105,7 +104,9 @@ mui.ready(function() {
105 104
				dataType: 'json', //数据格式类型
106 105
				type: 'GET', //http请求类型
107 106
				timeout: 10000, //超时设置
107
				async:true,
108 108
				success: function(data) {
109
					
109 110
					var $info = data.data || {}
110 111
					if(data.success && data.data) {
111 112
						document.getElementById("userName").innerText = $info.name || '';
@ -115,7 +116,7 @@ mui.ready(function() {
115 116
						var userMechanism = document.getElementById("userMechanism");
116 117
						var userCity = document.getElementById("userCity");
117 118
						var zixunOk = document.getElementById("zixunOk");
118
						
119
					
119 120
						($info.title != '') ? userTitle.innerText = $info.title : userTitle.innerText = '';
120 121
						($info.office != '') ? userPosition.innerText = " , " +  $info.office  : userPosition.innerText = '';
121 122
						($info.department != '') ? userDepartment.innerText = $info.department : userDepartment.innerText = '';
@ -129,9 +130,9 @@ mui.ready(function() {
129 130
							start[i].classList.add("icon-favorfill");
130 131
						}
131 132
						if($info.hasHeadImage == 1) {
132
							document.getElementById("userImg").setAttribute("src", "../images/head/" + $info.id + "_m.jpg");
133
							document.getElementById("userImg").setAttribute("src", baseUrl + "/images/head/" + $info.id + "_m.jpg");
133 134
						} else {
134
							document.getElementById("userImg").setAttribute("src", "../images/default-photo.jpg");
135
							document.getElementById("userImg").setAttribute("src", baseUrl +  "/images/default-photo.jpg");
135 136
						}
136 137
						if($info.authentication) {
137 138
							document.querySelector('.authicon').style.display = "inline";

+ 25 - 4
app/js/searchhome.js

@ -28,7 +28,7 @@ mui.init({
28 28
			up: {
29 29
				contentrefresh: '正在加载...',
30 30
				callback: pullupRefresh,
31
				auto:true
31
				//auto:true
32 32
			}
33 33
		}
34 34
});
@ -123,7 +123,7 @@ searchval.addEventListener("keyup", function() {
123 123
	console.log(province);
124 124
	console.log(authentication);*/
125 125
		plus.nativeUI.showWaiting();
126

126
        
127 127
		expert(key, subject, industry, province, address, authentication, 10, 1);
128 128
	}
129 129
})
@ -252,17 +252,28 @@ function expert(key, subject, industry, province, address, authentication, pageS
252 252
			timeout: 10000,
253 253
			success: function(data) {
254 254
				table.innerHTML = '';
255
				plus.nativeUI.closeWaiting();
256 255
				plus.webview.currentWebview().show("slide-in-right",150);
256
				plus.nativeUI.closeWaiting();
257
				var perrid = plus.webview.getWebviewById('../html/search-home.html');
258
				if(perrid){
259
				  setTimeout(function() {
260
					 perrid.close();
261
				   }, 1000);
262
				}
257 263
				if(data.success && data.data.data != '') {
258 264
					var datalist = data.data.data;
259 265
					console.log(data.data.total)
260 266
					datalistEach(datalist);
261 267
					mui('#pullrefresh').pullRefresh().refresh(true);
262
	                mui('#pullrefresh').pullRefresh().scrollTo(0,0,0);
268
	                mui('#pullrefresh').pullRefresh().scrollTo(0,0);
269
	                if(data.data.total<data.data.pageSize){
270
	                	mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新	
271
	                }
263 272
				} else {
264 273
					plus.nativeUI.toast("抱歉,没有找到对应的搜索", toastStyle);
274
					mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
265 275
				}
276
				
266 277
			},
267 278
			error: function() {
268 279
				plus.nativeUI.toast("服务器链接超时", toastStyle);
@ -287,13 +298,23 @@ function expert(key, subject, industry, province, address, authentication, pageS
287 298
				table.innerHTML = '';
288 299
				plus.nativeUI.closeWaiting();
289 300
				plus.webview.currentWebview().show("slide-in-right",150);
301
				var perrid = plus.webview.getWebviewById('../html/search-home.html');
302
				if(perrid){
303
				  setTimeout(function() {
304
					 perrid.close();
305
				   }, 1000);
306
				}
290 307
				if(data.success && data.data.data != '') {
291 308
					var datalist = data.data.data;
292 309
					resourcesEach(datalist);
293 310
					mui('#pullrefresh').pullRefresh().refresh(true);
294 311
	                mui('#pullrefresh').pullRefresh().scrollTo(0,0,0);
312
	                if(data.data.total<data.data.pageSize){
313
	                	mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新	
314
	                }
295 315
				} else {
296 316
					plus.nativeUI.toast("抱歉,没有找到对应的搜索", toastStyle);
317
					mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
297 318
				}
298 319
			},
299 320
			error: function() {

+ 117 - 116
app/js/security.js

@ -1,126 +1,127 @@
1 1
//注册信息
2
mui.ready(function() {
3

4
	/*定义全局变量*/
5
	var bdPhone = document.getElementById("bdPhone");
6
	var bdEmail = document.getElementById("bdEmail");
7
	var changePass = document.getElementById("changepass");
8
	var phoneName = document.getElementById("phonename");
9
	var emailName = document.getElementById("emailname");
10
	var verified = document.getElementById("verified");
11
	var phoneCookie = "";
12
	var emailCookie = "";
13

14
	mui.plusReady(function() {
15
		
16
		isAuthentication();
17
		
18
		lookup();
19
		
20
		/*退出绑定手机页面*/
21
        window.addEventListener('securityPage',function(event){
22
		    phoneName = event.detail.id;
23
		    ifPhoneAmdEmail(phoneCookie)
24
		})
25
		
26
		
27
		
28
		bdEmail.addEventListener('tap', function() {
29
			mui.openWindow({
30
				url: '../html/bindmail.html',
31
				id: '../html/bindmail.html',
32
				show: {
33
					aniShow: "slide-in-right"
34
				}
35
			});
36
		})
37

38
		bdPhone.addEventListener('tap', function() {
39
			mui.openWindow({
40
				url: '../html/bindphone.html',
41
				id: '../html/bindphone.html',
42
				show: {
43
					aniShow: "slide-in-right"
44
				}
45
			});
46
		})
47

48
		changePass.addEventListener('tap', function() {
49
			mui.openWindow({
50
				url: '../html/changepass.html',
51
				id: '../html/changepass.html',
52
				show: {
53
					aniShow: "slide-in-right"
54
				}
55
			});
56
		})
57

58
		function ifPhoneAmdEmail(){
59
			/*判断是否绑定了手机号*/
60
			if(phoneCookie != "" && phoneCookie != null && phoneCookie != "null") {
61
				/*phoneName.innerText = (phoneCookie.substring(0, 3) + "****" + phoneCookie.substring(7, 11));*/
62
				 phoneName.innerText = (phoneCookie);
63
			} else {
64
				phoneName.innerText = ("请绑定手机号");
2
var bdPhone = document.getElementById("bdPhone");
3
var bdEmail = document.getElementById("bdEmail");
4
var changePass = document.getElementById("changepass");
5
var phoneName = document.getElementById("phonename");
6
var emailName = document.getElementById("emailname");
7
var verified = document.getElementById("verified");
8
var phoneCookie = "";
9
var emailCookie = "";
10

11
/*退出绑定手机页面*/
12
window.addEventListener('xsphone', function(event) {
13
	phoneCookie = event.detail.phonetel;
14
	phoneName.innerText = phoneCookie;
15
})
16

17
mui.plusReady(function() {
18

19
	isAuthentication();
20

21
	lookup();
22

23
	bdEmail.addEventListener('tap', function() {
24
		mui.openWindow({
25
			url: '../html/bindmail.html',
26
			id: '../html/bindmail.html',
27
			show: {
28
				aniShow: "slide-in-right"
65 29
			}
66
	
67
			/*判断是否绑定了邮箱*/
68
			if(emailCookie != "" && emailCookie != null && emailCookie != "null") {
69
				emailName.innerText = (emailCookie);
70
			} else {
71
				emailName.innerText = ("请绑定邮箱");
30
		});
31
	})
32

33
	bdPhone.addEventListener('tap', function() {
34
		mui.openWindow({
35
			url: '../html/bindphone.html',
36
			id: '../html/bindphone.html',
37
			show: {
38
				aniShow: "slide-in-right"
72 39
			}
40
		});
41
	})
42

43
	changePass.addEventListener('tap', function() {
44
		mui.openWindow({
45
			url: '../html/changepass.html',
46
			id: '../html/changepass.html',
47
			show: {
48
				aniShow: "slide-in-right"
49
			}
50
		});
51
	})
52

53
	function ifPhoneAmdEmail() {
54

55
		/*判断是否绑定了手机号*/
56
		if(phoneCookie) {
57
			/*phoneName.innerText = (phoneCookie.substring(0, 3) + "****" + phoneCookie.substring(7, 11));*/
58
			phoneName.innerText = phoneCookie;
59

60
		} else {
61

62
			phoneName.innerText = "请绑定手机号";
63

73 64
		}
74 65

75
		function isAuthentication() {
76
			var userId = plus.storage.getItem('userid');
77
			mui.ajax(baseUrl + "/ajax/professor/editBaseInfo/" + userId, {
78
				dataType: 'json', //数据格式类型
79
				type: 'GET', //http请求类型
80
				timeout: 10000, //超时设置
81
				async: false,
82
				success: function(data) {
83
					var $info = data.data || {}
84
					if(data.success && data.data) {
85
						if($info.authentication){
86
							verified.innerText="已认证";
87
						}else{
88
							verified.innerText="为认证";
89
						}
90
					}
91
				},
92
				error: function() {
93
					plus.nativeUI.toast("服务器链接超时", toastStyle);
94
					return;
95
				}
96
			});
66
		/*判断是否绑定了邮箱*/
67
		if(emailCookie != "" && emailCookie != null && emailCookie != "null") {
68
			emailName.innerText = emailCookie;
69

70
		} else {
71
			emailName.innerText = "请绑定邮箱";
72

97 73
		}
98
        
99
        function lookup() {
100
			var userId = plus.storage.getItem('userid');
101
			mui.ajax(baseUrl + "/ajax/qaUser" , {
102
				data:{
103
					id:userId
104
				},
105
				dataType: 'json', //数据格式类型
106
				type: 'GET', //http请求类型
107
				timeout: 10000, //超时设置
108
				async: false,
109
				success: function(data) {
110
					var $info = data.data || {}
111
					if(data.success && $info) {
112
						emailCookie = $info.email;
113
						phoneCookie = $info.mobilePhone;
114
                        ifPhoneAmdEmail(phoneCookie,emailCookie)					
74
	}
75

76
	function isAuthentication() {
77
		var userId = plus.storage.getItem('userid');
78
		mui.ajax(baseUrl + "/ajax/professor/editBaseInfo/" + userId, {
79
			dataType: 'json', //数据格式类型
80
			type: 'GET', //http请求类型
81
			timeout: 10000, //超时设置
82
			async: false,
83
			success: function(data) {
84
				var $info = data.data || {}
85
				if(data.success && data.data) {
86
					if($info.authentication) {
87
						verified.innerText = "已认证";
88
					} else {
89
						verified.innerText = "未认证";
115 90
					}
116
				},
117
				error: function() {
118
					plus.nativeUI.toast("服务器链接超时", toastStyle);
119
					return;
120 91
				}
121
			});
122
		}
92
			},
93
			error: function() {
94
				plus.nativeUI.toast("服务器链接超时", toastStyle);
95
				return;
96
			}
97
		});
98
	}
123 99

124
	})
100
	function lookup() {
101
		var userId = plus.storage.getItem('userid');
102
		mui.ajax(baseUrl + "/ajax/qaUser", {
103
			data: {
104
				id: userId
105
			},
106
			dataType: 'json', //数据格式类型
107
			type: 'GET', //http请求类型
108
			timeout: 10000, //超时设置
109
			async: true,
110
			success: function(data) {
111
				plus.webview.currentWebview().show("slide-in-right", 150);
112
				plus.nativeUI.closeWaiting();
113
				var $info = data.data || {}
114
				if(data.success && $info) {
115
					emailCookie = $info.email;
116
					phoneCookie = $info.mobilePhone;
117
					ifPhoneAmdEmail();
118
				}
119
			},
120
			error: function() {
121
				plus.nativeUI.toast("服务器链接超时", toastStyle);
122
				return;
123
			}
124
		});
125
	}
125 126

126
});
127
})

+ 2 - 7
app/js/setup.js

@ -6,13 +6,8 @@ mui.ready(function() {
6 6
	var security = document.getElementById("security");
7 7
	
8 8
	security.addEventListener('tap',function(){
9
		mui.openWindow({
10
			url: '../html/security.html',
11
			id: '../html/security.html',
12
			show: {
13
				aniShow: "slide-in-right"
14
			}
15
		});
9
		plus.nativeUI.showWaiting();//显示原生等待框
10
        webviewShow = plus.webview.create("../html/security.html","../html/security.html");
16 11
	});
17 12

18 13
	/*退出按钮*/