jack 7 jaren geleden
bovenliggende
commit
e516767fff
4 gewijzigde bestanden met toevoegingen van 78 en 35 verwijderingen
  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,7 +505,7 @@ $(function() {
505 505
							$("#abutartical").append($itemlist);
506 506
							var datalist = data.data[i];
507 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 509
							if(datalist.articleImg!=undefined){
510 510
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/article/" + datalist.articleImg + ");");
511 511
							}

+ 32 - 21
js/articalShow2.js

@ -72,41 +72,48 @@ $(function() {
72 72
	}
73 73
	//初始化文章内容
74 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 87
					}else{
81 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 91
					if (userid && userid != "null" && userid != null) {
85
						isAgree(window.staticPageData.articleAgree)//文章点赞
92
						isAgree(data.data.articleAgree)//文章点赞
86 93
					}else{
87
						$(".thumbBtn").html("赞 <span>"+window.staticPageData.articleAgree+"</span>");
94
						$(".thumbBtn").html("赞 <span>"+data.data.articleAgree+"</span>");
88 95
					}
89 96
					ifcollectionAbout(articleId,$("#attention").find("em"), 3)
90
					if(window.staticPageData.articleType==1){
97
					if(data.data.articleType==1){
91 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 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 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 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 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 117
				document.title = articletitle;
111 118
				window.setTimeout(function() {
112 119
					$('body').scrollTop(4);
@ -119,7 +126,11 @@ $(function() {
119 126
				        zIndex : 997
120 127
				    });	
121 128
				}, 300);
122
			
129
			},
130
			"error":function(){
131
				$.MsgBox.Alert('提示','链接服务器超时')
132
			}
133
		});
123 134
	}
124 135
	
125 136
	//专家信息

+ 21 - 7
js/paperShow1.js

@ -68,14 +68,28 @@ $(document).ready(function() {
68 68
			closeLog();
69 69
		}
70 70
	});
71

72
	
73 71
	/*获取论文信息*/
74 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 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 95
	function getPaperAuthors(stritrm) {
@ -256,9 +270,9 @@ $(document).ready(function() {
256 270
	}
257 271
	/*处理论文html代码*/
258 272
	function paperHtml($da) {
259
		$("#paperName").text($da.name); //名字
273
		$("#paperName").text(window.staticPageData.name); //名字
260 274
		$("#pageView").text($da.pageViews); //浏览量
261
		$("#paperAbstract").text($da.summary); //摘要内容
275
		$("#paperAbstract").text(window.staticPageData.summary); //摘要内容
262 276
		if(!$da.cn4periodical){
263 277
			$da.cn4periodical=""
264 278
		}

+ 24 - 6
js/patentShow1.js

@ -11,7 +11,18 @@ $(document).ready(function() {
11 11
	Patent.prototype.init = function() {
12 12
		loginYesOrNo()
13 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 26
		this.ajax({
16 27
			url: "/ajax/ppatent/authors",
17 28
			data: {
@ -66,17 +77,24 @@ $(document).ready(function() {
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 88
			$(".oinput").parents(".form-item").hide();
71 89
			$(".conItem").hide();
72 90
			if($data.keywords) {
73
				this.keyword($data.keywords);
91
				$obj.keyword($data.keywords);
74 92
			} else {
75 93
				$(".tagList").hide();
76 94
			}
77
		
95
		}
78 96
		if($data.name) {
79
			$("#paperName").text($data.name);
97
			
80 98
			document.title=$data.name;
81 99
		}
82 100
		$("#pageview").text($data.pageViews);
@ -100,7 +118,7 @@ $(document).ready(function() {
100 118
		var weibourl = window.location.href;
101 119
		var weibopic = "http://" + window.location.host + "/images/default-patent.jpg";
102 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 122
		$("#advertisement img").attr("src","/"+$("#advertisement img").attr("src"));
105 123
	}
106 124
	Patent.prototype.patentAuth = function($data, $obj) {