Quellcode durchsuchen

文章企业添加关注

luyanan vor 7 Jahren
Ursprung
Commit
a3de1e5b79
9 geänderte Dateien mit 185 neuen und 498 gelöschten Zeilen
  1. 6 3
      articalShow.html
  2. 2 0
      css/genindex.css
  3. 35 35
      js/articalPreview.js
  4. 74 162
      js/articalShow.js
  5. 24 105
      js/cmpInforShow.js
  6. 28 26
      js/common.js
  7. 7 83
      js/paperShow.js
  8. 6 81
      js/patentShow.js
  9. 3 3
      js/userInforShow.js

+ 6 - 3
articalShow.html

@ -52,7 +52,7 @@
52 52
						</div>
53 53
						<div class="form-item otherShow displayNone">
54 54
							<div class="aboutTit">相关企业</div>
55
							<div class="form-result">
55
							<div class="form-result aboutRes">
56 56
								<ul id="busList">
57 57
									
58 58
								</ul>
@ -145,7 +145,7 @@
145 145
						<span class="attenSpan"></span>
146 146
					</div>
147 147
				</div>
148
				<div class="conItem conItemG displayNone" id="enterprise" style="border:none;padding:30px;">
148
				<div class="conItem conItemG alignCenter displayNone" id="enterprise" style="border:none;padding:30px;">
149 149
					<a href=""  class="qiyego">
150 150
						<div class="madiaHead cmpHead" id="Qimg">
151 151
							<div class="boxBlock" style="width:98px;height:98px">
@ -153,7 +153,7 @@
153 153
							</div>
154 154
						</div>
155 155
					</a>
156
					<div class="proInfo alignCenter">
156
					<div class="proInfo">
157 157
						<div class="h3Font clearfix">
158 158
							<a href=""  class="h1Font qiyego" id="Qname"></a>
159 159
							<span class="authiconNew" title="科袖认证企业" id="QauthFlag"></span>
@ -161,6 +161,9 @@
161 161
						<p class="h2Font ellipsisSty" id="Qindustry"></p>
162 162
						<p class="h2Font" id="QorgType"></p>
163 163
					</div>
164
					<div class="goSpan">
165
						<span class="attenSpan"></span>
166
					</div>
164 167
				</div>
165 168
			</div>
166 169
			

+ 2 - 0
css/genindex.css

