Browse Source

检查专家浏览页面的bug并修改,资源详情信息左右上下居中

jack 8 years ago
parent
commit
b5b6d96367
2 changed files with 42 additions and 81 deletions
  1. 40 79
      src/main/webapp/js/information.brow.js
  2. 2 2
      src/main/webapp/js/popup.js

+ 40 - 79
src/main/webapp/js/information.brow.js

@ -40,56 +40,26 @@ loginStatus();//读取用户头像
40 40
						};
41 41
					}	
42 42
				}			
43
			}
44
45
			// var eduBgShow = function (data){
46
47
			// 	if(data != undefined && data.length != 0  ){
48
49
			// 		var subs = new Array();
50
			// 		if(data.indexOf(',')){
51
			// 			subs = data.split(',');
52
			// 		}else{
53
			// 			subs[0] = data;
54
			// 		}
55
56
			// 		if(subs.length>0){
57
			// 			for (var i = 0; i < subs.length; i++) {
58
			// 				$("#industryList").append("<div class='acad'>"+ subs[i] +"<span class='remove'><img src='images/move.png'></span></div>");
59
			// 				$("#industryShow").append("<li>"+subs[i]+"</li>");		
60
								
61
			// 			};
62
			// 		}	
63
			// 	}			
64
			// }
65
43
			}			
66 44
			var eduBgShow = function(data) {
67 45
68 46
				if(data.length>0){
69 47
					for (var i = 0; i < data.length; i++) {						
70 48
						var showHtml = '<li><div class="h4Font h4tit">';
71
						if(typeof(data[i].school) !== "undefined"){
72
							showHtml += data[i].school;
73
						}else{
74
							showHtml += "";
75
						}
76
						if(typeof(data[i].college) !== "undefined"){
77
							
78
							showHtml += " - "+ data[i].college;
79
						}else{
80
							showHtml += "";
81
						}
82
						if(typeof(data[i].major) !== "undefined"){
83
							
84
							showHtml +=  " - "+ data[i].major;
85
						}else{
86
							showHtml += "";
87
						}
88
						if(typeof(data[i].degree) !== "undefined"){
89
							
90
							showHtml +=" - "+ data[i].degree;
91
						}else{
92
							showHtml += "";
49
						if(data[i].college&&data[i].major&&data[i].degree){
50
							showHtml+=data[i].school+'-'+data[i].college+'-'+data[i].major+'-'+data[i].degree
51
						}else if(!data[i].college&&data[i].major&&data[i].degree){
52
							showHtml+=data[i].school+'-'+data[i].major+'-'+data[i].degree
53
						}else if(data[i].college&&!data[i].major&&data[i].degree){
54
							showHtml+=data[i].school+'-'+data[i].college+'-'+data[i].degree
55
						}else if(data[i].college&&data[i].major&&!data[i].degree){
56
							showHtml+=data[i].school+'-'+data[i].college+'-'+data[i].major
57
						}else if(!data[i].college&&!data[i].major&&data[i].degree){
58
							showHtml+=data[i].school+'-'+data[i].degree
59
						}else if(!data[i].college&&data[i].major&&!data[i].degree){
60
							showHtml+=data[i].school+'-'+data[i].major
61
						}else if(data[i].college&&!data[i].major&&!data[i].degree){
62
							showHtml+=data[i].school+'-'+data[i].college
93 63
						}
94 64
						if(typeof(data[i].year) !== "undefined"){
95 65
							
@ -98,9 +68,7 @@ loginStatus();//读取用户头像
98 68
							showHtml += "";
99 69
						}
100 70
						showHtml += "</div></li>";
101
						 $("#eduBgShow").append(showHtml);
102
						// $("#eduBgShow").append("<li>"+data[i].school+"-"+data[i].college+"-"+data[i].major+"-"+data[i].degree+"-"+data[i].year+"</li>");
103
						
71
						 $("#eduBgShow").append(showHtml);											
104 72
					}
105 73
				}
106 74
			}
@ -114,7 +82,7 @@ loginStatus();//读取用户头像
114 82
							var dep="-"+data[i].department;					
115 83
						}else{
116 84
							var dep=""
117
						}
85
						}						
118 86
						if(data[i].startMonth){								
119 87
							sDate =data[i].startMonth.substr(0,4)+"-"+data[i].startMonth.substr(4,6)+"-";
120 88
							if(data[i].stopMonth){
@ -122,7 +90,7 @@ loginStatus();//读取用户头像
122 90
							}else {
123 91
								eDate = "至今";
124 92
							}
125
						}
93
						}						
126 94
						var JobHtml='<li>';
127 95
						JobHtml +='<div class="h4Font h4tit">'+ data[i].company+'-'+data[i].title +''+dep +'<small class="h6Font">'+ sDate +''+ eDate +'</small></div>';
128 96
						JobHtml +='</li>';
@ -148,7 +116,7 @@ loginStatus();//读取用户头像
148 116
							}else {
149 117
								data[i].stopMonth=data[i].stopMonth.substr(0,4)+"-"+data[i].stopMonth.substr(4,6)
150 118
							}
