Browse Source

文章资源分享页面

luyanan 7 years ago
parent
commit
e81e3a8bb5
4 changed files with 839 additions and 302 deletions
  1. 37 13
      css/share.css
  2. 565 234
      e/a.html
  3. 237 55
      e/r.html
  4. BIN
      images/ecordCard.jpg

+ 37 - 13
css/share.css

@ -63,11 +63,18 @@ html,body {outline: 0;margin:0;padding:0px;background: #efeff4;-webkit-text-size
63 63
	        -webkit-align-items: center;
64 64
	                align-items: center;}
65 65
/*文章浏览*/
66
.topFu{background: rgba(0,0,0,.6);padding:10px 15px;position: fixed;right:0;left:0;z-index:200;}
67
.topLogo{width:60px;height:30px;background: url(../images/home_icon_logo_orange.png);background-size: cover;}
68
.goSpan span{background: #ff9900;display:inline-block;text-align: center;width:48px;cursor:pointer;color:#fff;font-size:16px;border-radius:4px;padding:4px;}
69
.goSpan .attenSpan{position: relative;padding-left: 14px;}
70
.goSpan .attenSpan:before{position:absolute;content:url(../images/g_article_icon_jia_nor.png);top:50%;left:10px;margin-top:-8px;}
71
.goSpan .attenedSpan{background:#ccc;padding-left:16px;}
72
.goSpan .attenedSpan:before{content:"";}
66 73
.showDetail{padding:15px;padding-top:10px;}
67 74
.showDetail .hWeight{font-weight:bold;}
68 75
.showDetail .h1Font{font-size:20px;margin:8px 0;line-height:30px;color:#333;}
69 76
.showDetail .showFont{font-size:16px;margin-top:-4px; line-height:24px;color:#333;}
70
.showDetail .h2Font{font-size:14px;color:#666; line-height:24px;}
77
.showDetail .h2Font{font-size:14px;color:#666; line-height:16px;}
71 78
.showDetail .h3Font{font-size:13px;color:#999; line-height:24px;}
72 79
.showDetail .showMain{font-size:15px;color:#333;line-height:28px;}
73 80
.showDetail .showMain img{max-width: 100%;}
@ -77,22 +84,38 @@ ul.tagList>li{list-style:none;float: left;margin-right:10px;margin-bottom:10px;p
77 84
ul.tagList>li .h2Font{color: #666;}
78 85
.madiaBlock{clear:both;}.madiaBlock:before,.madiaBlock:after{display:table;content:""}.madiaBlock:after{clear: both;}
79 86
.madiaBlock ul.mui-table-view{margin:10px 0;overflow: hidden;}
80
.madiaBlock ul.mui-table-view li{position: relative;}
87
.madiaBlock ul.mui-table-view li{position: relative;cursor: pointer;}
81 88
.madiaBlock .madiaTit{position:relative;font-size:16px;color:#666;padding-left:10px;margin-top:15px;}
82 89
.madiaBlock .madiaTit:before{display:inline-block;content:"";width:4px;height: 16px;position:absolute;top:1px;left:0;background: #ff9900;}
83 90
.madiaBlock .madiaHead{width:90px;height:60px;margin-top:-30px;position:absolute;border:1px solid #E5E5E5;top:50%;background-position: center;background-size: cover;}
84 91
.madiaBlock .madiaHead.useHead{width: 50px;height:50px;margin-top:-25px;background-image: url(../images/default-photo.jpg);border-radius: 50%;}
85 92
.madiaBlock .madiaHead.resouseHead{background-image: url(../images/default-resource.jpg);}
86 93
.madiaBlock .madiaHead.artHead{background-image: url(../images/default-artical.jpg);}
87
.madiaBlock .madiaHead.cmpHead{width: 50px;height:50px;margin-top:-25px;background:#FFFFFF;border-radius:0;}
94
.madiaBlock .madiaHead.cmpHead{background:#FFFFFF;border-radius:0;}
95
.madiaBlock .madiaHead.cmpHead .boxBlock{width: 90px;height: 60px;}
88 96
.madiaBlock .madiaHead.paperHead{background-image: url(../images/default-paper.jpg);}
89 97
.madiaBlock .madiaHead.patentHead{background-image: url(../images/default-patent.jpg);}
90
.madiaBlock .madiaInfo{padding-left:62px; width: 100%;margin:4px 0;overflow: hidden;}
98
.madiaBlock .madiaInfo{padding-left:62px; width: 100%;margin:6px 0;overflow: hidden;}
91 99
.madiaBlock .madiaInfo.OmadiaInfo{padding-left: 102px;}
92 100
.madiaBlock .flexCenter{min-height:64px;}
93
.madiaBlock .flexCenter.OflexCenter{min-height:70px;}
94
.madiaBlock .madiaInfo .h1Font{font-size: 16px;margin:0;line-height:28px;}
101
.madiaBlock .flexCenter>a{display: block;width: 100%;}
102
.madiaBlock .flexCenter>a .madiaInfo{width: auto;}
103
.madiaBlock .flexCenter.OflexCenter{min-height:72px;}
104
.madiaBlock .madiaInfo .h1Font{font-size: 16px;margin:0;line-height:24px;}
95 105
.madiaBlock .madiaInfo .ellipsisSty-2{max-height: 44px;}
106
/*点赞模块*/
107
.thumbBlock{text-align: center;margin:30px 0;}
108
.thumbBlock .thumbBtn{display:inline-block;position:relative;padding:10px 24px;padding-left:44px;font-size:16px;color:#fff;background:#ff9900;border-radius:30px;cursor: pointer;}
109
.thumbBlock .thumbBtn:before{position:absolute;content:url(../images/g_article_icon_dianzan_nor.png);top:50%;left:24px;margin-top:-9px;}
110
.thumbBlock .thumbBtn.thumbedBtn{background: #e0e0e0;}
111
/*留言*/
112
.madiaBlock .commentBlock li{padding:4px 0;}
113
.commentBlock .flexCenter{min-height:38px;}
114
.commentBlock .commenttime{margin-right:18px;}
115
.commentBlock .madiaHead.useHead{width: 40px;height:40px;margin-top:-20px;}/*小图像*/
116
.commentBlock .madiaInfo{padding-left:52px;width: auto;}
117
.commentBlock .operateSpan{margin:8px 0 0;color:#9d9ea8;font-size: 13px;color: #999;cursor: pointer;}
118
.commentBlock .madiaInfo .h2Font{ -webkit-user-select:text;word-break:break-word;}
96 119
/*资源轮播图片样式*/
97 120
#index-container {height:300px;background: #f0f0f0;position: relative;overflow: hidden;z-index: 1;}
98 121
#index-container .swiper-wrapper { position: relative;z-index: 1;
@ -157,7 +180,7 @@ ul.tagList>li .h2Font{color: #666;}
157 180
158 181
.mainbox{width:100%;margin:10px auto;background: #FFFFFF;}
159 182
/*专家相关信息*/
160
.infocontit{font-size:16px;line-height: 40px;min-height:40px;border-bottom: 1px solid #E5E5E5; position: relative;padding-left: 26px;color:#333}
183
.infocontit{font-size:16px;line-height: 40px;min-height:40px; position: relative;padding-left: 26px;color:#333}
161 184
.infocontit:before{position:absolute;top:50%;margin-top:-10px;left: 15px;;display:inline-block;content:"";width:4px;height:18px;border-radius:10px;background:#ff9900;}
162 185
.infocontit em{font-style: normal;position:absolute;right:28px;}
163 186
.infocontit em:before{border: solid transparent;border-left-color:#ccc;border-width: 7px;content: " ";position: absolute;left: 100%;top: 12px;}
@ -166,7 +189,7 @@ ul.tagList>li .h2Font{color: #666;}
166 189
.infocontitM{padding-left: 15px;}
167 190
.infocontitM:before{content: none;}
168 191
.OnetitM{border-color: transparent;}
169
.infocon{padding:15px; font-size: 14px;line-height:22px;color:#666;}
192
.infocon{padding:15px; font-size: 14px;line-height:22px;color:#666;border-top: 1px solid #E5E5E5;}
170 193
.infocon .breifinfo{display: -webkit-box;white-space: normal !important;text-overflow: ellipsis;word-wrap: break-word; -webkit-line-clamp:5;-webkit-box-orient: vertical;overflow: hidden;max-height: 110px;}
171 194
172 195
.infocon ul{ padding:0; margin: 0; overflow: hidden;}
@ -205,13 +228,14 @@ ul.tagList>li .h2Font{color: #666;}
205 228
206 229
207 230
/*下载按钮及公众二维码*/
208
.shareEcode{padding:25px 15px 15px;}
231
.shareEcode{padding:20px 6px;}
232
.Ecodecon{width: 100%;margin-bottom: 40px;}
209 233
.Ecodebox{border-radius:4px;box-shadow: 0 2px 10px #ccc;padding:20px 10px;}
210
.Ecodebox .Ecodecon{position: relative;min-height:100px;margin: auto;max-width: 300px;}
234
.Ecodebox .Ecodecon{position: relative;min-height:100px;margin: auto;max-width: 300px;}
211 235
.Ecodebox .Ecodecon img{position: absolute;left:0;top:50%;margin-top:-50px;width:100px;}
212
.Ecodebox .Ecodecon .codecon{padding-left:100px;text-align: center;}
213
.Ecodebox .Ecodecon .codecon h1{font-size: 18px;line-height:40px;font-weight:bold;color:#333;}
214
.Ecodebox .Ecodecon .codecon h2{font-size: 16px;line-height:30px;font-weight:normal;color:#333;}
236
.Ecodebox .Ecodecon .codecon{padding-left:100px;text-align: center;}
237
.Ecodebox .Ecodecon .codecon h1{font-size: 18px;line-height:40px;font-weight:bold;color:#333;}
238
.Ecodebox .Ecodecon .codecon h2{font-size: 16px;line-height:30px;font-weight:normal;color:#333;}
215 239
.Ecodebox .Ecodecon .codecon h3{font-size: 14px;line-height:28px;font-weight:normal;color:#666;}
216 240
217 241
/*专利论文邀请作者*/

+ 565 - 234
e/a.html

@ -1,260 +1,591 @@
1 1
<!DOCTYPE html>
2 2
<html>
3 3

4
	<head>
5
		<meta charset="UTF-8">
6
		<title>文章分享-科袖网</title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link rel="stylesheet" href="../css/reset.css" />
9
		<link rel="stylesheet" href="../css/common.css" />
10
		<link rel="stylesheet" href="../css/share.css" />
11
		<script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
12
		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
13
		<script type="text/javascript" src="../js/public/shareCom.js"></script>	
14
		<style>
15
			html,
16
			body {
17
				margin: 0;
18
				padding: 0px;
19
				background: #FFFFFF;
20
			}
21
		</style>
22
	</head>
4
<head>
5
<meta charset="UTF-8">
6
<title>文章分享-科袖网</title>
7
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
<link rel="stylesheet" href="../css/reset.css" />
9
<link rel="stylesheet" href="../css/common.css" />
10
<link rel="stylesheet" href="../css/share.css" />
11
<script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
12
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
13
<script type="text/javascript" src="../js/public/shareCom.js"></script>	
14
<style>
15
	html,body {background: #FFFFFF;}
16
</style>
17
</head>
23 18

24
	<body>
25
		<div class="contentBody2">
26
			<div class="showDetail">
27
				<div class="h1Font hWeight" id="articleName"></div>
28
				<div class="madiaBlock">
29
					<ul class="mui-table-view noactiveTab">
30
						<li class="mui-table-view-cell" id="personAL">
31
							<div class="flexCenter mui-clearfix">
32
								<div class="madiaHead useHead" id="messImg"></div>
33
								<div class="madiaInfo">
34
									<p><span class="h1Font" id="name"></span><em class="authiconNew" title="" id="auth"></em></p>
35
									<p class="h3Font" id="oTime"></p>
36
								</div>
19
<body>
20
<div class="contentBody2">
21
	<div class="topFu clearfix">
22
		<div class="topLogo floatL"></div>
23
		<div class="goSpan floatR">
24
			<span class="openSpan">打开</span>
25
		</div>
26
	</div>
27
	<div class="showDetail" style="padding-top:56px;">
28
		<div class="h1Font hWeight" id="articleName"></div>
29
		<div class="madiaBlock">
30
			<ul class="mui-table-view noactiveTab">
31
				<li>
32
					<div class="flexCenter clearfix">
33
						<a id="personAL">
34
							<div class="madiaHead useHead" id="messImg"></div>
35
							<div class="madiaInfo">
36
								<p><span class="h1Font ellipsisSty" style="display:inline-block;max-width:174px;" id="name"></span><em class="authiconNew" style="top:-6px" title="" id="auth"></em></p>
37
								<p class="h3Font" id="oTime"></p>
37 38
							</div>
38
						</li>
39
					</ul>
40
				</div>
41
				<!--文章内容区-->
42
				<div class="showMain" id="articleContent">
43
				</div>
44
				<!--标签模块-->
45
				<ul class="tagList displayNone">
46
					<!--<li>
47
						<span class="h2Font">金属材料工程与腐</span>
48
					</li>-->
49
				</ul>
50
			</div>
51
			<div class="shareEcode">
52
				<div class="Ecodebox">
53
					<div class="Ecodecon clearfix">
54
						<img src="../images/weixin_code.jpg" />
55
						<div class="codecon">
56
							<h1>「 科袖 」</h1>
57
							<h2>搭建企业与专家的桥梁</h2>
58
							<h3>长按识别科袖公众号</h3>
39
						</a>
40
						<div class="goSpan">
41
							<span class="attenSpan">关注</span>
59 42
						</div>
60 43
					</div>
61
				</div>
62
				<div style="margin:20px auto;">
63
					<a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app"><button class="frmbtn frmactive">下载移动客户端</button></a>
64
				</div>
65
			</div>
44
				</li>
45
			</ul>
46
		</div>
47
		<!--文章内容区-->
48
		<div class="showMain" id="articleContent">
49
		</div>
50
		<!--标签模块-->
51
		<ul class="tagList displayNone">
52
			<!--<li>
53
				<span class="h2Font">金属材料工程与腐</span>
54
			</li>-->
55
		</ul>
56
		<div class="madiaBlock displayNone" id="correlationExpert">
57
			<div class="madiaTit">相关专家</div>
58
			<ul class="mui-table-view" id="expertList">
59
		       
60
		    </ul>
61
		</div>
62
		<div class="madiaBlock displayNone" id="resource">
63
			<div class="madiaTit">相关资源</div>
64
			<ul class="mui-table-view" id="resourceList">
65
		        
66
		    </ul>
67
		</div>
68
		<div class="madiaBlock displayNone" id="correlationCompany">
69
			<div class="madiaTit">相关企业</div>
70
			<ul class="mui-table-view" id="companyList">
71
		       
72
		    </ul>
73
		</div>
74
		<!--点赞模块-->
75
		<div class="thumbBlock">
76
			<span class="thumbBtn"><span id="snum"></span></span><!-- thumbedBtn 已赞 201-->
77
		</div>
78
		<!--您可能感兴趣的文章-->
79
		<div class="madiaBlock displayNone" id="article">
80
			<div class="madiaTit">您可能感兴趣的文章</div>
81
			<ul class="mui-table-view" id="articleList">
82
		        
83
		    </ul>
84
		</div>
85
		<!--留言-->
86
		<div class="madiaBlock displayNone">
87
			<div class="madiaTit" id="olisten">留言</div>
88
			<ul class="mui-table-view commentBlock noactiveTab">
89
		     
90
		   </ul>
66 91
		</div>
92
	</div>
93
	<div class="shareEcode">
94
		<img class="Ecodecon" src="../images/ecordCard.jpg" />
95
	</div>
96
</div>
67 97

68
		<script type="text/javascript">
69
			$(document).ready(function() {
70
				var imgUrl ="";
71
				var lineLink = document.location.href;
72
				var descContent="";
73
				var shareTitle;
74
				var appid = '';
75
				var articleId = GetQueryString("id");
76
				$.ajax({
77
					"url" : "/ajax/article/pageViews",
78
					"type" :  "POST" ,
79
					"dataType" : "json",
80
					"data" :{"articleId":articleId},
81
					"success" : function(data) {
82
						console.log(data);
83
						if (data.success){
98
<script type="text/javascript">
99
	$(document).ready(function() {
100
		var imgUrl ="";
101
		var lineLink = document.location.href;
102
		var descContent="";
103
		var shareTitle;
104
		var appid = '';
105
		var articleId = GetQueryString("id");
106
		leword(500, 1);//liuyan
107
		
108
		//进入发布者详情页面
109
		$("#personAL").on("click", function() {
110
			var reType = this.getAttribute("data-type");
111
			if(reType=="1"){
112
				var proId=this.getAttribute("data-id");
113
				location.href="http://" + window.location.host + "/e/p.html?id=" + proId;
114
			}else{
115
				var cmpId=this.getAttribute("data-id");
116
				location.href="http://" + window.location.host + "/e/c.html?id=" + cmpId;
117
			}
118
		})
119
		$("body").on("click",".goSpan,.thumbBtn",function(){
120
			location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app";
121
			$(this).addClass("activeThis");
122
		})
123
		
124
		$("#articleList").on("click","li", function() {
125
			var OdataId=this.getAttribute("data-id");
126
			location.href="http://" + window.location.host + "/e/a.html?id=" + OdataId;
127
		})
128
		$("#resourceList").on("click","li", function() {
129
			var OdataId=this.getAttribute("data-id");
130
			location.href="http://" + window.location.host + "/e/r.html?id=" + OdataId;
131
		})
132
		$("#expertList").on("click","li", function() {
133
			var OdataId=this.getAttribute("data-id");
134
			location.href="http://" + window.location.host + "/e/p.html?id=" + OdataId;
135
		})
136
		$(".commentBlock").on("click","li>.flexCenter",function(){
137
			var OdataId=this.getAttribute("data-id");
138
			location.href="http://" + window.location.host + "/e/p.html?id=" + OdataId;
139
		})
140
		$("#companyList").on("click","li", function() {
141
			var OdataId=this.getAttribute("data-id");
142
			location.href="http://" + window.location.host + "/e/c.html?id=" + OdataId;
143
			
144
		})
145
		var oArticleModule = {
146
			articleId: GetQueryString("id"),
147
			oAjaxGet: function(url, obj, oType, oFun) {
148
				$.ajax(url,{
149
					data: obj,
150
					dataType: 'json', //服务器返回json格式数据
151
					type: oType, //HTTP请求类型
152
					timeout: 10000, //超时时间设置为10秒;
153
					traditional: true,
154
					success: function(data) {
155
						if(data.success) {
156
							oFun(data.data);
84 157
						}
85 158
					},
86
					"error":function(){
87
						//$.MsgBox.Alert('提示','链接服务器超时')
159
					error: function(e) {
160
						return;
88 161
					}
89 162
				});
90
				//进入发布者详情页面
91
				$("#personAL").on("click", function() {
92
					var reType = this.getAttribute("data-type");
93
					if(reType=="1"){
94
						var proId=this.getAttribute("data-id");
95
						location.href="http://" + window.location.host + "/e/p.html?id=" + proId;
163
			},
164
			articleMess: function($data) {
165
				console.log($data);
166
				document.getElementById("articleName").innerHTML = $data.articleTitle;
167
				shareTitle=$data.articleTitle;
168
				$("#oTime").text(commenTime($data.createTime))
169
				document.title=$data.articleTitle;
170
				stt = $data.articleImg.substring(0, 9);
171
				imgUrl="http://www.ekexiu.com/data/article/" + stt + $data.articleId + "_s.jpg";
172
				console.log(stt)
173
				if($data.articleContent) {
174
					document.getElementById("articleContent").innerHTML = $data.articleContent;
175
					
176
					descContent=document.getElementById("articleContent").innerText.substr(0,40);
177
				}
178
				if($data.subject) {
179
					document.getElementsByClassName("tagList")[0].style.display = "block";
180
					var arr = $data.subject.split(",");
181
					for(var i in arr) {
182
						var oLi = document.createElement("li");
183
						oLi.innerHTML = '<span class="h2Font">' + arr[i] + '</span>'
184
						document.getElementsByClassName("tagList")[0].appendChild(oLi);
185
					}
186
				}
187
				document.getElementById("snum").innerHTML = $data.articleAgree;
188
				document.getElementById("oTime").innerHTML = commenTime($data.publishTime);
189
				document.getElementById("personAL").setAttribute("data-type",$data.articleType);
190
				if($data.articleType == 1) {
191
					oArticleModule.oAjaxGet("../ajax/article/ralateArticles", {
192
						"keys": arr,
193
						"professorId": oArticleModule.oWner,
194
						"articleId": oArticleModule.articleId,
195
						"rows": 5
196
					}, "get", oArticleModule.correlationArticle);
197
					document.getElementById("personAL").setAttribute("data-id",$data.professorId);
198
					oArticleModule.oAjaxGet("../ajax/professor/editBaseInfo/" + $data.professorId, "", "get", oArticleModule.professorMess);
199
				} else {
200
					oArticleModule.oAjaxGet("../ajax/article/ralateArticles", {
201
						"keys": arr,
202
						"orgId": oArticleModule.oWner,
203
						"articleId": oArticleModule.articleId,
204
						"rows": 5
205
					}, "get", oArticleModule.correlationArticle);
206
					document.getElementById("personAL").setAttribute("data-id",$data.orgId);
207
					oArticleModule.oAjaxGet("../ajax/org/" + $data.orgId, "", "get", oArticleModule.business);
208
				}
209
				
210
			},
211
			professorMess: function($data) {
212
				console.log($data);
213
				document.getElementById('name').innerHTML = $data.name;
214
				if($data.hasHeadImage == 1) {
215
					document.getElementById("messImg").style.backgroundImage = "url(../images/head/" + $data.id + "_l.jpg" + ")";
216
				}
217
				var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
218
				document.getElementById("auth").classList.add(userType.sty);
219
				
220
			},
221
			business: function($data) {
222
				if($data.forShort) {
223
					document.getElementById('name').innerHTML = $data.forShort;
224
				}else{
225
					document.getElementById('name').innerHTML = $data.name;
226
				}
227
				var mgimg="../images/default-icon.jpg";
228
				if($data.hasOrgLogo) {
229
					mgimg="/images/org/" + $data.id + ".jpg";
230
				}
231
				document.getElementById("messImg").classList.add("cmpHead");
232
				document.getElementById("messImg").innerHTML='<div class="boxBlock" style="width:50px;height:50px;"><img class="boxBlockimg" id="companyImg" src="'+ mgimg+'"></div>'
233
				if($data.authStatus == 3) {
234
					document.getElementById("auth").classList.add("authicon-com-ok");
235
				}
236
			},
237
			correlationExpert: function($data) {
238
				if($data.length == 0) {
239
					return;
240
				}
241
				document.getElementById("correlationExpert").classList.remove("displayNone");
242
				for(var i = 0; i < $data.length; i++) {
243
					(function(n) {
244
						oArticleModule.oAjaxGet("../ajax/professor/editBaseInfo/" + $data[n].professorId, "", "get", oArticleModule.expertList);
245
					})(i)
246
	
247
				}
248
	
249
			},
250
			expertList: function($data) {
251
				var os = "";
252
				if($data.title) {
253
					if($data.orgName) {
254
						os = $data.title + "," + $data.orgName;
255
					} else {
256
						os = $data.title;
257
					}
258
				} else {
259
					if($data.office) {
260
						if($data.orgName) {
261
							os = $data.office + "," + $data.orgName;
262
						} else {
263
							os = $data.office;
264
						}
265
					} else {
266
						if($data.orgName) {
267
							os = $data.orgName;
268
						}
269
					}
270
				}
271
				var baImg = "../images/default-photo.jpg";
272
				if($data.hasHeadImage == 1) {
273
					baImg = "/images/head/" + $data.id + "_l.jpg";
274
				}
275
				var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
276
				var li = document.createElement("li");
277
				li.setAttribute("data-id", $data.id);
278
				li.innerHTML = '<div class="flexCenter clearfix">' +
279
					'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
280
					'<div class="madiaInfo">' +
281
					'<p><span class="h1Font">' + $data.name + '</span><em class="authiconNew ' + userType.sty + '"></em></p>' +
282
					'<p class="ellipsisSty h2Font">' + os + '</p>' +
283
					'</div>' +
284
					'</div>'
285
				document.getElementById("expertList").appendChild(li);
286
			},
287
			correlationResource: function($data) {
288
				console.log($data);
289
				if($data.length == 0) {
290
					return;
291
				}
292
				document.getElementById("resource").classList.remove("displayNone");
293
				for(var i = 0; i < $data.length; i++) {
294
					oArticleModule.oAjaxGet( "../ajax/resource/queryOne", {
295
						"resourceId": $data[i].resourceId
296
					}, "get", oArticleModule.rsourceList);
297
				}
298
	
299
			},
300
			rsourceList: function($data) {
301
				var namepo, userType;
302
				if($data.resourceType == 1) {
303
					namepo = $data.editProfessor.name;
304
					userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus);
305
				} else {
306
					userType = {};
307
					if($data.organization.forShort){
308
						namepo = $data.organization.forShort;
96 309
					}else{
97
						var cmpId=this.getAttribute("data-id");
98
						location.href="http://" + window.location.host + "/e/c.html?id=" + cmpId;
310
						namepo = $data.organization.name;
99 311
					}
100
						
101
				})
102
				var oArticleModule = {
103
					articleId: GetQueryString("id"),
104
					oAjaxGet: function(url, obj, oType, oFun) {
105
						$.ajax({
106
							url: url,
107
							data: obj,
108
							dataType: 'json', //服务器返回json格式数据
109
							type: oType, //HTTP请求类型
110
							timeout: 10000, //超时时间设置为10秒;
111
							traditional: true,
112
							success: function(data) {
113
								if(data.success) {
114
									oFun(data.data);
312
					if($data.organization.authStatus == 3) {
313
						userType.sty = "authicon-com-ok"
314
					} 
315
				}
316
				var rImg = "/data/resource/" + $data.images[0].imageSrc;
317
				var li = document.createElement("li");
318
				li.setAttribute("data-id", $data.resourceId);
319
				li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' +
320
					' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
321
					'<div class="madiaInfo OmadiaInfo">' +
322
					'<p class="ellipsisSty h1Font">' + $data.resourceName + '</p>' +
323
					'<p class="ellipsisSty h2Font">用途:' + $data.supportedServices + '</p>' +
324
					'<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' +
325
					'</div>' +
326
					'</div>'
327
				document.getElementById("resourceList").appendChild(li);
328
			},
329
			correlationArticle: function($data) {
330
	
331
				if($data.length == 0) {
332
					return;
333
				}
334
				document.getElementById('article').classList.remove("displayNone");
335
				for(var i = 0; i < 5; i++) {
336
					var ourl, of ;
337
					if($data[i].articleType == 1) {
338
						ourl = "/ajax/professor/editBaseInfo/" + $data[i].professorId; of = 1;
339
					} else {
340
						ourl = "/ajax/org/" + $data[i].orgId; of = 2;
341
					}
342
					var arImg = "../images/default-artical.jpg";
343
					if($data[i].articleImg) {
344
						arImg = "/data/article/" + $data[i].articleImg
345
					}
346
					var title = $data[i].articleTitle;
347
					$.ajax({
348
						url:ourl,
349
						dataType: 'json', //服务器返回json格式数据
350
						type: "get", //HTTP请求类型
351
						timeout: 10000, //超时时间设置为10秒;
352
						async: false,
353
						traditional: true,
354
						success: function(data) {
355
							if(data.success) {
356
								var namepo=""
357
								var li = document.createElement("li");
358
								if( of == 1) {
359
									namepo = data.data.name;
360
									var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
361
									li.setAttribute("owner-id", data.data.id);
362
									li.setAttribute("data-type", 1);
363
								} else {
364
									if(data.data.forShort){
365
										namepo = data.data.forShort;
366
									}else{
367
										namepo = data.data.name;
368
									}
369
									var userType = {};
370
									if(data.data.authStatus == 3) {
371
										userType.sty = 'authicon-com-ok'
372
									} else {
373
										userType.sty = "e"
374
									}
375
									li.setAttribute("owner-id", data.data.id);
376
									li.setAttribute("data-type", 2);
115 377
								}
116
							},
117
							error: function(e) {
118
								return;
378
								li.setAttribute("data-id", $data[i].articleId);
379
								li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' +
380
									'<div class="madiaHead artHead" style="background-image:url(' + arImg + ')"></div>' +
381
									'<div class="madiaInfo OmadiaInfo">' +
382
									'<p class="ellipsisSty-2 h1Font">' + title + '</p>' +
383
									'<p><span class="h2Font">' + namepo + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' +
384
									'</div>' +
385
									'</div>'
386
								document.getElementById("articleList").appendChild(li);
119 387
							}
120
						});
121
					},
122
					articleMess: function($data) {
123
						console.log($data);
124
						document.getElementById("articleName").innerHTML = $data.articleTitle;
125
						shareTitle=$data.articleTitle;
126
						$("#oTime").text(commenTime($data.createTime))
127
						document.title=$data.articleTitle;
128
						stt = $data.articleImg.substring(0, 9);
129
						imgUrl="http://www.ekexiu.com/data/article/" + stt + $data.articleId + "_s.jpg";
130
						console.log(stt)
131
						if($data.articleContent) {
132
							document.getElementById("articleContent").innerHTML = $data.articleContent;
133
							
134
							descContent=document.getElementById("articleContent").innerText.substr(0,40);
135
						}
136
						if($data.subject) {
137
							document.getElementsByClassName("tagList")[0].style.display = "block";
138
							var arr = $data.subject.split(",");
139
							for(var i in arr) {
140
								var oLi = document.createElement("li");
141
								oLi.innerHTML = '<span class="h2Font">' + arr[i] + '</span>'
142
								document.getElementsByClassName("tagList")[0].appendChild(oLi);
143
							}
144
						}
145
						document.getElementById("personAL").setAttribute("data-type",$data.articleType);
146
						if($data.articleType == 1) {
147
							document.getElementById("personAL").setAttribute("data-id",$data.professorId);
148
							oArticleModule.oAjaxGet("../ajax/professor/editBaseInfo/" + $data.professorId, "", "get", oArticleModule.professorMess);
149
						} else {
150
							document.getElementById("personAL").setAttribute("data-id",$data.orgId);
151
							oArticleModule.oAjaxGet("../ajax/org/" + $data.orgId, "", "get", oArticleModule.business);
388
						},
389
						error: function() {
152 390
						}
153
					},
154
					professorMess: function($data) {
155
						console.log($data);
156
						//document.getElementById('name').innerHTML = $data.name;
157
						$("#name").text($data.name);
158
						if($data.hasHeadImage == 1) {
159
							document.getElementById("messImg").style.backgroundImage = "url(../images/head/" + $data.id + "_l.jpg" + ")";
160
						}
161
						var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
162
						document.getElementById("auth").classList.add(userType.sty);
391
					});
392
				}
393
			},
394
			correlationCompany: function($data) {
395
				console.log($data);
396
				if($data.length == 0) {
397
					return;
398
				}
399
				document.getElementById("correlationCompany").classList.remove("displayNone");
400
				for(var i = 0; i < $data.length; i++) {
401
					oArticleModule.oAjaxGet( "../ajax/org/"+ $data[i].orgId, {
163 402
						
164
					},
165
					business: function($data) {
166
						//console.log(JSON.stringify($data));
167
						if($data.forShort) {
168
							document.getElementById('name').innerHTML = $data.forShort;
169
						}else{
170
							document.getElementById('name').innerHTML = $data.name;
171
						}
172
						var mgimg="../images/default-icon.jpg";
173
						if($data.hasOrgLogo) {
174
							mgimg="/images/org/" + $data.id + ".jpg";
403
					}, "get", oArticleModule.companyList);
404
				}
405
	
406
			},
407
			companyList: function($data) {
408
				var baImg = "../images/default-icon.jpg";
409
				if($data.hasHeadImage == 1) {
410
					baImg = "/images/org/" + $data.id + "_l.jpg";
411
				}
412
				var namepo,userType=""
413
				if($data.authStatus == 3){
414
					userType= "authicon-com-ok"
415
				}
416
				if($data.forShort){
417
					namepo = $data.forShort;
418
				}else{
419
					namepo = $data.name;
420
				}
421
				/*应用行业*/
422
				var proOther = "";
423
				if($data.industry) {
424
					proOther = $data.industry.replace(/,/gi, " | ");
425
				}
426
				var li = document.createElement("li");
427
				li.setAttribute("data-id", $data.id);
428
				li.innerHTML = '<div class="flexCenter OflexCenter clearfix">' +
429
					'<div class="madiaHead cmpHead">'+
430
						'<div class="boxBlock"><img class="boxBlockimg companyImg" id="oimg" src="'+ baImg +'"></div>'+
431
					'</div>' +
432
					'<div class="madiaInfo OmadiaInfo">' +
433
					'<p><span class="h1Font">' + namepo + '</span><em class="authiconNew ' + userType + '"></em></p>' +
434
					'<p class="ellipsisSty h2Font">' + proOther + '</p>' +
435
					'</div>' +
436
					'</div>'
437
				document.getElementById("companyList").appendChild(li);
438
			}
439
			
440
		}
441
		/*文章详细内容*/
442
		oArticleModule.oAjaxGet("../ajax/article/query", {
443
			articleId: oArticleModule.articleId
444
		}, "get", oArticleModule.articleMess);
445
		oArticleModule.oAjaxGet("../ajax/article/ralatePro", {
446
			"articleId": oArticleModule.articleId
447
		}, "get", oArticleModule.correlationExpert);
448
		oArticleModule.oAjaxGet("../ajax/article/ralateRes", {
449
			"articleId": oArticleModule.articleId
450
		}, "get", oArticleModule.correlationResource);
451
		oArticleModule.oAjaxGet("../ajax/article/ralateOrg", {
452
			"articleId": oArticleModule.articleId
453
		}, "get", oArticleModule.correlationCompany);
454
		
455
		//留言
456
		function leword(row, aa){
457
			$.ajax({
458
				url:"../ajax/leaveWord/ql",
459
				data: {
460
					"articleId":articleId,
461
					"rows":row	},
462
				dataType: 'json', //服务器返回json格式数据
463
				type: 'get', //HTTP请求类型
464
				timeout: 10000, //超时时间设置为10秒;
465
				traditional: true,
466
				success: function(data) {
467
					if(data.success) {
468
						console.log(data)
469
						document.getElementsByClassName('commentBlock')[0].innerHTML = ""
470
						if(data.data.length == 0) {
471
							return;
175 472
						}
176
						document.getElementById("messImg").classList.add("cmpHead");
177
						document.getElementById("messImg").innerHTML='<div class="boxBlock" style="width:50px;height:50px;"><img class="boxBlockimg" id="companyImg" src="'+ mgimg+'"></div>'
178
						if($data.authStatus == 3) {
179
							document.getElementById("auth").classList.add("authicon-com-ok");
473
						document.getElementById("olisten").parentNode.classList.remove("displayNone");
474
						for(var i = 0; i < data.data.length; i++) {
475
							var oText = ""
476
							var userType = autho(data.data[i].professor.authType, data.data[i].professor.orgAuth, data.data[i].professor.authStatus);
477
							var baImg = "../images/default-photo.jpg";
478
							if(data.data[i].professor.hasHeadImage == 1) {
479
								baImg = "/images/head/" + data.data[i].professor.id + "_l.jpg";
480
							}
481
							var li = document.createElement("li");
482
							li.innerHTML = '<div class="flexCenter clearfix" data-id="' + data.data[i].professor.id + '">' +
483
								'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
484
								'<div class="madiaInfo">' +
485
								'<p><span class="h1Font" data-id="' + data.data[i].professor.id + '">' + data.data[i].professor.name + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>' +
486
								'</div>' +
487
								'</div>' +
488
								'<div class="madiaInfo">' +
489
								'<p class="h2Font">' + data.data[i].content + '</p>' +
490
								'<p class="operateSpan">' +
491
								'<span class="commenttime">' + commenTime(data.data[i].createTime) + '</span>' +
492
//								'<span data-id="' + data.data[i].id + '" class="dele">' + oText + '</span>' +
493
								'</p>' +
494
								'</div>'
495
							document.getElementsByClassName("commentBlock")[0].appendChild(li);
180 496
						}
497
	
181 498
					}
499
				},
500
				error: function() {
182 501
				}
183
				/*文章详细内容*/
184
				oArticleModule.oAjaxGet("../ajax/article/query", {
185
					articleId: oArticleModule.articleId
186
				}, "get", oArticleModule.articleMess);
187
				
188
				/*微信分享*/
189
				$.ajax({
190
					url: "../ajax/weixin/jsapiTicket",
191
					type: 'get',
192
					dataType: 'json',
193
					contentType: "application/x-www-form-urlencoded; charset=utf-8",
194
					data: {
195
						'url': location.href.split('#')[0]
196
					},
197
					success: function(data) {
198
						if(data.data) {
199
							wx.config({
200
								debug: false, //调试模式好犀利
201
								appId: data.data.appId,
202
								timestamp: data.data.timestamp,
203
								nonceStr: data.data.nonceStr,
204
								signature: data.data.signature,
205
								jsApiList: [ // 所有要调用的 API 都要加到这个列表中
206
									"onMenuShareAppMessage",
207
									"onMenuShareTimeline",
208
									"onMenuShareQQ",
209
									"onMenuShareQZone",
210
									"scanQRCode",
211
								]
212
							});
213
							wx.ready(function() {
214
								// 在这里调用 API
215
								wx.onMenuShareAppMessage({ //分享给朋友
216
									title: shareTitle, // 分享标题
217
									desc: descContent, // 分享描述
218
									link: lineLink, // 分享链接
219
									imgUrl: imgUrl, // 分享图标
220
									success: share_success_callback,
221
									cancel: share_cancel_callback
222
								});
223
								wx.onMenuShareTimeline({ //分享到朋友圈
224
									title: shareTitle, // 分享标题
225
									desc: descContent, // 分享描述
226
									link: lineLink, // 分享链接
227
									imgUrl: imgUrl, // 分享图标
228
									success: share_success_callback,
229
									cancel: share_cancel_callback
230
								});
231
								wx.onMenuShareQQ({ //分享到QQ
232
									title: shareTitle, // 分享标题
233
									desc: descContent, // 分享描述
234
									link: lineLink, // 分享链接
235
									imgUrl: imgUrl, // 分享图标
236
									success: share_success_callback,
237
									cancel: share_cancel_callback
238
								});
239
								wx.onMenuShareQZone({ //分享到QQ空间
240
									title: shareTitle, // 分享标题
241
									desc: descContent, // 分享描述
242
									link: lineLink, // 分享链接
243
									imgUrl: imgUrl, // 分享图标
244
									success: share_success_callback,
245
									cancel: share_cancel_callback
246
								});
247
							});
248
							//分享成功后的回调函数	
249
							function share_success_callback() {}
250
							//用户取消分享后执行的回调函数	
251
							function share_cancel_callback() {}
252
			    		}
253
					}
254
				});
255
			})
256
		</script>
502
			});
503
		}
504
		//浏览量
505
		$.ajax({
506
			"url" : "../ajax/article/pageViews",
507
			"type" :  "POST" ,
508
			"dataType" : "json",
509
			"data" :{"articleId":articleId},
510
			"success" : function(data) {
511
				if (data.success){
512
					console.log(data);
513
				}
514
			},
515
			"error":function(){
516
			}
517
		});
518
		
519
		/*微信分享*/
520
		$.ajax({
521
			url: "../ajax/weixin/jsapiTicket",
522
			type: 'get',
523
			dataType: 'json',
524
			contentType: "application/x-www-form-urlencoded; charset=utf-8",
525
			data: {
526
				'url': location.href.split('#')[0]
527
			},
528
			success: function(data) {
529
				if(data.data) {
530
					wx.config({
531
						debug: false, //调试模式好犀利
532
						appId: data.data.appId,
533
						timestamp: data.data.timestamp,
534
						nonceStr: data.data.nonceStr,
535
						signature: data.data.signature,
536
						jsApiList: [ // 所有要调用的 API 都要加到这个列表中
537
							"onMenuShareAppMessage",
538
							"onMenuShareTimeline",
539
							"onMenuShareQQ",
540
							"onMenuShareQZone",
541
							"scanQRCode",
542
						]
543
					});
544
					wx.ready(function() {
545
						// 在这里调用 API
546
						wx.onMenuShareAppMessage({ //分享给朋友
547
							title: shareTitle, // 分享标题
548
							desc: descContent, // 分享描述
549
							link: lineLink, // 分享链接
550
							imgUrl: imgUrl, // 分享图标
551
							success: share_success_callback,
552
							cancel: share_cancel_callback
553
						});
554
						wx.onMenuShareTimeline({ //分享到朋友圈
555
							title: shareTitle, // 分享标题
556
							desc: descContent, // 分享描述
557
							link: lineLink, // 分享链接
558
							imgUrl: imgUrl, // 分享图标
559
							success: share_success_callback,
560
							cancel: share_cancel_callback
561
						});
562
						wx.onMenuShareQQ({ //分享到QQ
563
							title: shareTitle, // 分享标题
564
							desc: descContent, // 分享描述
565
							link: lineLink, // 分享链接
566
							imgUrl: imgUrl, // 分享图标
567
							success: share_success_callback,
568
							cancel: share_cancel_callback
569
						});
570
						wx.onMenuShareQZone({ //分享到QQ空间
571
							title: shareTitle, // 分享标题
572
							desc: descContent, // 分享描述
573
							link: lineLink, // 分享链接
574
							imgUrl: imgUrl, // 分享图标
575
							success: share_success_callback,
576
							cancel: share_cancel_callback
577
						});
578
					});
579
					//分享成功后的回调函数	
580
					function share_success_callback() {}
581
					//用户取消分享后执行的回调函数	
582
					function share_cancel_callback() {}
583
	    		}
584
			}
585
		});
586
	})
587
</script>
257 588

258
	</body>
589
</body>
259 590

260 591
</html>

+ 237 - 55
e/r.html

@ -28,65 +28,76 @@
28 28
		    </div> 
29 29
		</div> 
30 30
	    <div class="showDetail">
31
	    		<div class="h1Font hWeight" id="resourceName"></div>
32
	    		<div class="showFont" id="application"></div>
33
	    		<div class="madiaBlock">
34
	    			<ul class="mui-table-view noactiveTab infoBlock">
35
				        <li class="mui-table-view-cell">
36
				            <div class="flexCenter mui-clearfix" id="thisInfo">
37
				                <div class="madiaHead" id="thisPic"></div>
31
    		<div class="h1Font hWeight" id="resourceName"></div>
32
    		<div class="showFont" id="application"></div>
33
    		<div class="madiaBlock">
34
    			<ul class="mui-table-view noactiveTab infoBlock">
35
			        <li class="mui-table-view-cell">
36
			            <div class="flexCenter mui-clearfix">
37
			            	<a id="thisInfo">
38
			            		<div class="madiaHead" id="thisPic"></div>
38 39
								<div class="madiaInfo">
39 40
									<p><span class="h1Font ellipsisSty" id="thisName"></span><em class="authiconNew" title="" id="authFlag"></em></p>
40 41
									<p class="h3Font ellipsisSty" id="thisOther"></p>
41 42
								</div>
42
				            </div>
43
				        </li>
44
				    </ul>
45
	    		</div>
46
		    	<!--内容区-->
47
				<div class="showMain showRes">
48
					<ul>
49
						<li>
50
							<div class="showTit">所属机构</div>
51
							<div class="showCon" id="resorceOrg"></div>
52
						</li>
53
						<li>
54
							<div class="showTit">厂商型号</div>
55
							<div class="showCon" id="modelNumber"></div>
56
						</li>
57
						<li>
58
							<div class="showTit">性能参数</div>
59
							<div class="showCon" id="performancePa"></div>
60
						</li>
61
						<li>
62
							<div class="showTit">合作备注</div>
63
							<div class="showCon" id="remarkContent"></div>
64
						</li>
65
						<li>
66
							<div class="showTit">详细介绍</div>
67
							<div class="showCon" id="detailDescp"></div>
68
						</li>
69
					</ul>
70
				</div>
71
	    		<!--标签模块-->
72
				<ul class="tagList">
73
					<!--<li>
74
						<span class="h2Font"></span>
75
					</li>-->
43
			            	</a>
44
			                <div class="goSpan">
45
								<span class="attenSpan">关注</span>
46
							</div>
47
			            </div>
48
			            
49
			        </li>
50
			    </ul>
51
    		</div>
52
	    	<!--内容区-->
53
			<div class="showMain showRes">
54
				<ul>
55
					<li>
56
						<div class="showTit">所属机构</div>
57
						<div class="showCon" id="resorceOrg"></div>
58
					</li>
59
					<li>
60
						<div class="showTit">厂商型号</div>
61
						<div class="showCon" id="modelNumber"></div>
62
					</li>
63
					<li>
64
						<div class="showTit">性能参数</div>
65
						<div class="showCon" id="performancePa"></div>
66
					</li>
67
					<li>
68
						<div class="showTit">合作备注</div>
69
						<div class="showCon" id="remarkContent"></div>
70
					</li>
71
					<li>
72
						<div class="showTit">详细介绍</div>
73
						<div class="showCon" id="detailDescp"></div>
74
					</li>
76 75
				</ul>
76
			</div>
77
    		<!--标签模块-->
78
			<ul class="tagList">
79
				<!--<li>
80
					<span class="h2Font"></span>
81
				</li>-->
82
			</ul>
83
			<!--相关文章-->
84
			<div class="madiaBlock displayNone">
85
				<div class="madiaTit">相关文章</div>
86
				<ul class="mui-table-view" id="oArticle">
87
			        
88
			    </ul>
89
			</div>
90
			<!--您可能感兴趣的资源-->
91
			<div class="madiaBlock displayNone">
92
				<div class="madiaTit">您可能感兴趣的资源</div>
93
				<ul class="mui-table-view" id="resourceList">
94
			        
95
			    </ul>
96
			</div>
77 97
	    </div>
78 98
	    <div class="shareEcode">
79
	    	<div class="Ecodebox">
80
				<div class="Ecodecon clearfix">
81
					<img src="../images/weixin_code.jpg" />
82
					<div class="codecon">
83
						<h1>「 科袖 」</h1>
84
						<h2>搭建企业与专家的桥梁</h2>
85
						<h3>长按识别科袖公众号</h3>
86
					</div>
87
				</div>
88
			</div>
89
			<div style="margin:20px auto;">
99
			<img class="Ecodecon" src="../images/ecordCard.jpg" />
100
			<div style="margin:-50px 10px 20px;">
90 101
				<a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app"><button class="frmbtn frmactive">下载移动客户端</button></a>
91 102
			</div>
92 103
	    </div>
@ -143,7 +154,10 @@ $(document).ready(function() {
143 154
		}
144 155
			
145 156
	})
146
	
157
	$("body").on("click",".goSpan",function(){
158
		location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app";
159
		$(this).addClass("activeThis");
160
	})
147 161
	function getRecourceMe() {
148 162
		$.ajax({
149 163
			url:'../ajax/resource/queryOne',
@ -236,12 +250,19 @@ $(document).ready(function() {
236 250
					}
237 251
					if(mydata.subject) {
238 252
						var oSub = mydata.subject.split(",");
253
						if(mydata.resourceType==1) {
254
							interestingResources(oSub,mydata.professorId,0);
255
						}else{
256
							interestingResources(oSub,mydata.orgId,1);
257
						}
239 258
						var oSt = "";
240 259
						for(var i = 0; i < oSub.length; i++) {
241
							oSt += '<li><span class="h2Font">' + oSub[i] + '</span></li>'
260
							oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
242 261
						}
243 262
						$(".tagList").html(oSt);
244
					} 
263
					}else{
264
						$("#resourceList").parents(".otherShow").addClass("displayNone")
265
					}
245 266
					console.log(mydata.images.length)
246 267
					if(mydata.images.length!=0) {
247 268
						imgUrl="http://www.ekexiu.com/data/resource/" + mydata.images[0].imageSrc.replace(/.jpg/,"_s.jpg");
@ -269,6 +290,167 @@ $(document).ready(function() {
269 290
			}
270 291
		});
271 292
	}
293
	/*资源里面相关文章*/
294
	function relatedArticles() {
295
		$.ajax({
296
			"url": "../ajax/resource/articles",
297
			"type": "GET",
298
			"success": function(data) {
299
				console.log(data);
300
				if(data.success) {
301
					if(data.data.length == 0) {
302
						return;
303
					}
304
					$("#oArticle").parent().removeClass("displayNone");
305
					relatedArticlesHtml(data.data);
306
				}
307
			},
308
			"data": {
309
				"resourceId": resourceId,
310
				"rows": 5
311
			},
312
			dataType: "json",
313
			'error': function() {
314
				$.MsgBox.Alert('提示', '服务器连接超时!');
315
			}
316
		});
317
	}
318
	relatedArticles();
319
	/*资源相关文章html*/
320
	function relatedArticlesHtml($html) {
321
		for(var i = 0; i < $html.length; i++) {
322
			(function(n) {
323
				var oURL;
324
				if($html[i].article.articleType==1) {
325
					oURL="../ajax/professor/baseInfo/" + $html[i].article.professorId;
326
				}else{
327
					oURL="../ajax/org/" + $html[i].article.orgId;
328
				}
329
				$.ajax({
330
					"url":oURL,
331
					"type": "GET",
332
					"success": function(data) {
333
						if(data.success) {
334
							var cmpname="";
335
							if(data.data.forShort){
336
								cmpname=data.data.forShort;
337
							}else{
338
								cmpname=data.data.name;
339
							}
340
							if($html[n].article.articleType==1) {
341
								var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
342
							}else {
343
								var stl={};
344
								stl.sty="";
345
								stl.title="";
346
								if(data.data.authStatus==3) {
347
									stl.sty="authicon-com-ok";
348
									stl.title="认证企业";
349
								}
350
							}
351
							var str = ""
352
							str += '<li class="flexCenter OflexCenter" data-id="' + $html[n].article.articleId + '">'
353
							if($html[n].article.articleImg) {
354
								str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].article.articleImg + ')"></div>'
355
							} else {
356
								str += '<div class="madiaHead artHead"></div>'
357
							}
358
							str += '<div class="madiaInfo OmadiaInfo">'
359
							str += '<p class="h1Font ellipsisSty">' + $html[n].article.articleTitle + '</p>'
360
							str += '<p><span class="h2Font">' + cmpname + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
361
							str += '</div></li>'
362
							$("#oArticle").append(str);
363
						}
364
					},
365
					'dataType': "json",
366
					'error': function() {
367
						$.MsgBox.Alert('提示', '服务器连接超时!');
368
					}
369
				});
370
			})(i);
371
372
		}
373
	}
374
	/*文章跳转*/
375
	$("#oArticle").on("click", "li", function() {
376
		location.href="http://" + window.location.host + "/e/a.html?id=" + $(this).attr("data-id");
377
	})
378
	/*感兴趣的资源*/
379
	function interestingResources(arry,oId,oNu) {
380
		var oUrl;
381
		var $in={};
382
		$in.keys= arry;
383
		$in.resourceId= resourceId;
384
		
385
		if(oNu==0) {
386
				$in.professorId= oId;
387
				oUrl="../ajax/resource/ralateRes";
388
		}else {
389
			$in.orgId= oId;
390
			oUrl="../ajax/resource/orgRalateRes";
391
		}
392
		$.ajax({
393
			"url": oUrl,
394
			"type": "GET",
395
			"success": function(data) {
396
				console.log(data);
397
				if(data.success) {
398
					if(data.data.length == 0) {
399
						return;
400
					}
401
					$("#resourceList").parent().removeClass("displayNone");
402
					interestingResourcesHtml(data.data);
403
				}
404
			},
405
			"data":$in,
406
			"traditional": true,
407
			dataType: "json",
408
			'error': function() {
409
				$.MsgBox.Alert('提示', '服务器连接超时!');
410
			}
411
		});
412
	}
413
	/*感兴趣资源的html*/
414
	function interestingResourcesHtml($respond) {
415
		for(var i = 0; i < 5; i++) {
416
			if($respond[i].organization) {
417
				var stl={};
418
				stl.sty="";
419
				stl.title="";
420
				if($respond[i].organization.authStatus==3) {
421
					stl.sty="authicon-com-ok";
422
					stl.title="认证企业";
423
				}
424
				var name="";
425
				if($respond[i].organization.forShort){
426
					name=$respond[i].organization.forShort;
427
				}else{
428
					name=$respond[i].organization.name;
429
				}
430
			}else {
431
				var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
432
				var name= $respond[i].editProfessor.name;
433
			}
434
			
435
			var oStr = '';
436
			oStr+='<li class="flexCenter OflexCenter" style="" data-id="' + $respond[i].resourceId + '">'
437
			if($respond[i].images.length) {
438
				oStr += '<div class="madiaHead resouseHead" style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
439
			} else {
440
				oStr += '<div class="madiaHead resouseHead"></div>'
441
			}
442
			oStr += '<div class="madiaInfo OmadiaInfo">'
443
			oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
444
			oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
445
			oStr += '<p><span class="h2Font">' + name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
446
			oStr += '</div></li>'
447
			$("#resourceList").append(oStr);
448
		}
449
	}
450
	/*点击资源列表*/
451
	$("#resourceList").on("click", "li", function() {
452
		location.href="http://" + window.location.host + "/e/r.html?id=" + $(this).attr("data-id");
453
	})
272 454
273 455
	 /*微信分享*/
274 456
	$.ajax({

BIN
images/ecordCard.jpg