Browse Source

资源的相关文章和感兴趣的

luyanan 7 years ago
parent
commit
cc8b36e7f9
12 changed files with 315 additions and 306 deletions
  1. 5 13
      css/genindex.css
  2. 8 11
      css/share.css
  3. 1 1
      e/a.html
  4. 6 9
      e/c.html
  5. 2 2
      e/p.html
  6. 157 145
      e/r.html
  7. BIN
      images/g_article_icon_dianzan_nor.png
  8. BIN
      images/g_article_icon_jia_nor.png
  9. 1 1
      js/common.js
  10. 131 120
      js/resourceShow.js
  11. 1 1
      js/searchNew.js
  12. 3 3
      resourceShow.html

+ 5 - 13
css/genindex.css

@ -355,14 +355,9 @@ ul.tagList>li .h2Font{color:#666}
355 355
.form-item.otherShow .aboutRes .madiaInfo{padding-left:130px;margin:4px 0;}
356 356
/*点赞模块*/
357 357
.thumbBlock{text-align: center;margin:30px 0;}
358
.thumbBlock .thumbBtn{display:inline-block;position:relative;padding:10px 24px;padding-left:44px;font-size:16px;color:#fff;background:#ff9900;border-radius:30px;
359
      box-shadow: 1px 2px 13px 0px rgba(255, 153, 0, 0.6);
360
    -webkit-box-shadow: 1px 2px 13px 0px rgba(255, 153, 0, 0.6);cursor: pointer;}
361
.thumbBlock .thumbBtn:before{position:absolute;content:url(../images/g_article_icon_dianzan_nor.png);top:50%;left:24px;margin-top:-9px;}
362
.thumbBlock .thumbBtn:hover{background: #ff9000;}
363
.thumbBlock .thumbBtn.thumbedBtn{background: #e0e0e0;box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.2);
364
    -webkit-box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.2);}
365
.thumbBlock .thumbBtn.thumbedBtn:hover{background: #e0e0e0;}
358
.thumbBlock .thumbBtn{display:inline-block;position:relative;padding:10px 24px;padding-left:44px;font-size:16px;color:#fff;background:url(../images/g_article_icon_dianzan_nor.png) no-repeat 24px center;background-size:16px 16px;background-color:#ff9900;border-radius:30px;cursor: pointer;opacity: .9;}
359
.thumbBlock .thumbBtn:hover{opacity: 1;}
360
.thumbBlock .thumbBtn.thumbedBtn{background-color: #e0e0e0;opacity: 1;}
366 361
/*分享操作栏*/
367 362
.shareBlock{background:rgba(60,62,81,.5);margin:0 -30px;padding:14px 30px;}
368 363
.shareInfo .madiaHead{border-color:#999}
@ -423,10 +418,8 @@ ul.tagList>li .h2Font{color:#666}
423 418
.rightconBox .conItem.conItemG .h2Font{font-size:14px;color:#666;line-height:26px;}
424 419
.rightconBox .conItem.conItemG .h3Font>a{color:#333}
425 420
.goSpan span{background: #ff9900;display:inline-block;text-align: center;width:84px;cursor:pointer;color:#fff;font-size:16px;margin:20px 4px 0;border-radius:4px;padding:7px 16px;}
426
.goSpan .attenSpan{position: relative;padding-left:34px;}
427
.goSpan .attenSpan:before{position:absolute;content:url(../images/g_article_icon_jia_nor.png);top:50%;left:18px;margin-top:-10px;}
421
.goSpan .attenSpan{position: relative;padding-left:34px;background-image:url(../images/g_article_icon_jia_nor.png);background-size:12px 12px;background-position: 18px center;background-repeat: no-repeat;}
428 422
.goSpan .attenedSpan{background:#ccc;padding-left:16px;}
429
.goSpan .attenedSpan:before{content:"";}
430 423
.goSpan .consultSpan{}
431 424
432 425
/*文章列表*/
@ -758,8 +751,7 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
758 751
.aboutPa .form-result>ul>li .shareCode{left:-8px;z-index:2;}
759 752
.aboutPa ul>li .goSpan{position: absolute; right: 20px;top: 50%;margin-top: -15px;cursor: pointer;}
760 753
.aboutPa ul>li .goSpan span{width:auto;padding:2px 8px;line-height: 26px;font-size: 14px;margin:0;min-width: 56px;}
761
.aboutPa ul>li .goSpan .attenSpan{padding-left: 20px;}
762
.aboutPa ul>li .goSpan .attenSpan:before{margin-top:-12px;left:6px;}
754
.aboutPa ul>li .goSpan .attenSpan{padding-left: 20px;background-position: 8px center;background-size:10px 10px}
763 755
.aboutPa ul>li .goSpan .attenedSpan{padding-left:6px}
764 756
.aboutPa ul>li.lastBtn{position:absolute;right:7px;bottom:0;line-height:34px;text-align: center;cursor: pointer;}
765 757
.aboutPa ul>li.pointThis{cursor: pointer;}

+ 8 - 11
css/share.css

@ -66,10 +66,8 @@ html,body {outline: 0;margin:0;padding:0px;background: #efeff4;-webkit-text-size
66 66
.topFu{background: rgba(0,0,0,.6);padding:10px 15px;position: fixed;right:0;left:0;z-index:200;}
67 67
.topLogo{width:60px;height:30px;background: url(../images/home_icon_logo_orange.png);background-size: cover;}
68 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;}
69
.goSpan .attenSpan{position: relative;padding-left: 14px;background-image:url(../images/g_article_icon_jia_nor.png);background-size:12px 12px;background-position: 8px center;background-repeat: no-repeat;}
71 70
.goSpan .attenedSpan{background:#ccc;padding-left:16px;}
72
.goSpan .attenedSpan:before{content:"";}
73 71
.showDetail{padding:15px;padding-top:10px;}
74 72
.showDetail .hWeight{font-weight:bold;}
75 73
.showDetail .h1Font{font-size:20px;margin:8px 0;line-height:30px;color:#333;}
@ -105,8 +103,7 @@ ul.tagList>li .h2Font{color: #666;}
105 103
.madiaBlock .madiaInfo .ellipsisSty-2{max-height: 44px;}
106 104
/*点赞模块*/
107 105
.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;}
106
.thumbBlock .thumbBtn{display:inline-block;position:relative;padding:10px 24px;padding-left:44px;font-size:16px;color:#fff;background:url(../images/g_article_icon_dianzan_nor.png) no-repeat 24px center;background-size:16px 16px;background-color:#ff9900;border-radius:30px;cursor: pointer;}
110 107
.thumbBlock .thumbBtn.thumbedBtn{background: #e0e0e0;}
111 108
/*留言*/
112 109
.madiaBlock .commentBlock li{padding:4px 0;}
@ -168,10 +165,10 @@ ul.tagList>li .h2Font{color: #666;}
168 165
.showCardI{overflow:hidden;background: url(../images/personal_img_bg_nor@3x.png) center 0 no-repeat;background-size:100% 130px;}
169 166
.cardTop{position:relative;text-align:center;min-height:140px;margin:15px 15px 6px;padding:40px 40px 20px;
170 167
		background: rgba(256,256,256,.6);background: linear-gradient( rgba(256,256,256,.6), rgba(256,256,256,.9));border-radius:6px;box-shadow: 0px 2px 4px 1px rgba(0,0,0,.1);}
171
.cardImg{position: absolute;left:50%;margin-left: -30px;width: 60px;height: 60px;overflow: hidden;background-size: cover;border:1px solid #E5E5E5;}
168
.cardImg{position: absolute;margin-top:-15px;left:50%;margin-left: -40px;width:80px;height: 80px;overflow: hidden;background-size: cover;/*border:1px solid #E5E5E5;*/background-color: #fff;}
172 169
.cardImg.userCard{background-image:url(../images/default-photo.jpg);border-radius: 50%;}
173
.cardImg.cmpCard{border-radius:4px;}
174
.cardImg.cmpCard .boxBlock{width: 60px;height: 60px;}
170
.cardImg.cmpCard{border-radius:4px;width:120px;margin-left: -60px;background: #fff;}
171
.cardImg.cmpCard .boxBlock{width:120px;height: 80px;}
175 172
.cardInfo{margin-top:82px;}
176 173
.cardInfo .h1Font{font-size:16px;}
177 174
.cardInfo .h2Font{font-size:14px;color: #666;}
@ -194,9 +191,9 @@ ul.tagList>li .h2Font{color: #666;}
194 191
195 192
.infocon ul{ padding:0; margin: 0; overflow: hidden;}
196 193
.infocon ul>li{list-style: none;}
197
.infocon>ul.mui-table-view>.mui-table-view-cell{position: relative;overflow: hidden; padding: 11px 15px;}
198
.infocon>ul.mui-table-view>.mui-table-view-cell:after{position: absolute;right: 0;bottom: 0;left:15px;height: 1px;content: '';-webkit-transform: scaleY(.5);transform: scaleY(.5); background-color: #c8c7cc;}
199
.infocon>ul.mui-table-view>.mui-table-view-cell:last-child:after{background: none;}
194
.infocon>ul.mui-table-view>li{position: relative;overflow: hidden; padding: 11px 15px;}
195
.infocon>ul.mui-table-view>li:after{position: absolute;right: 0;bottom: 0;left:15px;height: 1px;content: '';-webkit-transform: scaleY(.5);transform: scaleY(.5); background-color: #c8c7cc;}
196
.infocon>ul.mui-table-view>li:last-child:after{background: none;}
200 197
.infocon.listArea>ul{overflow: hidden;margin-right: -10px;margin-top:-10px;}
201 198
.infocon.listArea>ul>li{float: left;margin-right: 10px;margin-top:10px;border:1px solid #E5E5E5;border-radius:6px;padding:2px 12px;}
202 199
.infocon.madiaBlock>ul{margin:-15px;}

+ 1 - 1
e/a.html

@ -33,7 +33,7 @@
33 33
						<a id="personAL">
34 34
							<div class="madiaHead useHead" id="messImg"></div>
35 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>
36
								<p><span class="h1Font ellipsisSty" id="name"></span><em class="authiconNew" title="" id="auth"></em></p>
37 37
								<p class="h3Font" id="oTime"></p>
38 38
							</div>
39 39
						</a>

+ 6 - 9
e/c.html

@ -118,7 +118,7 @@ $(document).ready(function() {
118 118
	$("body").on("click",".seeMore,#goCmpBrief",function(){
119 119
		location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app";
120 120
	})
121
	$('#articelShow').on('click', 'li', function() {
121
	$('#articelShow,#relateArt').on('click', 'li', function() {
122 122
		var id = this.getAttribute("data-id");
123 123
		location.href="http://" + window.location.host + "/e/a.html?id=" + id;
124 124
	})
@ -268,9 +268,10 @@ $(document).ready(function() {
268 268
						}
269 269
						for(var i = 0; i < obj.length; i++) {
270 270
							var liItem = document.createElement("li");
271
							liItem.className = "mui-table-view-cell"
271 272
							liItem.setAttribute("data-id",obj[i].articleId);
272 273
							liItem.setAttribute("owner-id",obj[i].orgId);
273
							liItem.className = "mui-table-view-cell"
274
							
274 275
							var oString = '<div class="flexCenter OflexCenter clearfix">'
275 276
							if(obj[i].articleImg) {
276 277
								oString += '<div class="madiaHead artHead" style="background-image:url(../data/article/' + obj[i].articleImg + ')"></div>'
@ -435,11 +436,11 @@ $(document).ready(function() {
435 436
						thisAuth="authicon-com-ok"
436 437
						thisTitle="科袖认证企业"
437 438
					}
438
					var itemlist = '<div class="flexCenter OflexCenter clearfix"><div class="madiaHead cmpHead"><div class="boxBlock"><img class="boxBlockimg" src="'+imgL+'" /></div></div>';
439
					var itemlist = '<a href="c.html?id='+data.data.id+'" class="flexCenter OflexCenter clearfix"><div class="madiaHead cmpHead"><div class="boxBlock"><img class="boxBlockimg" src="'+imgL+'" /></div></div>';
439 440
						itemlist += '<div class="madiaInfo OmadiaInfo">';
440 441
						itemlist += '<p><span class="h1Font">'+thisName+'</span><em class="authicon '+thisAuth+'" title="'+thisTitle+'"></em></p>';
441 442
						itemlist += '<p class="ellipsis h2Font">'+otherI+'</p>';
442
						itemlist += '</div></div>';
443
						itemlist += '</div></a>';
443 444
					add.innerHTML=itemlist;
444 445
					document.getElementById("likePro").appendChild(add);
445 446
					
@ -449,11 +450,7 @@ $(document).ready(function() {
449 450
			}
450 451
		});
451 452
	}
452
	/*点击资源列表*/
453
	$("#resourceList").on("click", "li", function() {
454
		location.href="http://" + window.location.host + "/e/r.html?id=" + $(this).attr("data-id");
455
	})
456
    
453
	
457 454
    /*微信分享*/
458 455
	$.ajax({
459 456
		url: "../ajax/weixin/jsapiTicket",

+ 2 - 2
e/p.html

@ -152,7 +152,7 @@ $(document).ready(function() {
152 152
		location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.ekexiu.app";
153 153
		$(this).addClass("activeThis");
154 154
	})
155
	$('#articelShow').on('click', 'li', function() {
155
	$('#articelShow,#relateArt').on('click', 'li', function() {
156 156
		var id = this.getAttribute("data-id");
157 157
		location.href="http://" + window.location.host + "/e/a.html?id=" + id;
158 158
		$(this).addClass("activeThis");
@ -686,7 +686,7 @@ $(document).ready(function() {
686 686
									var itemlist = '<div class="madiaHead artHead" style="background-image:url('+imgL+')"></div>';
687 687
										itemlist += '<div class="madiaInfo OmadiaInfo">';
688 688
										itemlist += '<p class="mui-ellipsis h2Font" id="usertitle">'+StrData[n].articleTitle+'</p>';
689
										itemlist += '<p><span class="h1Font">'+thisName+'</span><em class="authicon '+thisAuth+'" title="'+thisTitle+'"></em></p>';
689
										itemlist += '<p><span class="h1Font">'+thisName+'</span><em class="authiconNew '+thisAuth+'" title="'+thisTitle+'"></em></p>';
690 690
										itemlist += '</div>';
691 691
										
692 692
									add.innerHTML=itemlist;

+ 157 - 145
e/r.html

@ -80,20 +80,18 @@
80 80
					<span class="h2Font"></span>
81 81
				</li>-->
82 82
			</ul>
83
			<!--相关文章-->
84 83
			<div class="madiaBlock displayNone">
85 84
				<div class="madiaTit">相关文章</div>
86
				<ul class="mui-table-view" id="oArticle">
87
			        
85
				<ul class="mui-table-view" id="likeArtical">
88 86
			    </ul>
89 87
			</div>
90 88
			<!--您可能感兴趣的资源-->
91 89
			<div class="madiaBlock displayNone">
92 90
				<div class="madiaTit">您可能感兴趣的资源</div>
93
				<ul class="mui-table-view" id="resourceList">
94
			        
91
				<ul class="mui-table-view" id="likeResource">
95 92
			    </ul>
96 93
			</div>
94
			
97 95
	    </div>
98 96
	    <div class="shareEcode">
99 97
			<img class="Ecodecon" src="../images/ecordCard.jpg" />
@ -126,6 +124,8 @@ $(document).ready(function() {
126 124
	var oremarkContent = document.getElementById("remarkContent"); //合作备注
127 125
	var odetailDescp = document.getElementById("detailDescp"); //详细描述
128 126
	getRecourceMe();/*获取信息*/
127
	relatedArticles();/*相关文章信息*/
128
	interestingResources();
129 129
130 130
	$.ajax({
131 131
		"url": "/ajax/resource/pageViews",
@ -251,11 +251,6 @@ $(document).ready(function() {
251 251
					}
252 252
					if(mydata.subject) {
253 253
						var oSub = mydata.subject.split(",");
254
						if(mydata.resourceType==1) {
255
							interestingResources(oSub,mydata.professorId,0);
256
						}else{
257
							interestingResources(oSub,mydata.orgId,1);
258
						}
259 254
						var oSt = "";
260 255
						for(var i = 0; i < oSub.length; i++) {
261 256
							oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
@ -294,162 +289,179 @@ $(document).ready(function() {
294 289
	/*资源里面相关文章*/
295 290
	function relatedArticles() {
296 291
		$.ajax({
297
			"url": "../ajax/resource/articles",
298
			"type": "GET",
299
			"success": function(data) {
300
				console.log(data);
292
			url:'/ajax/article/byAssResource', 
293
			type: "GET",
294
			data: {
295
				"id": resourceId,
296
			},
297
			dataType: "json",
298
			success: function(data) {
301 299
				if(data.success) {
302 300
					if(data.data.length == 0) {
303 301
						return;
304 302
					}
305
					$("#oArticle").parent().removeClass("displayNone");
306
					relatedArticlesHtml(data.data);
307
				}
308
			},
309
			"data": {
310
				"resourceId": resourceId,
311
				"rows": 5
312
				},
313
			dataType: "json",
314
			'error': function() {
315
				$.MsgBox.Alert('提示', '服务器连接超时!');
316
			}
317
		});
318
	}
319
	relatedArticles();
320
	/*资源相关文章html*/
321
	function relatedArticlesHtml($html) {
322
		for(var i = 0; i < $html.length; i++) {
323
			(function(n) {
324
				var oURL;
325
				if($html[i].article.articleType==1) {
326
					oURL="../ajax/professor/baseInfo/" + $html[i].article.professorId;
327
				}else{
328
					oURL="../ajax/org/" + $html[i].article.orgId;
329
				}
330
				$.ajax({
331
					"url":oURL,
332
					"type": "GET",
333
					"success": function(data) {
334
						if(data.success) {
335
							var cmpname="";
336
							if(data.data.forShort){
337
								cmpname=data.data.forShort;
303
					document.getElementById("likeArtical").parentNode.classList.remove("displayNone");
304
					var $html= data.data;
305
					var lengthT;
306
					if($html.length>5){
307
						lengthT=5;
308
					}else{
309
						lengthT=$html.length
310
						}
311
					for(var i = 0; i < $html.length; i++) {
312
						(function(n) {
313
							var oURL;
314
							if($html[i].articleType==1) {
315
								oURL="/ajax/professor/baseInfo/" + $html[i].professorId;
338 316
							}else{
339
								cmpname=data.data.name;
317
								oURL="/ajax/org/" + $html[i].orgId;
340 318
							}
341
							if($html[n].article.articleType==1) {
342
								var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
343
							}else {
344
								var stl={};
345
								stl.sty="";
346
								stl.title="";
347
								if(data.data.authStatus==3) {
348
									stl.sty="authicon-com-ok";
349
									stl.title="认证企业";
319
							$.ajax({
320
								url:oURL,
321
								type: "GET",
322
								dataType: "json",
323
								success: function(data) {
324
									if(data.success) {
325
										var likeRUl = document.getElementById("likeArtical");
326
										var likeRli = document.createElement("li");
327
										likeRli.className = 'mui-table-view-cell';
328
										likeRli.setAttribute("data-id", $html[n].articleId);
329
										
330
										var comName="";
331
										if($html[n].articleType==1) {
332
											var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
333
											comName=data.data.name;
334
											likeRli.setAttribute("data-type", 1);
335
										}else {
336
											var stl={};
337
											stl.sty="";
338
											stl.title="";
339
											if(data.data.authStatus==3) {
340
												stl.sty="authicon-com-ok";
341
												stl.title="认证企业";
342
											}
343
											if(data.data.forShort){
344
												comName=data.data.forShort;
345
											}else{
346
												comName=data.data.name;
347
											}
348
											likeRli.setAttribute("data-type", 2);
349
										}
350
										
351
										var str = ""
352
										str+='<div class="flexCenter OflexCenter mui-clearfix">'
353
										if($html[n].articleImg) {
354
											str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].articleImg + ')"></div>'
355
										} else {
356
											str += '<div class="madiaHead artHead"></div>'
357
										}
358
										str += '<div class="madiaInfo OmadiaInfo">'
359
										str += '<p class="mui-ellipsis-2 h1Font">' + $html[n].articleTitle + '</p>'
360
										str += '<p><span class="h2Font">' + comName + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
361
										str += '</div></div>'
362
										likeRli.innerHTML = str;
363
										likeRUl.appendChild(likeRli,likeRUl.lastChild);
364
									}
365
								},
366
								error: function() {
350 367
								}
351
							}
352
							var str = ""
353
							str += '<li class="flexCenter OflexCenter" data-id="' + $html[n].article.articleId + '">'
354
							if($html[n].article.articleImg) {
355
								str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].article.articleImg + ')"></div>'
356
							} else {
357
								str += '<div class="madiaHead artHead"></div>'
358
							}
359
							str += '<div class="madiaInfo OmadiaInfo">'
360
							str += '<p class="h1Font ellipsisSty">' + $html[n].article.articleTitle + '</p>'
361
							str += '<p><span class="h2Font">' + cmpname + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
362
							str += '</div></li>'
363
							$("#oArticle").append(str);
364
						}
365
					},
366
					'dataType': "json",
367
					'error': function() {
368
						$.MsgBox.Alert('提示', '服务器连接超时!');
368
							});
369
						})(i);
370
				
369 371
					}
370
				});
371
			})(i);
372
373
		}
372
				}
373
			},
374
			error:  function() {
375
			}
376
		});
374 377
	}
375
	/*文章跳转*/
376
	$("#oArticle").on("click", "li", function() {
377
		location.href="http://" + window.location.host + "/e/a.html?id=" + $(this).attr("data-id");
378
	})
379 378
	/*感兴趣的资源*/
380
	function interestingResources(arry,oId,oNu) {
381
		var oUrl;
382
		var $in={};
383
		$in.keys= arry;
384
		$in.resourceId= resourceId;
385
		
386
		if(oNu==0) {
387
				$in.professorId= oId;
388
				oUrl="../ajax/resource/ralateRes";
389
		}else {
390
			$in.orgId= oId;
391
			oUrl="../ajax/resource/orgRalateRes";
392
		}
379
	function interestingResources() {
393 380
		$.ajax({
394
			"url": oUrl,
395
			"type": "GET",
396
			"success": function(data) {
397
				console.log(data);
381
			url:"/ajax/resource/ralateResources",
382
			data: {"resourceId": resourceId},
383
			dataType: "json",
384
			traditional: true,
385
			type: 'get', //HTTP请求类型
386
			success: function(data) {
398 387
				if(data.success) {
388
					console.log(data)
399 389
					if(data.data.length == 0) {
400 390
						return;
401 391
					}
402
					$("#resourceList").parent().removeClass("displayNone");
403
					interestingResourcesHtml(data.data);
392
					document.getElementById("likeResource").parentNode.classList.remove("displayNone");
393
					var $respond=data.data;
394
					var lengthT;
395
					if($respond.length>5){
396
						lengthT=5;
397
					}else{
398
						lengthT=$respond.length
399
					}
400
					for(var i = 0; i < lengthT; i++) {
401
						(function(n) {
402
							var imgL="../images/default-resource.jpg";
403
							if($respond[i].images.length){
404
								imgL='/data/resource/' + $respond[i].images[0].imageSrc
405
							}
406
							var oURL;
407
							if($respond[i].resourceType==1) {
408
								oURL="/ajax/professor/baseInfo/"+$respond[i].professorId;
409
							}else{
410
								oURL="/ajax/org/" + $respond[i].orgId;
411
							}
412
							$.ajax({
413
								url:oURL,
414
								"type": "GET",
415
								'dataType': "json",
416
								"success": function(data) {
417
									if(data.success){
418
										var thisName,userType,thisAuth,thisTitle
419
										if(data.data.forShort){
420
											thisName=data.data.forShort;
421
										}else{
422
											thisName=data.data.name;
423
										}
424
										if($respond.resourceType==1) {
425
											userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
426
											thisTitle = userType.title;
427
											thisAuth = userType.sty;
428
										}else {
429
											if(data.data.authStatus==3) {
430
												thisTitle = "科袖认证企业";
431
												thisAuth = "authicon-com-ok";
432
											}
433
										}
434
										var add = document.createElement("li");
435
										add.className = "mui-table-view-cell"; 
436
										add.setAttribute("data-id",$respond[n].resourceId);
437
										var itemlist = '<div class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url('+imgL+')"></div>';
438
											itemlist += '<div class="madiaInfo OmadiaInfo">';
439
											itemlist += '<p class="mui-ellipsis h2Font" id="usertitle">'+$respond[n].resourceName+'</p>';
440
											itemlist += '<p><span class="h1Font">'+thisName+'</span><em class="authiconNew '+thisAuth+'" title="'+thisTitle+'"></em></p>';
441
											itemlist += '</div></div>';
442
											
443
										add.innerHTML=itemlist;
444
										document.getElementById("likeResource").appendChild(add);
445
									}
446
								},
447
								'error': function() {
448
								}
449
							});
450
						})(i);
451
					}
404 452
				}
405 453
			},
406
			"data":$in,
407
			"traditional": true,
408
			dataType: "json",
409
			'error': function() {
410
				$.MsgBox.Alert('提示', '服务器连接超时!');
454
			error: function() {
411 455
			}
412 456
		});
413 457
	}
414
	/*感兴趣资源的html*/
415
	function interestingResourcesHtml($respond) {
416
		for(var i = 0; i < 5; i++) {
417
			if($respond[i].organization) {
418
				var stl={};
419
				stl.sty="";
420
				stl.title="";
421
				if($respond[i].organization.authStatus==3) {
422
					stl.sty="authicon-com-ok";
423
					stl.title="认证企业";
424
				}
425
				var name="";
426
				if($respond[i].organization.forShort){
427
					name=$respond[i].organization.forShort;
428
				}else{
429
					name=$respond[i].organization.name;
430
				}
431
			}else {
432
				var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
433
				var name= $respond[i].editProfessor.name;
434
			}
435
			
436
			var oStr = '';
437
			oStr+='<li class="flexCenter OflexCenter" style="" data-id="' + $respond[i].resourceId + '">'
438
			if($respond[i].images.length) {
439
				oStr += '<div class="madiaHead resouseHead" style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
440
			} else {
441
				oStr += '<div class="madiaHead resouseHead"></div>'
442
			}
443
			oStr += '<div class="madiaInfo OmadiaInfo">'
444
			oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
445
			oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
446
			oStr += '<p><span class="h2Font">' + name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
447
			oStr += '</div></li>'
448
			$("#resourceList").append(oStr);
449
		}
450
	}
458
459
	/*文章跳转*/
460
	$("#likeArtical").on("click", "li", function() {
461
		location.href="http://" + window.location.host + "/e/a.html?id=" + $(this).attr("data-id");
462
	})
451 463
	/*点击资源列表*/
452
	$("#resourceList").on("click", "li", function() {
464
	$("#likeResource").on("click", "li", function() {
453 465
		location.href="http://" + window.location.host + "/e/r.html?id=" + $(this).attr("data-id");
454 466
	})
455 467

BIN
images/g_article_icon_dianzan_nor.png


BIN
images/g_article_icon_jia_nor.png


+ 1 - 1
js/common.js

@ -597,7 +597,7 @@ function ifcollectionAbout(watchObject, sel,num) {
597 597
					$(that).text("关注");
598 598
				} else { //收藏资源或文章
599 599
					$(that).addClass("icon-collect");
600
					$(that).removeClass("icon-collected");//$("#collectBtn")
600
					$(that).removeClass("icon-collected");//
601 601
				}
602 602
			}
603 603
		},

+ 131 - 120
js/resourceShow.js

@ -14,6 +14,8 @@ $(document).ready(function() {
14 14
	ifcollectionAbout(resourceId,$("#attention").find("em"), 2)
15 15
	var professorId = "";
16 16
	getRecourceMe();
17
	relatedArticles();
18
	interestingResources();
17 19
	
18 20
	//热门资源
19 21
	function recentlyRe(num,obj) {
@ -63,7 +65,6 @@ $(document).ready(function() {
63 65
			}
64 66
		});
65 67
	}
66
	
67 68
	/*获取资源信息*/
68 69
	function getRecourceMe() {
69 70
		$.ajax({
@ -170,11 +171,6 @@ $(document).ready(function() {
170 171
		}
171 172
		if($da.subject) {
172 173
			var oSub = $da.subject.split(",");
173
			if($da.resourceType==1) {
174
				interestingResources(oSub,$da.professorId,0);
175
			}else{
176
				interestingResources(oSub,$da.orgId,1);
177
			}
178 174
			var oSt = "";
179 175
			for(var i = 0; i < oSub.length; i++) {
180 176
				oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
@ -239,119 +235,117 @@ $(document).ready(function() {
239 235
	/*资源里面相关文章*/
240 236
	function relatedArticles() {
241 237
		$.ajax({
242
			"url": "/ajax/resource/articles",
238
			"url": "/ajax/article/byAssResource",
243 239
			"type": "GET",
240
			"data": {
241
				"id": resourceId,
242
			},
243
			dataType: "json",
244 244
			"success": function(data) {
245 245
				console.log(data);
246 246
				if(data.success) {
247
					if(data.data.length == 0) {
248
						$("#oArticle").parent().hide();
249
						$(".aboutTit:contains('相关文章')").hide();
250
						return;
247
					if(data.data.length> 0) {
248
						$("#oArticle").parents(".otherShow").removeClass("displayNone");
249
						var StrData = data.data
250
						var lengthT;
251
						if(StrData.length>5){
252
							lengthT=5;
253
						}else{
254
							lengthT=StrData.length
255
						}
256
						for(var i = 0; i < lengthT; i++) {
257
							relatedArticlesHtml(StrData[i]);
258
						}
251 259
					}
252
					relatedArticlesHtml(data.data);
253 260
				}
254 261
			},
255
			"data": {
256
				"resourceId": resourceId,
257
				"rows": 5
258
			},
259
			dataType: "json",
260 262
			'error': function() {
261 263
				$.MsgBox.Alert('提示', '服务器连接超时!');
262 264
			}
263 265
		});
264 266
	}
265
	relatedArticles();
266 267
	/*资源相关文章html*/
267 268
	function relatedArticlesHtml($html) {
268
		for(var i = 0; i < $html.length; i++) {
269
			(function(n) {
270
				var oURL;
271
				if($html[i].article.articleType==1) {
272
					oURL="/ajax/professor/baseInfo/" + $html[i].article.professorId;
273
				}else{
274
					oURL="/ajax/org/" + $html[i].article.orgId;
275
				}
276
				$.ajax({
277
					"url":oURL,
278
					"type": "GET",
279
					"success": function(data) {
280
						if(data.success) {
281
							var cmpname="";
282
							if(data.data.forShort){
283
								cmpname=data.data.forShort;
284
							}else{
285
								cmpname=data.data.name;
286
							}
287
							if($html[n].article.articleType==1) {
288
								var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
289
							}else {
290
								var stl={};
291
								stl.sty="";
292
								stl.title="";
293
								if(data.data.authStatus==3) {
294
									stl.sty="authicon-com-ok";
295
									stl.title="认证企业";
296
								}
297
							}
298
							var str = ""
299
							str += '<li data-id="' + $html[n].article.articleId + '">'
300
							if($html[n].article.articleImg) {
301
								str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].article.articleImg + ')"></div>'
302
							} else {
303
								str += '<div class="madiaHead artHead"></div>'
304
							}
305
							str += '<div class="madiaInfo"  style="margin-top:18px;padding-bottom:8px">'
306
							str += '<p class="h1Font ellipsisSty">' + $html[n].article.articleTitle + '</p>'
307
							str += '<p><span class="h2Font">' + cmpname + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
308
							str += '</div></li>'
309
							$("#oArticle").append(str);
269
		var oURL;
270
		if($html.articleType==1) {
271
			oURL="/ajax/professor/baseInfo/" + $html.professorId;
272
		}else{
273
			oURL="/ajax/org/" + $html.orgId;
274
		}
275
		$.ajax({
276
			"url":oURL,
277
			"type": "GET",
278
			"success": function(data) {
279
				if(data.success) {
280
					console.log(data)
281
					var cmpname="";
282
					if(data.data.forShort){
283
						cmpname=data.data.forShort;
284
					}else{
285
						cmpname=data.data.name;
286
					}
287
					if($html.articleType==1) {
288
						var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
289
					}else {
290
						var stl={};
291
						stl.sty="";
292
						stl.title="";
293
						if(data.data.authStatus==3) {
294
							stl.sty="authicon-com-ok";
295
							stl.title="认证企业";
310 296
						}
311
					},
312
					'dataType': "json",
313
					'error': function() {
314
						$.MsgBox.Alert('提示', '服务器连接超时!');
315 297
					}
316
				});
317
			})(i);
318

319
		}
298
					var str = ""
299
					str += '<li data-id="' + $html.articleId + '"><a class="flexCenter OflexCenter">'
300
					if($html.articleImg) {
301
						str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html.articleImg + ')"></div>'
302
					} else {
303
						str += '<div class="madiaHead artHead"></div>'
304
					}
305
					str += '<div class="madiaInfo"  style="margin-top:18px;padding-bottom:8px">'
306
					str += '<p class="h1Font ellipsisSty">' + $html.articleTitle + '</p>'
307
					str += '<p><span class="h2Font">' + cmpname + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
308
					str += '</div></a></li>'
309
					$("#oArticle").append(str);
310
				}
311
			},
312
			'dataType': "json",
313
			'error': function() {
314
				$.MsgBox.Alert('提示', '服务器连接超时!');
315
			}
316
		});
320 317
	}
321 318
	/*文章跳转*/
322 319
	$("#oArticle").on("click", "li", function() {
323 320
		location.href = "articalShow.html?articleId=" + $(this).attr("data-id");
324 321
	})
325 322
	/*感兴趣的资源*/
326
	function interestingResources(arry,oId,oNu) {
327
		var oUrl;
328
		var $in={};
329
		$in.keys= arry;
330
		$in.resourceId= resourceId;
331
		
332
		if(oNu==0) {
333
				$in.professorId= oId;
334
				oUrl="/ajax/resource/ralateRes";
335
		}else {
336
			$in.orgId= oId;
337
			oUrl="/ajax/resource/orgRalateRes";
338
		}
323
	function interestingResources() {
339 324
		$.ajax({
340
			"url": oUrl,
325
			"url": "/ajax/resource/ralateResources",
341 326
			"type": "GET",
327
			"data":{"resourceId": resourceId},
328
			"traditional": true,
329
			dataType: "json",
342 330
			"success": function(data) {
343
				console.log(data);
331
				//console.log(data);
344 332
				if(data.success) {
345 333
					if(data.data.length == 0) {
346
						$(".aboutTit:contains('您可能感兴趣的资源')").parent().hide();
347 334
						return;
348 335
					}
349
					interestingResourcesHtml(data.data);
336
					$("#relateArt").parents(".otherShow").removeClass("displayNone");
337
					var StrData = data.data
338
					var lengthT;
339
					if(StrData.length>5){
340
						lengthT=5;
341
					}else{
342
						lengthT=StrData.length
343
					}
344
					for(var i = 0; i < lengthT; i++) {
345
						interestingResourcesHtml(StrData[i]);
346
					}
350 347
				}
351 348
			},
352
			"data":$in,
353
			"traditional": true,
354
			dataType: "json",
355 349
			'error': function() {
356 350
				$.MsgBox.Alert('提示', '服务器连接超时!');
357 351
			}
@ -359,42 +353,59 @@ $(document).ready(function() {
359 353
	}
360 354
	/*感兴趣资源的html*/
361 355
	function interestingResourcesHtml($respond) {
362
		for(var i = 0; i < $respond.length; i++) {
363
			if($respond[i].organization) {
364
				var stl={};
365
				stl.sty="";
366
				stl.title="";
367
				if($respond[i].organization.authStatus==3) {
368
					stl.sty="authicon-com-ok";
369
					stl.title="认证企业";
370
				}
371
				var name="";
372
				if($respond[i].organization.forShort){
373
					name=$respond[i].organization.forShort;
374
				}else{
375
					name=$respond[i].organization.name;
356
		var imgL="../images/default-resource.jpg";
357
		if($respond.images.length){
358
			imgL='/data/resource/' + $respond.images[0].imageSrc
359
		}
360
		var oURL;
361
		if($respond.resourceType==1) {
362
			oURL="/ajax/professor/baseInfo/"+$respond.professorId;
363
		}else{
364
			oURL="/ajax/org/" + $respond.orgId;
365
		}
366
		$.ajax({
367
			"url":oURL,
368
			"type": "GET",
369
			'dataType': "json",
370
			"success": function(data) {
371
				if(data.success){
372
					//console.log(data)
373
					var thisName,userType,thisAuth,thisTitle
374
					if(data.data.forShort){
375
						thisName=data.data.forShort;
376
					}else{
377
						thisName=data.data.name;
378
					}
379
					if($respond.resourceType==1) {
380
						userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
381
						thisTitle = userType.title;
382
						thisAuth = userType.sty;
383
					}else {
384
						if(data.data.authStatus==3) {
385
							thisTitle = "科袖认证企业";
386
							thisAuth = "authicon-com-ok";
387
						}
388
					}
389
					var add = document.createElement("li");
390
					add.className = "mui-table-view-cell"; 
391
					add.setAttribute("data-id",$respond.resourceId);
392
					var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url('+imgL+')"></div>';
393
						itemlist += '<div class="madiaInfo OmadiaInfo">';
394
						itemlist += '<p class="mui-ellipsis h2Font" id="usertitle">'+$respond.resourceName+'</p>';
395
						itemlist += '<p><span class="h1Font">'+thisName+'</span><em class="authiconNew '+thisAuth+'" title="'+thisTitle+'"></em></p>';
396
						itemlist += '</div></a>';
397
						
398
					add.innerHTML=itemlist;
399
					document.getElementById("relateArt").appendChild(add);
376 400
				}
377
			}else {
378
				var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
379
				var name= $respond[i].editProfessor.name;
380
			}
381
			
382
			var oStr = '';
383
			if($respond[i].images.length) {
384
				oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
385
			} else {
386
				oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"></div>'
401
			},
402
			'error': function() {
403
				$.MsgBox.Alert('提示', '服务器连接超时!');
387 404
			}
388
			oStr += '<div class="madiaInfo">'
389
			oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
390
			oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
391
			oStr += '<p><span class="h2Font">' + name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
392
			oStr += '</div></li>'
393
			$("#resourceList").append(oStr);
394
		}
405
		});
395 406
	}
396 407
	/*点击资源列表*/
397
	$("#resourceList").on("click", "li", function() {
408
	$("#relateArt").on("click", "li", function() {
398 409
		location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
399 410
	})
400 411
	/*点击咨询*/

+ 1 - 1
js/searchNew.js

@ -616,7 +616,7 @@ $(function() {
616 616
							itemlist += '<p class="h2font ellipsisSty" id="supportedServices"></p>';
617 617
							itemlist += '<p class="h2font">';
618 618
							itemlist += '<span class="nameSpan" id="username"></span>';
619
							itemlist += '<em class="authiconNew authicon-pro" title="科袖认证专家"></em>';
619
							itemlist += '<em class="authiconNew" title="科袖认证专家"></em>';
620 620
							itemlist += '</p></div></a></li>';
621 621
							$itemlist = $(itemlist);
622 622
							$("#resourceList").append($itemlist);

+ 3 - 3
resourceShow.html

@ -94,7 +94,7 @@
94 94
							
95 95
						</ul>
96 96
						<!--相关文章-->
97
						<div class="form-item otherShow">
97
						<div class="form-item otherShow displayNone">
98 98
							<div class="aboutTit">相关文章</div>
99 99
							<div class="form-result aboutRes pointOk">
100 100
								<ul id="oArticle">
@ -102,10 +102,10 @@
102 102
							</div>
103 103
						</div>
104 104
						<!--您可能感兴趣的资源-->
105
						<div class="form-item otherShow">
105
						<div class="form-item otherShow displayNone">
106 106
							<div class="aboutTit">您可能感兴趣的资源</div>
107 107
							<div class="form-result aboutRes pointOk">
108
								<ul id="resourceList">
108
								<ul id="relateArt">
109 109
									
110 110
								</ul>
111 111
							</div>