Sfoglia il codice sorgente

学术领域点赞列表

jack 8 anni fa
parent
commit
b870c8b79d
2 ha cambiato i file con 171 aggiunte e 85 eliminazioni
  1. 3 32
      information-brow.html
  2. 168 53
      js/information.brow.js

+ 3 - 32
information-brow.html

@ -20,29 +20,10 @@
20 20
		<!--研究方向详情页面-->
21 21
		<div class="blackcover resAreaCover" style="display: none;">
22 22
			<div class="attentionBox">
23
				<div class="researchArea">研究方向文字很长,之前页面显示不下,在这里就能显示完整,全部都显示出来</div>
23
				<div class="researchArea" id="subArea">研究方向文字很长,之前页面显示不下,在这里就能显示完整,全部都显示出来</div>
24 24
				<div class="attentsCon resAreaCon">
25 25
					<p class="littip">以下用户认可了他的研究</p>
26 26
					<ul class="attentList">
27
						<li>
28
							<a class="proinfor clearfix">
29
								<div class="headblock floatL"><img id="proHead" class="headimg headRadius" src="images/default-photo.jpg"></div>
30
								<div class="mediaBody">
31
									<span class="listtit"><span id="proName">章先生</span><em class="authicon authicon-cu" style="position:absolute;margin:4px 0 0 2px ;"></em></span>
32
									<div class="listtit2"><span id="proTitle">国家级营养师</span><span id="proOffice">,教授</span><span id="proOrg">,北京体育大学</span><span id="proAddress"> | 北京</span></div>
33
								</div>
34
							</a>
35
						</li>
36
						<li>
37
							<a class="proinfor clearfix">
38
								<div class="headblock floatL"><img id="proHead" class="headimg headRadius" src="images/default-photo.jpg"></div>
39
								<div class="mediaBody">
40
									<span class="listtit"><span id="proName">章先生</span><em class="authicon authicon-cu" style="position:absolute;margin:4px 0 0 2px ;"></em></span>
41
									<div class="listtit2"><span id="proTitle">国家级营养师</span><span id="proOffice">,教授</span><span id="proOrg">,北京体育大学</span><span id="proAddress"> | 北京</span></div>
42
								</div>
43
							</a>
44
						</li>
45
46 27
					</ul>
47 28
				</div>
48 29
				<div style="height: 20px;"></div>
@ -339,8 +320,9 @@
339 320
				});
340 321
341 322
				function makeCode() {
323
					var hurl = window.location.host;
342 324
					var professorId = GetQueryString("professorId");
343
					var elurl = "http://www.ekexiu.com/ekexiu/shareProinfor.html?professorId=" + professorId;
325
					var elurl = hurl + "http://www.ekexiu.com/ekexiu/shareProinfor.html?professorId=" + professorId;
344 326
					qrcode.makeCode(elurl);
345 327
				}
346 328
				makeCode();
@ -349,17 +331,6 @@
349 331
				$('.shareWeixin').hover(function() {
350 332
					$('.shareCode').stop(true, false).fadeToggle();
351 333
				});
352
353
				//研究方向详细信息
354
				$("#researchAreaShow").on('click', ".favorBox", function() {
355
						$(".resAreaCover").fadeIn();
356
						$("body").css("position", "fixed");
357
					})
358
					//关闭按钮
359
				$("#workclose").click(function() {
360
					$(".resAreaCover").fadeOut();
361
					$("body").css("position", "static");
362
				});
363 334
			</script>
364 335
	</body>
365 336

+ 168 - 53
js/information.brow.js