@ -291,6 +291,8 @@ ul.artAbout .frmadd{width:auto;position:absolute;right:0;top:0;background: #ff99
291 291
.form-item .frmaddG{display:none;width: auto;position: absolute;right: 0;top: 0;background:#ff9900;color: #fff;border: none;padding: 6px 25px;z-index: 6;}
292 292
.form-item .madiaHead{position:absolute;border:1px solid #E5E5E5;width: 50px;height:50px;top:50%;margin-top:-25px;background-position: center;background-size: cover;}
293 293
.form-item .madiaHead.useHead{background-image: url(../images/default-photo.jpg);border-radius: 50%;}
294
.form-item .madiaHead.cmpHead{background:#FFFFFF;border-radius:0;}
295
.form-item .madiaHead.cmpHead .boxBlock{width:118px;height:80px;}
294 296
.form-item .madiaHead.resouseHead{background-image: url(../images/default-resource.jpg);border-radius:0;}
295 297
.form-item .madiaHead.paperHead{background-image: url(../images/default-paper.jpg);border-radius:0;}
296 298
.form-item .madiaHead.patentHead{background-image: url(../images/default-patent.jpg);border-radius:0;}

+ 35 - 35
js/articalPreview.js

@ -324,42 +324,42 @@ $(function() {
324 324
		})
325 325
	}
326 326
	function busfil($data) {
327
	var itemlist = '<li class="proinfor flexCenter">';
328
	itemlist += '<a target="_blank" href="" class="flexCenter urlgo">';
329
	itemlist += '<div class="headblock floatL ResImgBox" style="padding:0px;"><img class="boxBlockimg" src="" id="companyImg"></div>';
330
	itemlist += '<div style="margin-left:10px;line-height:25px;color:#333;">';
331
	itemlist += '<p class="h1font"><span id="orgName"></span><em class="authiconNew"></em></p>';
332
	itemlist += '<p class="h2font ellipsisSty"><span id="orgTit"></span> <span id="orgOther"></span></p>';
333
	itemlist += '</div></a></li>';
334
	$itemlist = $(itemlist);
335
	this.append($itemlist);
336
	var datalist = $data;
337
	var companyType = datalist.authStatus;
338
	if(datalist.forShort) {
339
		$itemlist.find("#orgName").text(datalist.forShort);
340
	} else {
341
		$itemlist.find("#orgName").text(datalist.name);
342
	}
343
	$itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId=" + datalist.id);
344
	if(datalist.hasOrgLogo) {
345
		$itemlist.find("#companyImg").attr("src", "/images/org/" + datalist.id + ".jpg");
346
	} else {
347
		$itemlist.find("#companyImg").attr("src", "/images/default-icon.jpg");
348
	}
349
	if(companyType == 3) {
350
		$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;
351
	}
352
	var orgOther = "";
353
	if(datalist.industry) {
354
		orgOther = datalist.industry.replace(/,/gi, " | ");
355
	}
356
	$itemlist.find("#orgOther").text(orgOther);
357

358
	if(datalist.orgType == "2") {
359
		$("#orgTit").html(orgTypeShow[datalist.orgType] + "<span style='margin-right:10px;'></span>");
327
		var itemlist = '<li><a href="" target="_blank" class="flexCenter urlgo">';
328
		itemlist += '<div class="madiaHead cmpHead">';
329
		itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="" id="companyImg"></div></div>';
330
		itemlist += '<div class="madiaInfo">';
331
		itemlist += '<p class="h1Font"><span id="orgName"></span><em class="authiconNew"></em></p>';
332
		itemlist += '<p class="h2Font ellipsisSty"><span id="orgTit"></span> <span id="orgOther"></span></p>';
333
		itemlist += '</div></a></li>';
334
		$itemlist = $(itemlist);
335
		this.append($itemlist);
336
		var datalist = $data;
337
		var companyType = datalist.authStatus;
338
		if(datalist.forShort) {
339
			$itemlist.find("#orgName").text(datalist.forShort);
340
		} else {
341
			$itemlist.find("#orgName").text(datalist.name);
342
		}
343
		$itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId=" + datalist.id);
344
		if(datalist.hasOrgLogo) {
345
			$itemlist.find("#companyImg").attr("src", "/images/org/" + datalist.id + ".jpg");
346
		} else {
347
			$itemlist.find("#companyImg").attr("src", "/images/default-icon.jpg");
348
		}
349
		if(companyType == 3) {
350
			$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;
351
		}
352
		var orgOther = "";
353
		if(datalist.industry) {
354
			orgOther = datalist.industry.replace(/,/gi, " | ");
355
		}
356
		$itemlist.find("#orgOther").text(orgOther);
357
	
358
		if(datalist.orgType == "2") {
359
			$("#orgTit").html(orgTypeShow[datalist.orgType] + "<span style='margin-right:10px;'></span>");
360
		}
361
	
360 362
	}
361

362
}
363 363
});
364 364

365 365


+ 74 - 162
js/articalShow.js

@ -36,7 +36,7 @@ $(function() {
36 36
					}else{
37 37
						$(".thumbBtn").html("赞 <span>"+data.data.articleAgree+"</span>");
38 38
					}
39
					ifCollection(articleId,2);//文章收藏
39
					ifcollectionAbout(articleId,$("#attention").find("em"), 3)
40 40
					if(data.data.articleType==1){
41 41
						$("#expert").removeClass("displayNone");
42 42
						relevantarticalList(data.data.professorId,1);
@ -91,8 +91,8 @@ $(function() {
91 91
					$("#ZauthFlag,.labels").attr("title", userType.title);
92 92
					$("#ZauthFlag,.labels").addClass(userType.sty);
93 93
					if(data.data.id!=userid){
94
						$(".goSpan").removeClass("displayNone");
95
						ifCollection(data.data.id,1)//判断是否关注专家
94
						$("#expert").find(".goSpan").removeClass("displayNone");
95
						ifcollectionAbout(data.data.id,$("#expert").find(".attenSpan"), 1)
96 96
					}
97 97
					
98 98
				}
@ -117,6 +117,7 @@ $(function() {
117 117
					}else{
118 118
						$("#Qname,.username").text(data.data.name);
119 119
					}
120
					$("#Qname").attr("dataid",data.data.id);
120 121
					$(".qiyego,.useurl").attr("href", "cmpInforShow.html?orgId="+data.data.id);
121 122
					if(data.data.hasOrgLogo) {
122 123
						$(".userimg").attr("style","background: #fff;")
@ -130,6 +131,9 @@ $(function() {
130 131
					}
131 132
					$("#Qindustry").text(QindustryShow(data.data.industry));
132 133
					$("#QorgType").text(orgTypeShow[data.data.orgType])
134
					if(userid){
135
						ifcollectionAbout(data.data.id,$("#enterprise").find(".attenSpan"), 6)
136
					}
133 137
				}
134 138
			},
135 139
			"error": function() {
@ -364,42 +368,42 @@ $(function() {
364 368
		})
365 369
	}
366 370
	function busfil($data) {
367
	var itemlist = '<li class="proinfor flexCenter">';
368
	itemlist += '<a target="_blank" href="" class="flexCenter urlgo">';
369
	itemlist += '<div class="headblock floatL ResImgBox" style="padding:0px;"><img class="boxBlockimg" src="" id="companyImg"></div>';
370
	itemlist += '<div style="margin-left:10px;line-height:25px;color:#333;">';
371
	itemlist += '<p class="h1font"><span id="orgName"></span><em class="authiconNew"></em></p>';
372
	itemlist += '<p class="h2font ellipsisSty"><span id="orgTit"></span> <span id="orgOther"></span></p>';
373
	itemlist += '</div></a></li>';
374
	$itemlist = $(itemlist);
375
	this.append($itemlist);
376
	var datalist = $data;
377
	var companyType = datalist.authStatus;
378
	if(datalist.forShort) {
379
		$itemlist.find("#orgName").text(datalist.forShort);
380
	} else {
381
		$itemlist.find("#orgName").text(datalist.name);
382
	}
383
	$itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId=" + datalist.id);
384
	if(datalist.hasOrgLogo) {
385
		$itemlist.find("#companyImg").attr("src", "/images/org/" + datalist.id + ".jpg");
386
	} else {
387
		$itemlist.find("#companyImg").attr("src", "/images/default-icon.jpg");
388
	}
389
	if(companyType == 3) {
390
		$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;
391
	}
392
	var orgOther = "";
393
	if(datalist.industry) {
394
		orgOther = datalist.industry.replace(/,/gi, " | ");
395
	}
396
	$itemlist.find("#orgOther").text(orgOther);
397

398
	if(datalist.orgType == "2") {
399
		$("#orgTit").html(orgTypeShow[datalist.orgType] + "<span style='margin-right:10px;'></span>");
371
		var itemlist = '<li><a href="" target="_blank" class="flexCenter urlgo">';
372
		itemlist += '<div class="madiaHead cmpHead">';
373
		itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="" id="companyImg"></div></div>';
374
		itemlist += '<div class="madiaInfo">';
375
		itemlist += '<p class="h1Font"><span id="orgName"></span><em class="authiconNew"></em></p>';
376
		itemlist += '<p class="h2Font ellipsisSty"><span id="orgTit"></span> <span id="orgOther"></span></p>';
377
		itemlist += '</div></a></li>';
378
		$itemlist = $(itemlist);
379
		this.append($itemlist);
380
		var datalist = $data;
381
		var companyType = datalist.authStatus;
382
		if(datalist.forShort) {
383
			$itemlist.find("#orgName").text(datalist.forShort);
384
		} else {
385
			$itemlist.find("#orgName").text(datalist.name);
386
		}
387
		$itemlist.find(".urlgo").attr("href", "cmpInforShow.html?orgId=" + datalist.id);
388
		if(datalist.hasOrgLogo) {
389
			$itemlist.find("#companyImg").attr("src", "/images/org/" + datalist.id + ".jpg");
390
		} else {
391
			$itemlist.find("#companyImg").attr("src", "/images/default-icon.jpg");
392
		}
393
		if(companyType == 3) {
394
			$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;
395
		}
396
		var orgOther = "";
397
		if(datalist.industry) {
398
			orgOther = datalist.industry.replace(/,/gi, " | ");
399
		}
400
		$itemlist.find("#orgOther").text(orgOther);
401
	
402
		if(datalist.orgType == "2") {
403
			$("#orgTit").html(orgTypeShow[datalist.orgType] + "<span style='margin-right:10px;'></span>");
404
		}
405
	
400 406
	}
401

402
}
403 407
	//相关文章信息
404 408
	function relevantarticalList(id,num){
405 409
	    keysli();
@ -598,12 +602,35 @@ function addAgree() {
598 602
}
599 603

600 604
//点击专家关注
601
$('.attenSpan').click(function(){
602
	if (userid && userid != "null" && userid != null) {
603
		if($(this).is('.attenSpanyes')){
604
			 cancelCollectionExpert($("#Zname").attr("dataid"),1)
605
		}else{
606
			collectionExpert($("#Zname").attr("dataid"),1);
605
$("#expert").on('click','.attenSpan',function(){
606
	if(userid && userid != null && userid != "null") {
607
		if($(this).is('.attenedSpan')){
608
			cancelCollectionAbout($("#Zname").attr("dataid"),$(this), 1)
609
		} else {
610
			collectionAbout($("#Zname").attr("dataid"),$(this), 1);
611
		}	
612
	}else{
613
		$.MsgBox.Alert('提示',"请先登录再进行关注");
614
		$("#mb_btn_ok").val("去登录");
615
		var aele = document.createElement('a');
616
		$("#mb_btnbox").append(aele);
617
		$("#mb_btnbox a").css({
618
			'display': "block",
619
			'width': '100%',
620
			'height': '40px',
621
			'position': 'absolute',
622
			'bottom': '-6px',
623
			'left': '0'
624
		});
625
		aele.setAttribute('href', '../login.html');
626
	}
627
})
628
$("#enterprise").on('click','.attenSpan',function(){
629
	if(userid && userid != null && userid != "null") {
630
		if($(this).is('.attenedSpan')){
631
			cancelCollectionAbout($("#Qname").attr("dataid"),$(this), 6)
632
		} else {
633
			collectionAbout($("#Qname").attr("dataid"),$(this),6);
607 634
		}	
608 635
	}else{
609 636
		$.MsgBox.Alert('提示',"请先登录再进行关注");
@ -621,14 +648,13 @@ $('.attenSpan').click(function(){
621 648
		aele.setAttribute('href', '../login.html');
622 649
	}
623 650
})
624

625 651
//点击文章收藏
626
$('#attention em').click(function(){
652
$('#attention').on("click","em",function(){
627 653
	if (userid && userid != "null" && userid != null) {
628 654
		if($(this).is('.icon-collected')){
629
			 cancelCollectionExpert(articleId,2)
655
			cancelCollectionAbout(articleId,$(this),3)
630 656
		}else{
631
			 collectionExpert(articleId,2);
657
			collectionAbout(articleId,$(this),3)
632 658
		}	
633 659
	}else{
634 660
		$.MsgBox.Alert('提示',"请先登录再进行收藏");
@ -647,120 +673,6 @@ $('#attention em').click(function(){
647 673
	}
648 674
})
649 675

650
/*判断是非关注专家*/
651
function ifCollection(getid,num) {
652
	var data = {"professorId": userid,"watchObject": getid}
653
	//alert(JSON.stringify(data))
654
	$.ajax({		
655
		url:"/ajax/watch/hasWatch",
656
		data:data,
657
		dataType: 'json', //数据格式类型
658
		type: 'get', //http请求类型
659
		timeout: 10000,
660
		async: false,
661
		success: function(data) {
662
			if(num==1){
663
				if(data.success && data.data != null) {
664
					$('.attenSpan').addClass("attenSpanyes");
665
					$('.attenSpan').addClass("attenedSpan");
666
					$('.attenSpan').text('已关注');
667
					zjreturnId = data.data.watchObject;
668
				} else {
669
					$('.attenSpan').removeClass("attenSpanyes");
670
					$('.attenSpan').removeClass("attenedSpan");
671
					$('.attenSpan').text('关注');
672
				}
673
			}
674
			if(num==2){
675
				if(data.success && data.data != null) {
676
					$('#attention em').addClass("icon-collected");
677
					wzreturnId = data.data.watchObject;
678
				} else {
679
					$('#attention em').removeClass("icon-collected");
680
				}
681
			}
682
			
683
		},
684
		error: function() {
685
			$.MsgBox.Alert('提示',"服务器链接超时");
686
		}
687
	});
688
}
689

690
/*关注专家*/
691
function collectionExpert(watchObject,num) {
692
	if(num==1){
693
		var data = {"professorId": userid,"watchObject": watchObject,"watchType": 1}
694
	}else{
695
		var data = {"professorId": userid,"watchObject": watchObject,"watchType": 3}
696
	}
697
	$.ajax({		
698
		url:"/ajax/watch",
699
		data:data,
700
		dataType: 'json', //数据格式类型
701
		type: 'POST', //http请求类型
702
		timeout: 10000,
703
		async: false,
704
		success: function(data) {
705
			console.log(data.success)
706
			if(num==1){
707
				if(data.success) {
708
					$('.attenSpan').addClass("attenSpanyes");
709
					$('.attenSpan').addClass("attenedSpan");
710
					$('.attenSpan').text('已关注');
711
					zjreturnId = data.data.watchObject;
712
				}
713
			}
714
			
715
			if(num==2){
716
				if(data.success) {
717
					$('#attention em').addClass("icon-collected");
718
					wzreturnId = data.data.watchObject;
719
				}
720
			}
721
			
722
		},
723
		error: function() {
724
			$.MsgBox.Alert('提示',"服务器链接超时");
725
		}
726
	});
727
}
728

729
/*取消收藏专家*/
730
function cancelCollectionExpert(watchObject,num) {
731
	$.ajax({		
732
		url:"/ajax/watch/delete",
733
		data: {
734
			professorId: userid,
735
			watchObject: watchObject
736
		},
737
		dataType: 'json', //数据格式类型
738
		type: 'post', //http请求类型
739
		timeout: 10000,
740
		async: true,
741
		success: function(data) {
742
			console.log(data.success)
743
			if(num==1){
744
				if(data.success) {
745
					$('.attenSpan').removeClass("attenSpanyes");
746
					$('.attenSpan').removeClass("attenedSpan");
747
					$('.attenSpan').text('关注');
748
				}	
749
			}
750
			if(num==2){
751
				if(data.success) {
752
					$('#attention em').removeClass("icon-collected");
753
				}	
754
			}
755
			
756
		},
757
		error: function(data) {
758
			$.MsgBox.Alert('提示',"服务器链接超时");
759
		}
760
	});
761

762
}
763
	
764 676

765 677
//文章浏览量
766 678
function pageViewsVal(){

+ 24 - 105
js/cmpInforShow.js

@ -4,117 +4,36 @@ $(function() {
4 4
	var orgId = GetQueryString("orgId");
5 5
	var oName = "";
6 6
7
	//	ifcollectionAbout(orgId, 1)
8 7
9 8
	if(orgId) {
10 9
		getCmpInfo(orgId); //获取个人详细信息
11 10
		getResource( 10,1, true); //获取个人发布的资源
12 11
		getArticle(10, 1, true); //获取个人发布的文章
13
		ifCollection();
14
		function ifCollection() {
15
		$.ajax({
16
			url: "/ajax/watch/hasWatch",
17
			data: {
18
				"professorId": userid,
19
				"watchObject": orgId
20
			},
21
			dataType: 'json', //数据格式类型
22
			type: 'get', //http请求类型
23
			timeout: 10000,
24
			async: true,
25
			success: function(data) {				
26
					if(data.success && data.data != null) {
27
						$('.attenSpan').addClass("attenSpanyes");
28
						$('.attenSpan').addClass("attenedSpan");
29
						$('.attenSpan').text('已关注');
30
						zjreturnId = data.data.watchObject;
31
					} else {
32
						$('.attenSpan').removeClass("attenSpanyes");
33
						$('.attenSpan').removeClass("attenedSpan");
34
						$('.attenSpan').text('关注');
35
					}
36
			},
37
			error: function() {
38
				$.MsgBox.Alert('提示', "服务器链接超时");
39
			}
40
		});
41
	}
42
		/*关注专家*/
43
	function collectionExpert(watchObject) {
44
		$.ajax({
45
			url: "/ajax/watch",
46
			data: {
47
				"professorId": userid,
48
				"watchObject": watchObject,
49
				"watchType": 6
50
			},
51
			dataType: 'json', //数据格式类型
52
			type: 'POST', //http请求类型
53
			timeout: 10000,
54
			async: false,
55
			success: function(data) {
56
					if(data.success) {
57
						$('.attenSpan').addClass("attenSpanyes");
58
						$('.attenSpan').addClass("attenedSpan");
59
						$('.attenSpan').text('已关注');
60
						zjreturnId = data.data.watchObject;
61
					}
62
			},
63
			error: function() {
64
				$.MsgBox.Alert('提示', "服务器链接超时");
65
			}
66
		});
67
	}
68
	/*取消收藏专家*/
69
	function cancelCollectionExpert(watchObject) {
70
		$.ajax({
71
			url: "/ajax/watch/delete",
72
			data: {
73
				professorId: userid,
74
				watchObject: watchObject
75
			},
76
			dataType: 'json', //数据格式类型
77
			type: 'post', //http请求类型
78
			timeout: 10000,
79
			async: true,
80
			success: function(data) {
81
				console.log(data.success)
82
					if(data.success) {
83
						$('.attenSpan').removeClass("attenSpanyes");
84
						$('.attenSpan').removeClass("attenedSpan");
85
						$('.attenSpan').text('关注');
86
					}
87
			},
88
			error: function(data) {
89
				$.MsgBox.Alert('提示', "服务器链接超时");
90
			}
91
		});
92
93
	}
12
		ifcollectionAbout(orgId,$(".goSpan").find(".attenSpan"),6);
94 13
		//点击关注按钮
95
				$("#attentBtn").on('click', function() {
96
					if(userid && userid != null && userid != "null") {
97
						if($(this).is('.attenSpanyes')){
98
							cancelCollectionExpert(orgId)
99
						} else {
100
							collectionExpert(orgId);
101
						}
102
					}else{
103
						$.MsgBox.Alert("提示", "请先登录再进行关注");
104
						$("#mb_btn_ok").val("去登录");
105
						var aele = document.createElement('a');
106
						$("#mb_btnbox").append(aele);
107
						$("#mb_btnbox a").css({
108
							'display': "block",
109
							'width': '100%',
110
							'height': '40px',
111
							'position': 'absolute',
112
							'bottom': '-6px',
113
							'left': '0'
114
						});
115
						aele.setAttribute('href', '../login.html');
116
					}
117
				});	
14
		$("#attentBtn").on('click', function() {
15
			if(userid && userid != null && userid != "null") {
16
				if($(this).is('.attenedSpan')){
17
					cancelCollectionAbout(orgId,$(this),6)
18
				} else {
19
					collectionAbout(orgId,$(this), 6);
20
				}
21
			}else{
22
				$.MsgBox.Alert("提示", "请先登录再进行关注");
23
				$("#mb_btn_ok").val("去登录");
24
				var aele = document.createElement('a');
25
				$("#mb_btnbox").append(aele);
26
				$("#mb_btnbox a").css({
27
					'display': "block",
28
					'width': '100%',
29
					'height': '40px',
30
					'position': 'absolute',
31
					'bottom': '-6px',
32
					'left': '0'
33
				});
34
				aele.setAttribute('href', '../login.html');
35
			}
36
		});	
118 37
119 38
		//点击查看全部资源
120 39
		$(".coninfobox").on("click", "#seeMoreR", function() {

+ 28 - 26
js/common.js

@ -569,8 +569,10 @@ function TimeTr(dealtime) {
569 569
	return formatTime;
570 570
}
571 571
572
572 573
/*判断是否收藏资源文章或者是否关注专家*/
573
function ifcollectionAbout(watchObject, num) {
574
function ifcollectionAbout(watchObject, sel,num) {
575
	var that=sel;
574 576
	$.ajax('/ajax/watch/hasWatch', {
575 577
		data: {
576 578
			"professorId": userid,
@ -583,19 +585,19 @@ function ifcollectionAbout(watchObject, num) {
583 585
		success: function(data) {
584 586
			if(data.success && data.data != null) {
585 587
				if(num == "1" || num == "6") { //已关注专家
586
					$(".attenSpan").addClass("attenedSpan");
587
					$(".attenSpan").text("已关注");
588
					$(that).addClass("attenedSpan");
589
					$(that).text("已关注");
588 590
				} else { //已收藏资源或文章
589
					$("#collectBtn").removeClass("icon-collect");
590
					$("#collectBtn").addClass("icon-collected");
591
					$(that).removeClass("icon-collect");
592
					$(that).addClass("icon-collected");
591 593
				}
592 594
			} else {
593 595
				if(num == "1" || num == "6") { //关注专家
594
					$(".attenSpan").removeClass("attenedSpan");
595
					$(".attenSpan").text("关注");
596
					$(that).removeClass("attenedSpan");
597
					$(that).text("关注");
596 598
				} else { //收藏资源或文章
597
					$("#collectBtn").addClass("icon-collect");
598
					$("#collectBtn").removeClass("icon-collected");
599
					$(that).addClass("icon-collect");
600
					$(that).removeClass("icon-collected");//$("#collectBtn")
599 601
				}
600 602
			}
601 603
		},
@ -605,7 +607,8 @@ function ifcollectionAbout(watchObject, num) {
605 607
	});
606 608
}
607 609
/*收藏资源、文章或者关注专家*/
608
function collectionAbout(watchObject, num) {
610
function collectionAbout(watchObject,sel, num) {
611
	var that=sel;
609 612
	$.ajax('/ajax/watch', {
610 613
		data: {
611 614
			"professorId": userid,
@ -618,12 +621,12 @@ function collectionAbout(watchObject, num) {
618 621
		async: false,
619 622
		success: function(data) {
620 623
			if(data.success) {
621
				if(num == "1" || num == "6") { //关注专家
622
					$(".attenSpan").addClass("attenedSpan");
623
					$(".attenSpan").text("已关注");
624
				} else { //收藏资源或文章
625
					$("#collectBtn").removeClass("icon-collect");
626
					$("#collectBtn").addClass("icon-collected");
624
				if(num == "1" || num == "6") {
625
					$(that).addClass("attenedSpan");
626
					$(that).text("已关注");
627
				} else {
628
					$(that).removeClass("icon-collect");
629
					$(that).addClass("icon-collected");
627 630
				}
628 631
			}
629 632
		},
@ -633,7 +636,8 @@ function collectionAbout(watchObject, num) {
633 636
	});
634 637
}
635 638
/*取消收藏资源、文章或者取消关注专家*/
636
function cancelCollectionAbout(watchObject, num) {
639
function cancelCollectionAbout(watchObject,sel,num) {
640
	var that=sel;
637 641
	$.ajax({
638 642
		url: '/ajax/watch/delete',
639 643
		data: {
@ -646,15 +650,12 @@ function cancelCollectionAbout(watchObject, num) {
646 650
		async: true,
647 651
		success: function(data) {
648 652
			console.log(data.success)
649
			if(data.success) {
650
				if(num == "1" || num == "6") { //关注专家
651
					$(".attenSpan").removeClass("attenedSpan");
652
					$(".attenSpan").text("关注");
653
				} else { //收藏资源或文章
654
					$("#collectBtn").addClass("icon-collect");
655
					$("#collectBtn").removeClass("icon-collected");
656
				}
657
653
			if(num == "1" || num == "6") { //关注专家
654
				$(that).removeClass("attenedSpan");
655
				$(that).text("关注");
656
			} else { //收藏资源或文章
657
				$(that).addClass("icon-collect");
658
				$(that).removeClass("icon-collected");
658 659
			}
659 660
		},
660 661
		error: function(data) {
@ -662,6 +663,7 @@ function cancelCollectionAbout(watchObject, num) {
662 663
		}
663 664
	});
664 665
}
666
665 667
//企业规模
666 668
var orgSizeShow = {
667 669
	'1': '50人以内',

+ 7 - 83
js/paperShow.js

@ -4,7 +4,7 @@ $(document).ready(function() {
4 4
	var userName = $.cookie("userName");
5 5
	var paperId = GetQueryString("paperId");
6 6

7
	ifcollectionAbout(paperId, 5)
7
	ifcollectionAbout(paperId,$(".attenSpan").eq(0), 5)
8 8
	getPaperMe();
9 9
	pageViewsVal();
10 10
	
@ -13,9 +13,9 @@ $(document).ready(function() {
13 13
	$("#collectBtn").on('click', function() {
14 14
		if(userid && userid != null && userid != "null") {
15 15
			if($(this).is('.icon-collected')){
16
				cancelCollectionAbout(paperId, 5)
16
				cancelCollectionAbout(paperId,$(this), 5)
17 17
			} else {
18
				collectionAbout(paperId, 5);
18
				collectionAbout(paperId,$(this), 5);
19 19
			}
20 20
		}else{
21 21
			$.MsgBox.Alert("提示", "请先登录再进行收藏");
@ -58,9 +58,9 @@ $(document).ready(function() {
58 58
		var pId=$(this).parent().siblings("a").attr("data-id");
59 59
		if(userid && userid != null && userid != "null") {
60 60
			if($(this).is('.attenedSpan')){
61
				cancelCollectionAboutP(pId,$(this))
61
				cancelCollectionAbout(pId,$(this),1)
62 62
			} else {
63
				collectionAboutP(pId,$(this));
63
				collectionAbout(pId,$(this),1);
64 64
			}
65 65
		}else{
66 66
			$.MsgBox.Alert("提示", "请先登录再进行关注");
@ -175,7 +175,7 @@ $(document).ready(function() {
175 175
											var $str=$(str);
176 176
											$("#aboutAuthors .lastBtn").before($str);
177 177
											if(showPro.id!=userid){
178
												ifcollectionAboutP(showPro.id,$str.find(".attenSpan"));
178
												ifcollectionAbout(showPro.id,$str.find(".attenSpan"),1);
179 179
											}
180 180
										}
181 181
									}
@ -375,82 +375,6 @@ $(document).ready(function() {
375 375
			});
376 376
		}
377 377
	})
378
	
379
	
380
	/*判断是否收藏资源文章或者是否关注专家*/
381
	function ifcollectionAboutP(watchObject, sel) {
382
		var that=sel;
383
		$.ajax('/ajax/watch/hasWatch', {
384
			data: {
385
				"professorId": userid,
386
				"watchObject": watchObject
387
			},
388
			dataType: 'json', //数据格式类型
389
			type: 'get', //http请求类型
390
			timeout: 10000,
391
			async: false,
392
			success: function(data) {
393
				if(data.success && data.data != null) {
394
						$(that).addClass("attenedSpan");
395
						$(that).text("已关注");
396
				} else {
397
						$(that).removeClass("attenedSpan");
398
						$(that).text("关注");
399
				}
400
			},
401
			error: function(data) {
402
				$.MsgBox.Alert('提示', "服务器链接超时");
403
			}
404
		});
405
	}
406
	/*收藏资源、文章或者关注专家*/
407
	function collectionAboutP(watchObject,sel) {
408
		var that=sel;
409
		$.ajax('/ajax/watch', {
410
			data: {
411
				"professorId": userid,
412
				"watchObject": watchObject
413
			},
414
			dataType: 'json', //数据格式类型
415
			type: 'POST', //http请求类型
416
			timeout: 10000,
417
			async: false,
418
			success: function(data) {
419
				if(data.success) {
420
					$(that).addClass("attenedSpan");
421
					$(that).text("已关注");
422
				}
423
			},
424
			error: function(data) {
425
				$.MsgBox.Alert('提示', "服务器链接超时");
426
			}
427
		});
428
	}
429
	/*取消收藏资源、文章或者取消关注专家*/
430
	function cancelCollectionAboutP(watchObject,sel) {
431
		var that=sel;
432
		$.ajax({
433
			url: '/ajax/watch/delete',
434
			data: {
435
				professorId: userid,
436
				watchObject: watchObject
437
			},
438
			dataType: 'json', //数据格式类型
439
			type: 'post', //http请求类型
440
			timeout: 10000,
441
			async: true,
442
			success: function(data) {
443
				console.log(data.success)
444
				if(data.success) {
445
					$(that).removeClass("attenedSpan");
446
					$(that).text("关注");
447
				}
448
			},
449
			error: function(data) {
450
				$.MsgBox.Alert('提示', "服务器链接超时");
451
			}
452
		});
453
	}
454
	
378

455 379
	
456 380
})

+ 6 - 81
js/patentShow.js

@ -5,7 +5,7 @@ $(document).ready(function() {
5 5
	}
6 6
	Patent.prototype.init = function() {
7 7
		loginStatus();
8
		ifcollectionAbout(GetQueryString("patentId"));
8
		ifcollectionAbout(GetQueryString("patentId"),$(".attenSpan").eq(0),4);
9 9
		this.ajax({
10 10
			url: "/ajax/ppatent/qo",
11 11
			data: {
@ -248,7 +248,7 @@ $(document).ready(function() {
248 248
			otr += '</li>'
249 249
			var $otr=$(otr);
250 250
		$("#faM .lastBtn").before($otr);
251
		ifcollectionAboutP(oId,$otr.find(".attenSpan"));
251
		ifcollectionAbout(oId,$otr.find(".attenSpan"),1);
252 252
	}
253 253
	Patent.prototype.bindEvent = function($obj) {
254 254
		$("#faM").on("click", "li>a", function() {
@ -266,9 +266,9 @@ $(document).ready(function() {
266 266
		$('#attention em').click(function() {
267 267
			if(userid && userid != "null" && userid != null) {
268 268
				if($(this).is('.icon-collected')) {
269
					cancelCollectionAbout(GetQueryString("patentId"), 4);
269
					cancelCollectionAbout(GetQueryString("patentId"),$(this), 4);
270 270
				} else {
271
					collectionAbout(GetQueryString("patentId"), 4);
271
					collectionAbout(GetQueryString("patentId"),$(this), 4);
272 272
				}
273 273
			} else {
274 274
				$.MsgBox.Alert('提示', "请先登录再进行收藏");
@ -311,9 +311,9 @@ $(document).ready(function() {
311 311
			var pId=$(this).parent().siblings("a").attr("data-id");
312 312
			if(userid && userid != null && userid != "null") {
313 313
				if($(this).is('.attenedSpan')){
314
					cancelCollectionAboutP(pId, $(this))
314
					cancelCollectionAbout(pId, $(this),1)
315 315
				} else {
316
					collectionAboutP(pId, $(this));
316
					collectionAbout(pId, $(this),1);
317 317
				}
318 318
			}else{
319 319
				$.MsgBox.Alert("提示", "请先登录再进行关注");
@ -428,79 +428,4 @@ $(document).ready(function() {
428 428
		
429 429
	}
430 430
	
431
	/*判断是否收藏资源文章或者是否关注专家*/
432
	function ifcollectionAboutP(watchObject, sel) {
433
		var that=sel;
434
		$.ajax('/ajax/watch/hasWatch', {
435
			data: {
436
				"professorId": userid,
437
				"watchObject": watchObject
438
			},
439
			dataType: 'json', //数据格式类型
440
			type: 'get', //http请求类型
441
			timeout: 10000,
442
			async: false,
443
			success: function(data) {
444
				if(data.success && data.data != null) {
445
						$(that).addClass("attenedSpan");
446
						$(that).text("已关注");
447
				} else {
448
						$(that).removeClass("attenedSpan");
449
						$(that).text("关注");
450
				}
451
			},
452
			error: function(data) {
453
				$.MsgBox.Alert('提示', "服务器链接超时");
454
			}
455
		});
456
	}
457
	/*收藏资源、文章或者关注专家*/
458
	function collectionAboutP(watchObject,sel) {
459
		var that=sel;
460
		$.ajax('/ajax/watch', {
461
			data: {
462
				"professorId": userid,
463
				"watchObject": watchObject
464
			},
465
			dataType: 'json', //数据格式类型
466
			type: 'POST', //http请求类型
467
			timeout: 10000,
468
			async: false,
469
			success: function(data) {
470
				if(data.success) {
471
					$(that).addClass("attenedSpan");
472
					$(that).text("已关注");
473
				}
474
			},
475
			error: function(data) {
476
				$.MsgBox.Alert('提示', "服务器链接超时");
477
			}
478
		});
479
	}
480
	/*取消收藏资源、文章或者取消关注专家*/
481
	function cancelCollectionAboutP(watchObject,sel) {
482
		var that=sel;
483
		$.ajax({
484
			url: '/ajax/watch/delete',
485
			data: {
486
				professorId: userid,
487
				watchObject: watchObject
488
			},
489
			dataType: 'json', //数据格式类型
490
			type: 'post', //http请求类型
491
			timeout: 10000,
492
			async: true,
493
			success: function(data) {
494
				console.log(data.success)
495
				if(data.success) {
496
					$(that).removeClass("attenedSpan");
497
					$(that).text("关注");
498
				}
499
			},
500
			error: function(data) {
501
				$.MsgBox.Alert('提示', "服务器链接超时");
502
			}
503
		});
504
	}
505
	
506 431
})

+ 3 - 3
js/userInforShow.js

@ -4,7 +4,7 @@ $(function() {
4 4
	var professorId = GetQueryString("professorId");
5 5
	var oArray=[];
6 6
	if(userid != professorId) {
7
		ifcollectionAbout(professorId, 1)
7
		ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
8 8
		$(".goSpan").show();
9 9
	}
10 10
	
@ -82,9 +82,9 @@ $(function() {
82 82
		$("#attentBtn").on('click', function() {
83 83
			if(userid && userid != null && userid != "null") {
84 84
				if($(this).is('.attenedSpan')){
85
					cancelCollectionAbout(professorId, 1)
85
					cancelCollectionAbout(professorId,$(this), 1)
86 86
				} else {
87
					collectionAbout(professorId, 1);
87
					collectionAbout(professorId,$(this), 1);
88 88
				}
89 89
			}else{
90 90
				$.MsgBox.Alert("提示", "请先登录再进行关注");