|
@ -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");
|