@ -212,12 +212,12 @@ $(function() {
212 212
					}
213 213
					if(professorId != userid) {
214 214
						if(isAgree) {
215
							var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus ' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox'>";
215
							var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus ' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
216 216
						} else {
217
							var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus' style=' background-position-y:-26px' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox'>";
217
							var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus' style=' background-position-y:-26px' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
218 218
						}
219 219
					} else {
220
						var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><div class='like-num favorBox'>";
220
						var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><div class='like-num favorBox' caption='" + $data.caption + "'>";
221 221
					}
222 222
					if($photos.length < 6) {
223 223
						for(var j = 0; j < $photos.length; ++j) {
@ -259,58 +259,174 @@ $(function() {
259 259
		}
260 260
		var clFlag = 1;
261 261
		$("#researchAreaShow").on("click", ".plus", function() {
262
			if(userid && userid != null && userid != "null") {
263
				//点赞变化样式
264
				if(clFlag) {
265
					clFlag = 0;
266
				} else {
267
					return;
268
				}
269
				if($(this).data("isagree") > -1) {
270
					$(this).stop(true, true).animate({
271
						backgroundPositionY: 0
272
					}, 300); //变成未点赞样式
273
				} else {
274
					$(this).stop(true, true).animate({
275
						backgroundPositionY: -26
276
					}, 300); //变成点赞样式
277
				}
262
				if(userid && userid != null && userid != "null") {
263
					//点赞变化样式
264
					if(clFlag) {
265
						clFlag = 0;
266
					} else {
267
						return;
268
					}
269
					if($(this).data("isagree") > -1) {
270
						$(this).stop(true, true).animate({
271
							backgroundPositionY: 0
272
						}, 300); //变成未点赞样式
273
					} else {
274
						$(this).stop(true, true).animate({
275
							backgroundPositionY: -26
276
						}, 300); //变成点赞样式
277
					}
278 278
279
				$.ajax({
280
					"url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
281
					"type": "POST",
282
					"data": {
283
						"targetId": $(this).data("pid"),
284
						"targetCaption": $(this).data("caption"),
285
						"opId": userid
286
					},
287
					"contentType": "application/x-www-form-urlencoded",
288
					"success": function($data) {
289
						if($data.success) {
290
							$.get("/ajax/professor/info/" + professorId, function($data) {
291
								if($data.success) {
292
									clFlag = 1;
293
									var $info = $data.data;
294
									if($info) {
295
										$("#researchAreaShow").empty("")
296
										if($info.researchAreas) {
297
											researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
279
					$.ajax({
280
						"url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
281
						"type": "POST",
282
						"data": {
283
							"targetId": $(this).data("pid"),
284
							"targetCaption": $(this).data("caption"),
285
							"opId": userid
286
						},
287
						"contentType": "application/x-www-form-urlencoded",
288
						"success": function($data) {
289
							if($data.success) {
290
								$.get("/ajax/professor/info/" + professorId, function($data) {
291
									if($data.success) {
292
										clFlag = 1;
293
										var $info = $data.data;
294
										if($info) {
295
											$("#researchAreaShow").empty("")
296
											if($info.researchAreas) {
297
												researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
298
											}
298 299
										}
300
299 301
									}
302
								})
303
							} else {
304
								$.MsgBox.Alert("message", $data.msg);
305
							}
306
						}
307
					});
308
				} else {
309
					$.MsgBox.Alert("消息", "请登录后点赞");
310
					/*location.href="login.html"*/
311
				}
300 312
313
			})
314
			/*研究方向点赞列表*/
315
			//关闭按钮
316
		$("#workclose").click(function() {
317
			$(".resAreaCover").fadeOut();
318
			$("body").css("position", "static");
319
		});
320
		$("#researchAreaShow").on("click", ".list-browse,.like-num", function() {
321
			var cap = $(this).attr("caption");
322
			console.log(cap.length);
323
			$.ajax({
324
				url: "/ajax/researchAreaLog/ql",
325
				dataType: 'json', //数据格式类型
326
				type: 'GET', //http请求类型
327
				timeout: 10000, //超时设置
328
				data: {
329
					"professorId": professorId,
330
					'caption': cap,
331
					"rows": 10
332
				},
333
				success: function(data) {
334
					if(data.success) {
335
						$(".attentList").html("");
336
						var $info = data.data;
337
						$("#subArea").text(cap);
338
						if($info.length == 0) {
339
							$(".resAreaCon").hide();
340
							return;
341
						}
342
						for(var i = 0; i < $info.length; i++) {
343
							if($info[i].professor.hasHeadImage == 1) {
344
								var img = "/images/head/" + $info[i].professor.id + "_l.jpg";
345
							} else {
346
								var img = "../images/default-photo.jpg";
347
							}
348
							if($info[i].professor.authType) {   
349
								var typeTname = "authicon authicon-cu"
350
							} else {								
351
								if($info[i].professor.authStatus) {
352
									if($info[i].professor.authentication == 1) {
353
										var typeTname = "authicon2 authicon-mana";
354
									} else if($info[i].professor.authentication == 2) {
355
										var typeTname = "authicon2 authicon-staff";
356
									} else {
357
										var typeTname = "authicon2 authicon-stu"
358
									}
301 359
								}
302
							})
303
						} else {
304
							$.MsgBox.Alert("message", $data.msg);
360
							}
361
							var title = "",
362
								office = "",
363
								orgName = "",
364
								address = '';
365
							if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
366
								title = $info[i].professor.title + ",";
367
								office = $info[i].professor.office + ",";
368
								orgName = $info[i].professor.orgName + " | ";
369
								address = $info[i].professor.address;
370
							} else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
371
								office = $info[i].professor.office + ",";
372
								orgName = $info[i].professor.orgName + " | ";
373
								address = $info[i].professor.address;
374
							} else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
375
								title = $info[i].professor.title + ",";
376
								orgName = $info[i].professor.orgName + " | ";
377
								address = $info[i].professor.address;
378
							} else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
379
								title = $info[i].professor.title + ",";
380
								office = $info[i].professor.office + " | ";
381
								address = $info[i].professor.address;
382
							} else if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
383
								title = $info[i].professor.title + ",";
384
								office = $info[i].professor.office + ",";
385
								orgName = $info[i].professor.orgName;
386
							} else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
387
								orgName = $info[i].professor.orgName + " | ";
388
								address = $info[i].professor.address;
389
							} else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
390
								office = $info[i].professor.office + " | ";
391
								address = $info[i].professor.address;
392
							} else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
393
								office = $info[i].professor.office + ",";
394
								orgName = $info[i].professor.orgName;
395
							} else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
396
								title = $info[i].professor.title + " | ";
397
								address = $info[i].professor.address;
398
							} else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
399
								office = $info[i].professor.title + ",";
400
								address = $info[i].professor.orgName;
401
							} else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
402
								title = $info[i].professor.title + ",";
403
								office = $info[i].professor.office;
404
							} else if(!$info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
405
								address = $info[i].professor.address;
406
							} else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
407
								orgName = $info[i].professor.orgName;
408
							} else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
409
								office = $info[i].professor.office;
410
							} else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
411
								title = $info[i].professor.title;
412
							}
413
							var addw = '<li>'
414
							addw += '<a class="proinfor clearfix">'
415
							addw += '<div class="headblock floatL"><img id="proHead" class="headimg headRadius" src="'+img+'"></div>'
416
							addw += '<div class="mediaBody">'
417
							addw += '<span class="listtit"><span id="proName">'+$info[i].professor.name+'</span><em class="'+typeTname+'" style="position:absolute;margin:4px 0 0 2px ;"></em></span>'
418
							addw += '<div class="listtit2">' + title + office + orgName + address + '</div>'
419
							addw += '</div></a></li>'
420
421
							$(".attentList").append(addw);
305 422
						}
423
						$(".resAreaCover").fadeIn();
424
						$("body").css("position", "fixed");
306 425
					}
307
				});
308
			} else {
309
				$.MsgBox.Alert("消息", "请登录后点赞");
310
				/*location.href="login.html"*/
311
			}
