Browse Source

专利ad显示

luyanan 7 years ago
parent
commit
90b4a3d853
2 changed files with 148 additions and 149 deletions
  1. 146 147
      js/articalShow2.js
  2. 2 2
      js/patentShow1.js

+ 146 - 147
js/articalShow2.js

@ -103,7 +103,7 @@ $(document).ready(function() {
103 103
					if(data.data.articleImg){
104 104
						$("#articleImg").attr("style", "background-image: url(/data/article/" + data.data.articleImg + ")");
105 105
					}else{
106
						$("#articleImg").attr("style", "background-image: url(../images/default-artical.jpg)");
106
						$("#articleImg").attr("style", "background-image: url(/images/default-artical.jpg)");
107 107
					}
108 108
					$("#tagList").text(industryShow(data.data.subject));
109 109
					if (userid && userid != "null" && userid != null) {
@ -615,165 +615,164 @@ $(document).ready(function() {
615 615
		}			
616 616
	}
617 617
	
618
});
619

620
//文章点击点赞
621
$('.thumbBlock').on("click",".thunbgo",function(){
622
	if (userid && userid != "null" && userid != null) {
623
		addAgree();
624
	}else{
625
		quickLog();
626
		operatTab();
627
		closeLog();
618
	//文章点击点赞
619
	$('.thumbBlock').on("click",".thunbgo",function(){
620
		if (userid && userid != "null" && userid != null) {
621
			addAgree();
622
		}else{
623
			quickLog();
624
			operatTab();
625
			closeLog();
626
		}
627
	})
628
	
629
	/*判断文章是否被赞*/
630
	function isAgree(articleAgree) {
631
		var data = {"operateId": userid,"articleId": articleId}
632
		$.ajax({		
633
			url:"/ajax/article/isAgree",
634
			data:data,
635
			dataType: 'json', //数据格式类型
636
			type: 'get', //http请求类型
637
			async: false,
638
			success: function(data) {
639
				if(data.success){
640
					if(data.data!= null){
641
						$(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
642
						$(".thumbBtn").addClass("thumbedBtn");
643
					}else{
644
						$(".thumbBtn").html("赞 <span>"+articleAgree+"</span>");
645
						$(".thumbBtn").addClass("thunbgo");
646
					}
647
				}
648
			},
649
			error: function() {
650
				$.MsgBox.Alert('提示',"服务器链接超时");
651
			}
652
		});
628 653
	}
629
})
630

631
/*判断文章是否被赞*/
632
function isAgree(articleAgree) {
633
	var data = {"operateId": userid,"articleId": articleId}
634
	$.ajax({		
635
		url:"/ajax/article/isAgree",
636
		data:data,
637
		dataType: 'json', //数据格式类型
638
		type: 'get', //http请求类型
639
		async: false,
640
		success: function(data) {
641
			if(data.success){
642
				if(data.data!= null){
643
					$(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
654
	
655
	/*点赞*/
656
	function addAgree() {
657
		var data = {"operateId": userid,"articleId": articleId,"uname":$.cookie("userName")}
658
		$.ajax({		
659
			url:"/ajax/article/agree",
660
			data:data,
661
			dataType: 'json', //数据格式类型
662
			type: 'POST', //http请求类型
663
			async: false,
664
			success: function(data) {
665
				if(data.success){
666
					var articleAgreeval = $(".thumbBtn span").text();
667
					$(".thumbBtn").html("已赞 <span>"+(parseInt(articleAgreeval)+1)+"</span>");
644 668
					$(".thumbBtn").addClass("thumbedBtn");
645
				}else{
646
					$(".thumbBtn").html("赞 <span>"+articleAgree+"</span>");
647
					$(".thumbBtn").addClass("thunbgo");
669
					$(".thumbBtn").removeClass("thunbgo");
648 670
				}
671
			},
672
			error: function() {
673
				$.MsgBox.Alert('提示',"服务器链接超时");
649 674
			}
650
		},
651
		error: function() {
652
			$.MsgBox.Alert('提示',"服务器链接超时");
675
		});
676
	}
677
	
678
	//点击专家关注
679
	$("#expert").on('click','.attenSpan',function(){
680
		if(userid && userid != null && userid != "null") {
681
			if($(this).is('.attenedSpan')){
682
				cancelCollectionAbout($("#Zname").attr("dataid"),$(this), 1)
683
			} else {
684
				collectionAbout($("#Zname").attr("dataid"),$(this), 1);
685
			}	
686
		}else{
687
			quickLog();
688
			operatTab();
689
			closeLog();
653 690
		}
654
	});
655
}
656

657
/*点赞*/
658
function addAgree() {
659
	var data = {"operateId": userid,"articleId": articleId,"uname":$.cookie("userName")}
660
	$.ajax({		
661
		url:"/ajax/article/agree",
662
		data:data,
663
		dataType: 'json', //数据格式类型
664
		type: 'POST', //http请求类型
665
		async: false,
666
		success: function(data) {
667
			if(data.success){
668
				var articleAgreeval = $(".thumbBtn span").text();
669
				$(".thumbBtn").html("已赞 <span>"+(parseInt(articleAgreeval)+1)+"</span>");
670
				$(".thumbBtn").addClass("thumbedBtn");
671
				$(".thumbBtn").removeClass("thunbgo");
672
			}
673
		},
674
		error: function() {
675
			$.MsgBox.Alert('提示',"服务器链接超时");
691
	})
692
	$("#enterprise").on('click','.attenSpan',function(){
693
		if(userid && userid != null && userid != "null") {
694
			if($(this).is('.attenedSpan')){
695
				cancelCollectionAbout($("#Qname").attr("dataid"),$(this), 6)
696
			} else {
697
				collectionAbout($("#Qname").attr("dataid"),$(this),6);
698
			}	
699
		}else{
700
			quickLog();
701
			operatTab();
702
			closeLog();
676 703
		}
677
	});
678
}
679

680
//点击专家关注
681
$("#expert").on('click','.attenSpan',function(){
682
	if(userid && userid != null && userid != "null") {
683
		if($(this).is('.attenedSpan')){
684
			cancelCollectionAbout($("#Zname").attr("dataid"),$(this), 1)
685
		} else {
686
			collectionAbout($("#Zname").attr("dataid"),$(this), 1);
687
		}	
688
	}else{
689
		quickLog();
690
		operatTab();
691
		closeLog();
692
	}
693
})
694
$("#enterprise").on('click','.attenSpan',function(){
695
	if(userid && userid != null && userid != "null") {
696
		if($(this).is('.attenedSpan')){
697
			cancelCollectionAbout($("#Qname").attr("dataid"),$(this), 6)
698
		} else {
699
			collectionAbout($("#Qname").attr("dataid"),$(this),6);
700
		}	
701
	}else{
702
		quickLog();
703
		operatTab();
704
		closeLog();
705
	}
706
})
707
//点击文章收藏
708
$('#attention').on("click","em",function(){
709
	if (userid && userid != "null" && userid != null) {
710
		if($(this).is('.icon-collected')){
711
			cancelCollectionAbout(articleId,$(this),3)
704
	})
705
	//点击文章收藏
706
	$('#attention').on("click","em",function(){
707
		if (userid && userid != "null" && userid != null) {
708
			if($(this).is('.icon-collected')){
709
				cancelCollectionAbout(articleId,$(this),3)
710
			}else{
711
				collectionAbout(articleId,$(this),3)
712
			}	
712 713
		}else{
713
			collectionAbout(articleId,$(this),3)
714
		}	
715
	}else{
716
		quickLog();
717
		operatTab();
718
		closeLog();
719
	}
720
})
721

722

723
//文章浏览量
724
function pageViewsVal(){
725
	$.ajax({
726
		"url" : "/ajax/article/pageViews",
727
		"type" :  "POST" ,
728
		"dataType" : "json",
729
		"data" :{"articleId":articleId},
730
		"success" : function(data) {
731
			console.log(data);
732
			if (data.success){
733
			}
734
		},
735
		"error":function(){
736
			$.MsgBox.Alert('提示','链接服务器超时')
714
			quickLog();
715
			operatTab();
716
			closeLog();
737 717
		}
738
	});
739
}
740
window.onload=function(){
741
	pageViewsVal();//文章浏览量
742
}
743

744

745
//纠错反馈
746
$(".correctSubmit").on("click",function(){
747
	var cntCon=$(this).siblings(".correctCon").val();
748
	var cntUser="";
749
	if(userid && userid != null && userid != "null") {
750
		cntUser = userid;
751
	}
752
	if(cntCon.length>500){
753
		$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
754
		return;
755
	}else{
718
	})
719
	
720
	
721
	//文章浏览量
722
	function pageViewsVal(){
756 723
		$.ajax({
757
			"url": "/ajax/feedback/error/article",
758
			"type": "POST",
759
			"dataType": "json",
760
			"async": true,
761
			"data": {
762
				"id": articleId,
763
				"cnt":cntCon,
764
				"user":cntUser
765
			},
766
			"success": function(data) {
767
				if(data.success) {
768
					backSuccessed();
769
					suImg() 
724
			"url" : "/ajax/article/pageViews",
725
			"type" :  "POST" ,
726
			"dataType" : "json",
727
			"data" :{"articleId":articleId},
728
			"success" : function(data) {
729
				console.log(data);
730
				if (data.success){
770 731
				}
771 732
			},
772
			"error": function() {
773
				$.MsgBox.Alert('提示', '链接服务器超时')
733
			"error":function(){
734
				$.MsgBox.Alert('提示','链接服务器超时')
774 735
			}
775 736
		});
776 737
	}
738
	window.onload=function(){
739
		pageViewsVal();//文章浏览量
740
	}
777 741
	
778 742
	
779
})
743
	//纠错反馈
744
	$(".correctSubmit").on("click",function(){
745
		var cntCon=$(this).siblings(".correctCon").val();
746
		var cntUser="";
747
		if(userid && userid != null && userid != "null") {
748
			cntUser = userid;
749
		}
750
		if(cntCon.length>500){
751
			$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
752
			return;
753
		}else{
754
			$.ajax({
755
				"url": "/ajax/feedback/error/article",
756
				"type": "POST",
757
				"dataType": "json",
758
				"async": true,
759
				"data": {
760
					"id": articleId,
761
					"cnt":cntCon,
762
					"user":cntUser
763
				},
764
				"success": function(data) {
765
					if(data.success) {
766
						backSuccessed();
767
						suImg() 
768
					}
769
				},
770
				"error": function() {
771
					$.MsgBox.Alert('提示', '链接服务器超时')
772
				}
773
			});
774
		}
775
		
776
		
777
	})
778
});

+ 2 - 2
js/patentShow1.js

@ -102,7 +102,7 @@ $(document).ready(function() {
102 102
			}
103 103
		} else {
104 104
			$(".oinput").parents(".form-item").hide();
105
			$(".conItem").hide();
105
			$(".conItemFirst,#paperList").hide();
106 106
			if($data.keywords) {
107 107
				$obj.keyword($data.keywords);
108 108
			} else {
@ -255,7 +255,7 @@ $(document).ready(function() {
255 255
		if($data.hasHeadImage) {
256 256
			img = "/images/head/" + $data.id + "_l.jpg";
257 257
		} else {
258
			img = "../images/default-photo.jpg"
258
			img = "/images/default-photo.jpg"
259 259
		}
260 260
		oId = $data.id;
261 261
		var otr = '<li class="flexCenter"><a href="" data-id="' + oId + '">' +