jack 7 years ago
parent
commit
e516767fff
4 changed files with 78 additions and 35 deletions
  1. 1 1
      js/articalShow.js
  2. 32 21
      js/articalShow2.js
  3. 21 7
      js/paperShow1.js
  4. 24 6
      js/patentShow1.js

+ 1 - 1
js/articalShow.js

505
							$("#abutartical").append($itemlist);
505
							$("#abutartical").append($itemlist);
506
							var datalist = data.data[i];
506
							var datalist = data.data[i];
507
							$itemlist.find("#resourceName").text(datalist.articleTitle);
507
							$itemlist.find("#resourceName").text(datalist.articleTitle);
508
							$itemlist.find(".urlgo").attr("href", "/"+pageUrl('a',datalist);
508
							$itemlist.find(".urlgo").attr("href", "/"+pageUrl('a',datalist));
509
							if(datalist.articleImg!=undefined){
509
							if(datalist.articleImg!=undefined){
510
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/article/" + datalist.articleImg + ");");
510
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/article/" + datalist.articleImg + ");");
511
							}
511
							}

+ 32 - 21
js/articalShow2.js

72
	}
72
	}
73
	//初始化文章内容
73
	//初始化文章内容
74
	function articleshow(){
74
	function articleshow(){
75
					$("#pageViews").text("阅读量 "+window.staticPageData.pageViews);
76
					$("#publishTime").text(commenTime(window.staticPageData.publishTime));
77
					$("#articleContent").html(window.staticPageData.articleContent);
78
					if(window.staticPageData.articleImg){
79
						$("#articleImg").attr("style", "background-image: url(/data/article/" + window.staticPageData.articleImg + ")");
75
		$("#articleContent").html(window.staticPageData.articleContent);
76
		$.ajax({
77
			"url" : "/ajax/article/query",
78
			"type" :  "GET" ,
79
			"dataType" : "json",
80
			"data" :{"articleId":articleId},
81
			"success" : function(data) {
82
				if (data.success){
83
					$("#pageViews").text("阅读量 "+data.data.pageViews);
84
					$("#publishTime").text(commenTime(data.data.publishTime));
85
					if(data.data.articleImg){
86
						$("#articleImg").attr("style", "background-image: url(/data/article/" + data.data.articleImg + ")");
80
					}else{
87
					}else{
81
						$("#articleImg").attr("style", "background-image: url(../images/default-artical.jpg)");
88
						$("#articleImg").attr("style", "background-image: url(../images/default-artical.jpg)");
82
					}
89
					}
83
					$("#tagList").text(industryShow(window.staticPageData.subject));
90
					$("#tagList").text(industryShow(data.data.subject));
84
					if (userid && userid != "null" && userid != null) {
91
					if (userid && userid != "null" && userid != null) {
85
						isAgree(window.staticPageData.articleAgree)//文章点赞
92
						isAgree(data.data.articleAgree)//文章点赞
86
					}else{
93
					}else{
87
						$(".thumbBtn").html("赞 <span>"+window.staticPageData.articleAgree+"</span>");
94
						$(".thumbBtn").html("赞 <span>"+data.data.articleAgree+"</span>");
88
					}
95
					}
89
					ifcollectionAbout(articleId,$("#attention").find("em"), 3)
96
					ifcollectionAbout(articleId,$("#attention").find("em"), 3)
90
					if(window.staticPageData.articleType==1){
97
					if(data.data.articleType==1){
91
						$("#expert").removeClass("displayNone");
98
						$("#expert").removeClass("displayNone");
92
						relevantarticalList(window.staticPageData.professorId,1);
93
						expert(window.staticPageData.professorId);
94
						recentlyArticle(2,{"professorId":window.staticPageData.professorId}) 
99
						relevantarticalList(data.data.professorId,1);
100
						expert(data.data.professorId);
101
						recentlyArticle(2,{"professorId":data.data.professorId}) 
95
					}
102
					}
96
					if(window.staticPageData.articleType==2){
103
					if(data.data.articleType==2){
97
						$("#enterprise").removeClass("displayNone");
104
						$("#enterprise").removeClass("displayNone");
98
						relevantarticalList(window.staticPageData.orgId,2);
99
						cmpFun(window.staticPageData.orgId);
105
						relevantarticalList(data.data.orgId,2);
106
						cmpFun(data.data.orgId);
100
						companylist();
107
						companylist();
101
						recentlyArticle(1,{"orgId":window.staticPageData.orgId});
108
						recentlyArticle(1,{"orgId":data.data.orgId});
102
					}
109
					}
103
					var weibotitle = window.staticPageData.articleTitle;
110
					var weibotitle = data.data.articleTitle;
104
					var weibourl =window.location.href;
111
					var weibourl =window.location.href;
105
					var weibopic ="http://"+window.location.host+"/data/article/" + window.staticPageData.articleImg;
112
					var weibopic ="http://"+window.location.host+"/data/article/" + data.data.articleImg;
106
					$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
113
					$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
114
				}
107
				
115
				
108
				
109
				var articletitle = window.staticPageData.articleTitle + "-科袖网";
116
				var articletitle = data.data.articleTitle + "-科袖网";
110
				document.title = articletitle;
117
				document.title = articletitle;
111
				window.setTimeout(function() {
118
				window.setTimeout(function() {
112
					$('body').scrollTop(4);
119
					$('body').scrollTop(4);
119
				        zIndex : 997
126
				        zIndex : 997
120
				    });	
127
				    });	
121
				}, 300);
128
				}, 300);
122
			
129
			},
