Parcourir la Source

登录,个人完善页面改版

xuchunyang 8 ans auparavant
Parent
commit
f9d773d1f7
5 fichiers modifiés avec 39 ajouts et 14 suppressions
  1. 20 6
      app/html/fillinfo.html
  2. 16 5
      app/js/fillinfo.js
  3. 1 1
      app/js/login.js
  4. 1 1
      app/js/loginTelNew.js
  5. 1 1
      app/js/myaccount.js

+ 20 - 6
app/html/fillinfo.html

@ -79,13 +79,27 @@
79 79
			})
80 80
			
81 81
			document.getElementById("fillinfoNext").addEventListener('tap', function() {
82
				var userId = plus.storage.getItem('userid');
83
				mui.ajax(baseUrl + '/ajax/professor/authen', {
84
					data:{"id":userId,"authentication":applyType},
85
					dataType: 'json', //数据格式类型
86
					type: 'POST', //http请求类型
87
					timeout: 10000, //超时设置
88
					success: function(data) {
89
						console.log(JSON.stringify(data));
90
						if(data.success) {
91
							mui.openWindow({
92
								url: '../html/fillinfo-select.html',
93
								id: 'fillinfo-select.html',
94
								show: {autoShow: false}
95
							});
96
						}
97
					},
98
					error: function(data) {
99
						plus.nativeUI.toast("服务器链接超时", toastStyle);
100
					}
101
				})
82 102
				
83
				mui.openWindow({
84
					url: '../html/fillinfo-select.html',
85
					id: 'fillinfo-select.html',
86
					show: {autoShow: false},
87
					extras: {num: applyType}
88
				});
89 103
			});
90 104
		</script>
91 105
	</body>

+ 16 - 5
app/js/fillinfo.js

@ -8,9 +8,25 @@ mui.ready(function() {
8 8
		var goIndex = document.getElementById("goIndex");
9 9
		var dataProvince = document.getElementById("data-province");
10 10
		var dataAddress = document.getElementById("data-address");
11
		var userTitle = document.getElementById("userTitle");
12
		var userPosition = document.getElementById("userPosition");
11 13
		var applyType;
12 14
		var userId = plus.storage.getItem('userid');
13 15

16
		/*校验input字数*/
17
		mui('.noactiveTab').on('keyup', "#userTitle,#userDepartment,#userPosition", function() {
18
			if(this.value.length > 20){
19
				plus.nativeUI.toast("最多输入20个字", toastStyle);
20
			}
21
		});
22
		
23
		/*校验input字数*/
24
		mui('.noactiveTab').on('keyup', "#userMechanism", function() {
25
			if(this.value.length > 50){
26
				plus.nativeUI.toast("最多输入50个字", toastStyle);
27
			}
28
		});
29

14 30
		/*选择地址*/
15 31
		var cityPicker = new mui.PopPicker({
16 32
			layer: 2
@ -36,8 +52,6 @@ mui.ready(function() {
36 52
		
37 53
		/*查询用户名*/
38 54
		function showusername() {
39
			
40
			alert(userId)
41 55
			mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + userId, {
42 56
				dataType: 'json', //数据格式类型
43 57
				type: 'get', //http请求类型
@ -73,8 +87,6 @@ mui.ready(function() {
73 87

74 88
		/*提交个人信息*/
75 89
		goIndex.addEventListener('tap', function() {
76
			var userTitle = document.getElementById("userTitle");
77
			var userPosition = document.getElementById("userPosition");
78 90
			goVal();
79 91
		});
80 92

@ -88,7 +100,6 @@ mui.ready(function() {
88 100
			$data.province = dataProvince.value;
89 101
			$data.address = dataAddress.value;
90 102
			$data.id = plus.storage.getItem('userid');;
91
			$data.authentication = self.num;
92 103
			console.log(JSON.stringify($data))
93 104
			mui.ajax(baseUrl + '/ajax/professor/updatePro', {
94 105
				data: $data,

+ 1 - 1
app/js/login.js

@ -145,7 +145,7 @@ mui.ready(function() {
145 145
				success: function(data) {
146 146
					console.log(JSON.stringify(data))
147 147
					if(data.success) {
148
						if(data.data.authentication < 0){
148
						if(data.data.authentication == undefined || data.data.authentication == null){
149 149
							var productView = mui.preload({
150 150
								url: '../html/fillinfo.html',
151 151
								id: '../html/fillinfo.html',

+ 1 - 1
app/js/loginTelNew.js

@ -171,7 +171,7 @@ mui.ready(function() {
171 171
				timeout: 10000, //超时设置
172 172
				success: function(data) {
173 173
					if(data.success) {
174
						if(data.data.authentication < 0){
174
						if(data.data.authentication == undefined || data.data.authentication == null){
175 175
							var productView = mui.preload({
176 176
								url: '../html/fillinfo.html',
177 177
								id: '../html/fillinfo.html',

+ 1 - 1
app/js/myaccount.js

@ -306,7 +306,7 @@ mui.ready(function() {
306 306
						professorName = $info.name;
307 307
						scorePercent = $info.scorePercent;
308 308
						document.getElementById("userName").innerText = $info.name;
309
						document.getElementById("orgName").innerText = $info.orgName;
309
						document.getElementById("orgName").innerText = $info.orgName || "";
310 310
						if($info.hasHeadImage == 1) {
311 311
							var mun = Math.round(Math.random() * 99 + 1);
312 312
							userImg.setAttribute("src", baseUrl + "/images/head/" + $info.id + "_l.jpg?" + mun);