312
313
		})
426
				},
427
				error: function() {}
428
			});
429
		});
314 430
315 431
		$.get("/ajax/professor/info/" + professorId, function($data) {
316 432
			if($data.success) {
@ -600,21 +716,20 @@ $(function() {
600 716
		},
601 717
		timeout: 10000, //超时设置
602 718
		success: function(data) {
603
			console.log(JSON.stringify(data))
604 719
			if(data.success) {
605 720
				for(var i = 0; i < data.data.length; i++) {
606
					var add = '<li><a href="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId='+professorId+'" style="display:block;">'
721
					var add = '<li><a href="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId=' + professorId + '" style="display:block;">'
607 722
					add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
608 723
					add += '<div class="art_topicbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
609 724
					add += '</div><div class="tagsBox"><span></span></div>'
610
					add += '</a></li>';
725
					add += '</a></li>';
611 726
					$add = $(add);
612 727
					$("#reachArticle").append($add);
613 728
					$add.find('.tagsBox span').text(data.data[i].industry); //data.data[i].subject
614 729
					if(data.data[i].articleImg) {
615
						$add.find(".art_img").attr("style", "background: url(/data/article/"+data.data[i].articleImg+") 0 0 no-repeat;background-size:cover;");
730
						$add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") 0 0 no-repeat;background-size:cover;");
616 731
					}
617
					
732
618 733
				}
619 734
				//资源轮播
620 735
				var $content2 = $(".sharescrollbox.Acrollbox");