151
						}	
119
						}						
152 120
						var projectHtml='<li class="paddingSpace">';
153 121
						projectHtml +='<div class="h4Font h4tit">'+ data[i].name +'<small class="h6Font">'+ data[i].startMonth +''+ data[i].stopMonth +'</small></div>';
154 122
						projectHtml +='<div class="h5Font pIndent">'+ data[i].descp +'</div>';
@ -333,6 +301,7 @@ loginStatus();//读取用户头像
333 301
334 302
	    	$.get("/ajax/professor/info/" + professorId, function($data) {
335 303
	    			if ($data.success) {
304
	    				console.log($data);
336 305
	    				var $info = $data.data;
337 306
						if ($info) {
338 307
							
@ -373,42 +342,42 @@ loginStatus();//读取用户头像
373 342
							}
374 343
							$("#nameS").text($info.name);
375 344
							if($info.office) {
376
								$("#office").text($info.office+",");
345
								if($info.title) {									
346
									$("#office").text($info.office+",");
347
								}else{
348
									$("#office").text($info.office);
349
								}
350
								
377 351
							}
378 352
							if($info.title) {
379 353
								$("#titleS").text($info.title);	
380 354
							}
381 355
							if($info.department) {
382
								$("#industryS").text($info.department+",");
356
								if($info.orgName){
357
									$("#industryS").text($info.department+",");
358
								}else{
359
									$("#industryS").text($info.department);
360
								}								
383 361
							}
384 362
							if($info.orgName) {
385 363
								$("#orgNameS").text($info.orgName);
386 364
							}
387 365
							if($info.address) {
388 366
								$("#address").text($info.address);
389
							}																			
390
							$("#headImage").attr("src","/images/head/"+professorId+"_l.jpg");
391
								$("#headImage").load(function(){									
392
								})
393
								.error(function(){
394
									$("#headImage").attr("src","/images/default-photo.jpg");
395
								});
367
							}	
368
							if($info.hasHeadImage) {
369
								$("#headImage").attr("src","/images/head/"+professorId+"_l.jpg");
370
							}else{
371
								$("#headImage").attr("src","/images/default-photo.jpg");
372
							}															
396 373
							$("#orgImage").attr("src","/images/org/"+$info.orgId+".jpg");
397 374
								$("#orgImage").load(function(){									
398 375
								})
399 376
								.error(function(){
400 377
									$("#orgImage").attr("src","/images/default-icon.jpg");
401
								});
402
							$("#descpS").text($info.descp);
378
								});							
403 379
							//显示专家信息到保存数据
404
							name=$info.name;
405
							$("#name").val($info.name);
406
							$("#title").val($info.title);
407
							$("#orgId").val($info.orgId);
408
							//$("#organ").attr("href","organization-brow.html?orgId="+$info.orgId+"");
409
							//console.log($info.orgId);
410
							$("#orgName").val($info.orgName);
411
							$("#department").val($info.department);														
380
							name=$info.name;																				
412 381
							if($info.descp==undefined&&$info.subject==undefined&&$info.researchAreas.length ==0&&$info.industry==undefined&&$info.edus.length ==0&&$info.jobs.length ==0&&$info.projects.length==0&&$info.papers.length ==0&&$info.patents.length ==0&&$info.honors.length ==0){								
413 382
								$("div:contains('专家信息')").parents(".menublock").hide();
414 383
							}
@ -417,8 +386,7 @@ loginStatus();//读取用户头像
417 386
							}else{
418 387
								$("span:contains('个人简介')").parents(".introduction").hide();
419 388
								$("a:contains('个人简介')").hide();
420
							}
421
							
389
							}							
422 390
							//展示专家的学科							
423 391
							if($info.subject){
424 392
								if($info.authentication == 1){
@ -562,13 +530,6 @@ loginStatus();//读取用户头像
562 530
563 531
564 532
565
//进入自己的页面,上传图像部分
566
$(".head-left").hover(function(){
567
	$(".replace-photo").animate({"bottom":"0px"});						   						   
568
	},function(){
569
	$(".replace-photo").animate({"bottom":"-50px"});	
570
		
571
		})
572 533
//专家信息点击换背景颜色
573 534
$(".subsidebar").click(function(){
574 535
	$(".subsidebar").removeClass("subcolor");

+ 2 - 2
src/main/webapp/js/popup.js

@ -295,9 +295,9 @@ function ResourceMessage() {
295 295
    var _widht = $(".blackcover").width();
296 296
    var _height = $(".blackcover").height();
297 297
	var boxWidth = $(".resouinfo").width();
298
	var boxHeight = $(".resouinfo").height();
298
	var boxHeight = $(".resouinfo").height();	
299 299
	//让提示框居中
300
	$(".resouinfo").css({ top:"40px", left: (_widht - boxWidth) / 2 + "px" });
300
	$(".resouinfo").css({ top:(_height-boxHeight)/2+"px", left: (_widht - boxWidth) / 2 + "px" });
301 301
	//关闭按钮
302 302
	$(".workclose").click(function(){
303 303
		$(".blackcover").remove();