Browse Source

公共文件修改完善

luyanan 7 years ago
parent
commit
362e71cd1e
3 changed files with 12 additions and 116 deletions
  1. 2 2
      css/common.css
  2. 4 4
      js/common.js
  3. 6 110
      js/searchNew.js

+ 2 - 2
css/common.css

@ -153,8 +153,8 @@ input{ outline:none;}
153 153
/***********************缺省页面*******************/
154 154
.nodatatip{width:40%;margin:100px auto;overflow:hidden;height:100px; font-size:16px; text-align:center;color:#aaa;}
155 155
.nodatabox{/*width:100%;*/height: 100%;padding:40px; margin:20px auto;text-align: center;}
156
.nodatabox .nodata{overflow:hidden; width:50%; margin:auto;}
157
.nodatabox .picbox{margin:30px auto 8px;display:inline-block;width:140px;height:140px;background-position: center;background-repeat: no-repeat;background-size:cover;}
156
.nodatabox .nodata{overflow:hidden; width:50%; margin:20px auto;}
157
.nodatabox .picbox{margin:8px auto;display:inline-block;width:140px;height:140px;background-position: center;background-repeat: no-repeat;background-size:cover;}
158 158
.nodatabox .picbox.picNull{background-image:url(../images/points_icon_ku_nor.png);}
159 159
.nodatabox .txtbox { margin:6px auto;}
160 160
.nodatabox .noContip{font-size:18px;color: #999;line-height:40px;}

+ 4 - 4
js/common.js

@ -582,7 +582,7 @@ function ifcollectionAbout(watchObject, num) {
582 582
		async: false,
583 583
		success: function(data) {
584 584
			if(data.success && data.data != null) {
585
				if(num == "1") { //已关注专家
585
				if(num == "1" || num == "6") { //已关注专家
586 586
					$("#attentBtn").addClass("attenedSpan");
587 587
					$("#attentBtn").text("已关注");
588 588
				} else { //已收藏资源或文章
@ -590,7 +590,7 @@ function ifcollectionAbout(watchObject, num) {
590 590
					$("#collectBtn").addClass("icon-collected");
591 591
				}
592 592
			} else {
593
				if(num == "1") { //关注专家
593
				if(num == "1" || num == "6") { //关注专家
594 594
					$("#attentBtn").removeClass("attenedSpan");
595 595
					$("#attentBtn").text("关注");
596 596
				} else { //收藏资源或文章
@ -618,7 +618,7 @@ function collectionAbout(watchObject, num) {
618 618
		async: false,
619 619
		success: function(data) {
620 620
			if(data.success) {
621
				if(num == "1") { //关注专家
621
				if(num == "1" || num == "6") { //关注专家
622 622
					$("#attentBtn").addClass("attenedSpan");
623 623
					$("#attentBtn").text("已关注");
624 624
				} else { //收藏资源或文章
@ -647,7 +647,7 @@ function cancelCollectionAbout(watchObject, num) {
647 647
		success: function(data) {
648 648
			console.log(data.success)
649 649
			if(data.success) {
650
				if(num == "1") { //关注专家
650
				if(num == "1" || num == "6") { //关注专家
651 651
					$("#attentBtn").removeClass("attenedSpan");
652 652
					$("#attentBtn").text("关注");
653 653
				} else { //收藏资源或文章

+ 6 - 110
js/searchNew.js

@ -50,7 +50,7 @@ $(function() {
50 50
		$(".searchsome").val(searchContent);
51 51
	}
52 52
	expertListVal(keyt,subject,industry,address,authType,20,1,true);
53
	companyListVal(keyt,subject,industry,address,authType,20,1,true);
53
	companyListVal(20,1,true);
54 54
	articalListVal(20, 1,true);
55 55
	resourceListVal(20, 1,true);
56 56
	patentListVal(20, 1,true);
@ -409,112 +409,8 @@ function expertListVal(keyt,subject,industry,address,authType,pageSize,pageNo,is
409 409
	});
410 410
}
411 411
//企业
412
function companyListVal(keyt,subject,industry,address,authType,pageSize,pageNo,isexpert) {
413
	$.ajax({
414
		"url": "/ajax/professor/pqBaseInfo",
415
		"type": "get",
416
		"data": {
417
			"key":keyt,
418
			"subject":subject,
419
			"industry":industry,
420
			"address":address,
421
			"authType":authType,
422
			"pageSize": pageSize,
423
			"pageNo": pageNo
424
		},
425
		"beforeSend": function() {
426
			$("#expertList").append('<img src="../images/loading.gif" class="loading"  style="position: absolute;left: 50%; top: 50%;" />');
427
		},
428
		"success": function(data) {
429
			console.log(data);
430
			if(data.success) {
431
				if(data.data.data.length > 0){
432
					$("#expertList,.expertPageCode").show();
433
					$(".expertPage").hide();
434
					$("#expertList").html("");
435
					var itemlist = '';
436
					for(var i = 0; i < data.data.data.length; i++) {
437
						var itemlist = '<li class="flexCenter">';
438
						itemlist += '<a href="" class="expertUrl linkhref"><div class="lefthead userheadt userRadius" id="expertImg"></div>';
439
						itemlist += '<div class="centercon">';
440
						itemlist += '<p class="h1font">';
441
						itemlist += '<span class="nameSpan" id="Name"></span>';
442
						itemlist += '<em class="authiconNew" title="科袖认证专家"></em></p>';
443
						itemlist += '<p class="h2font ellipsisSty" id="ellipsisSty">职称/职位,所在机构</p>';
444
						itemlist += '<p class="h2font ellipsisSty" id="researchAreas"></p>';
445
						itemlist += '</div></a><span class="rightop" style="display:none"  id="">咨询</span>';
446
						itemlist += '</li>';
447
						$itemlist = $(itemlist);
448
						$("#expertList").append($itemlist);
449
						var datalist = data.data.data[i];
450
						$itemlist.find(".expertUrl").attr("href", "userInforShow.html?professorId=" + datalist.id );
451
						$itemlist.find("#Name").text(datalist.name);
452
						$itemlist.find(".rightop").attr("id",datalist.id);
453
						if(datalist.id != userid){
454
							$itemlist.find(".rightop").show();
455
						}
456
						var userType = autho(datalist.authType, datalist.orgAuth, datalist.authStatus);
457
						$itemlist.find(".authiconNew").attr("title", userType.title);
458
						$itemlist.find(".authiconNew").addClass(userType.sty);
459
						if(datalist.hasHeadImage) {
460
							$itemlist.find("#expertImg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
461
						}
462
						var title = datalist.title || "";
463
						var orgName = datalist.orgName || "";
464
						var office = datalist.office || "";
465
						if(title != "") {
466
							var ttitle = title + ",";
467
						}else{
468
							if(office!=""){
469
								var ttitle = office  + ",";	
470
							}else{
471
								var ttitle = office;	
472
							}
473
						}
474
						if(orgName != "") {
475
							orgName = orgName;
476
						}
477
						$itemlist.find("#ellipsisSty").text(ttitle+orgName);
478
						
479
						/*获取研究方向信息*/
480
						var researchAreas = datalist.researchAreas;
481
						if( researchAreas.length > 0){
482
							var rlist = '研究方向:';
483
							for(var n = 0; n < researchAreas.length; n++) {
484
								//console.log(researchAreas[n].caption);
485
								rlist += researchAreas[n].caption
486
								if(n < researchAreas.length - 1) {
487
									rlist += ";"
488
								}
489
							}
490
							$itemlist.find("#researchAreas").text(rlist);
491
						}
492
					}
493
					//分页
494
					if(isexpert==true){
495
						$(".expertPageCode").createPage({
496
							pageCount: Math.ceil(data.data.total / 20),
497
							current: data.data.pageNo,
498
							backFn: function(p) {
499
								$("#expertList").html("");
500
								expertListVal(keyt,subject,industry,address,authType,20,p,false);
501
								document.body.scrollTop = document.documentElement.scrollTop = 0;
502
							}
503
						});
504
					}
505
					
506
				}else{
507
					$("#expertList,.expertPageCode").hide();
508
					$(".expertPage").show();
509
				}
510
				$(".loading").remove();
511
			}
512
513
		},
514
		"error": function() {
515
			$.MsgBox.Alert('提示', '链接服务器超时')
516
		}
517
	});
412
function companyListVal(pageSize,pageNo,isexpert) {
413
	
518 414
}
519 415
//文章
520 416
function articalListVal(pageSize, pageNo,isbind) {
@ -700,10 +596,10 @@ function patentListVal(pageSize, pageNo,isbind) {
700 596
					$("#patentList").html("");
701 597
					for(var i = 0; i < dataStr.length; i++) {
702 598
						var itemlist = '<li class="flexCenter">';
703
						itemlist += '<a href="paperShow.html?paperId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead articalhead"></div>';
599
						itemlist += '<a href="patentShow.html?patentId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead articalhead"></div>';
704 600
						itemlist += '<div class="centercon centercon2">';
705 601
						itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
706
						itemlist += '<p class="h1font ellipsisSty">发明人:'+ dataStr[i].authors +'</p>';
602
						itemlist += '<p class="h1font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
707 603
						itemlist += '<p class="h2font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
708 604
						itemlist += '</div></a></li>';
709 605
						$itemlist = $(itemlist);
@ -775,7 +671,7 @@ function paperListVal(pageSize, pageNo,isbind) {
775 671
						itemlist += '<a href="paperShow.html?paperId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead articalhead"></div>';
776 672
						itemlist += '<div class="centercon centercon2">';
777 673
						itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
778
						itemlist += '<p class="h1font ellipsisSty">作者:'+ dataStr[i].authors +'</p>';
674
						itemlist += '<p class="h1font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
779 675
						itemlist += '<p class="h2font ellipsisSty">期刊:'+ moreInf +'</p>';
780 676
						itemlist += '</div></a></li>';
781 677
						$itemlist = $(itemlist);