130
			"error":function(){
131
				$.MsgBox.Alert('提示','链接服务器超时')
132
			}
133
		});
123
	}
134
	}
124
	
135
	
125
	//专家信息
136
	//专家信息

+ 21 - 7
js/paperShow1.js

68
			closeLog();
68
			closeLog();
69
		}
69
		}
70
	});
70
	});
71

72
	
73
	/*获取论文信息*/
71
	/*获取论文信息*/
74
	function getPaperMe() {
72
	function getPaperMe() {
75
					paperHtml(window.staticPageData);
76
					getPaperAuthors(paperId)
77
					var paperName = window.staticPageData.name + "-科袖网";
73
		$.ajax({
74
			"url": "/ajax/ppaper/qo",
75
			"type": "GET",
76
			"success": function(data) {
77
				console.log(data);
78
				if(data.success) {
79
					paperHtml(data.data);
80
					getPaperAuthors(data.data.id)
81
					var paperName = data.data.name + "-科袖网";
78
					document.title = paperName;
82
					document.title = paperName;
83
				}
84
			},
85
			"data": {
86
				"id": paperId
87
			},
88
			dataType: "json",
89
			'error': function() {
90
				$.MsgBox.Alert('提示', '服务器连接超时!');
91
			}
92
		});
79
	}
93
	}
80
	/*获取论文作者信息*/
94
	/*获取论文作者信息*/
81
	function getPaperAuthors(stritrm) {
95
	function getPaperAuthors(stritrm) {
256
	}
270
	}
257
	/*处理论文html代码*/
271
	/*处理论文html代码*/
258
	function paperHtml($da) {
272
	function paperHtml($da) {
259
		$("#paperName").text($da.name); //名字
273
		$("#paperName").text(window.staticPageData.name); //名字
260
		$("#pageView").text($da.pageViews); //浏览量
274
		$("#pageView").text($da.pageViews); //浏览量
261
		$("#paperAbstract").text($da.summary); //摘要内容
275
		$("#paperAbstract").text(window.staticPageData.summary); //摘要内容
262
		if(!$da.cn4periodical){
276
		if(!$da.cn4periodical){
263
			$da.cn4periodical=""
277
			$da.cn4periodical=""
264
		}
278
		}

+ 24 - 6
js/patentShow1.js

11
	Patent.prototype.init = function() {
11
	Patent.prototype.init = function() {
12
		loginYesOrNo()
12
		loginYesOrNo()
13
		ifcollectionAbout(patentId,$("#collectBtn"),4);
13
		ifcollectionAbout(patentId,$("#collectBtn"),4);
14
		this.patentMess(window.staticPageData);
14
		$("#paperName").text(window.staticPageData.name);
15
		if(window.staticPageData.summary) {
16
			$(".showCon").eq(5).text(window.staticPageData.summary);
17
		}
18
		this.ajax({
19
			url: "/ajax/ppatent/qo",
20
			data: {
21
				id: GetQueryString("patentId")
22
			},
23
			type: "get",
24
			Fun: this.patentMess
25
		});
15
		this.ajax({
26
		this.ajax({
16
			url: "/ajax/ppatent/authors",
27
			url: "/ajax/ppatent/authors",
17
			data: {
28
			data: {
66

77

67
		}
78
		}
68
	}
79
	}
69
	Patent.prototype.patentMess = function($data) {
80
	Patent.prototype.patentMess = function($data, $obj) {
81
		if(GetQueryString("flag") == 1) {
82
			$(".advertItem,.tagList").hide();
83
			hotKey(".oinput", 10);
84
			if($data.keywords) {
85
				$obj.keyword($data.keywords);
86
			}
87
		} else {
70
			$(".oinput").parents(".form-item").hide();
88
			$(".oinput").parents(".form-item").hide();
71
			$(".conItem").hide();
89
			$(".conItem").hide();
72
			if($data.keywords) {
90
			if($data.keywords) {
73
				this.keyword($data.keywords);
91
				$obj.keyword($data.keywords);
74
			} else {
92
			} else {
75
				$(".tagList").hide();
93
				$(".tagList").hide();
76
			}
94
			}
77
		
95
		}
78
		if($data.name) {
96
		if($data.name) {
79
			$("#paperName").text($data.name);
97
			
80
			document.title=$data.name;
98
			document.title=$data.name;
81
		}
99
		}
82
		$("#pageview").text($data.pageViews);
100
		$("#pageview").text($data.pageViews);
100
		var weibourl = window.location.href;
118
		var weibourl = window.location.href;
101
		var weibopic = "http://" + window.location.host + "/images/default-patent.jpg";
119
		var weibopic = "http://" + window.location.host + "/images/default-patent.jpg";
102
		$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + encodeURIComponent(weibotitle) + "&url=" + encodeURIComponent(weibourl) + "&pic=" + encodeURIComponent(weibopic) + "&content=utf-8" + "&ralateUid=6242830109&searchPic=false&style=simple");
120
		$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + encodeURIComponent(weibotitle) + "&url=" + encodeURIComponent(weibourl) + "&pic=" + encodeURIComponent(weibopic) + "&content=utf-8" + "&ralateUid=6242830109&searchPic=false&style=simple");
103
		this.bindEvent(this);
121
		$obj.bindEvent($obj);
104
		$("#advertisement img").attr("src","/"+$("#advertisement img").attr("src"));
122
		$("#advertisement img").attr("src","/"+$("#advertisement img").attr("src"));
105
	}
123
	}
106
	Patent.prototype.patentAuth = function($data, $obj) {
124
	Patent.prototype.patentAuth = function($data, $obj) {