|
@ -11,7 +11,7 @@ $(document).ready(function() {
|
11
|
11
|
$('.shareCode').stop(true, false).fadeToggle();
|
12
|
12
|
});
|
13
|
13
|
var resourceId = GetQueryString("resourceId");
|
14
|
|
ifCollection(resourceId,2)
|
|
14
|
ifCollection(resourceId, 2)
|
15
|
15
|
var professorId = "";
|
16
|
16
|
getRecourceMe();
|
17
|
17
|
/*获取资源信息*/
|
|
@ -22,7 +22,7 @@ $(document).ready(function() {
|
22
|
22
|
"success": function(data) {
|
23
|
23
|
console.log(data);
|
24
|
24
|
if(data.success) {
|
25
|
|
//resourceHtml(data.data);
|
|
25
|
resourceHtml(data.data);
|
26
|
26
|
}
|
27
|
27
|
},
|
28
|
28
|
"data": {
|
|
@ -51,31 +51,58 @@ $(document).ready(function() {
|
51
|
51
|
function resourceHtml($da) {
|
52
|
52
|
$("#resourceName").text($da.resourceName); //名字
|
53
|
53
|
$("#application").text($da.supportedServices); //应用用途
|
54
|
|
if($da.orgName) { //所属机构
|
55
|
|
$("#organizationName").text($da.orgName).parents("li").show();
|
56
|
|
}
|
57
|
|
$("#nameS").text($da.editProfessor.name);
|
58
|
|
if($da.editProfessor.title) {
|
59
|
|
$("#titleOffice").text($da.editProfessor.title);
|
60
|
|
} else {
|
61
|
|
if($da.editProfessor.office) {
|
62
|
|
$("#titleOffice").text($da.editProfessor.office);
|
|
54
|
if($da.editProfessor) {
|
|
55
|
$("#person").show();
|
|
56
|
if($da.orgName) { //所属机构
|
|
57
|
$("#organizationName").text($da.orgName).parents("li").show();
|
63
|
58
|
}
|
64
|
|
}
|
65
|
|
if($da.editProfessor.orgName) {
|
66
|
|
$("#orgType").text($da.editProfessor.orgName);
|
67
|
|
}
|
68
|
|
professorId = $da.editProfessor.id;
|
69
|
|
console.log(professorId);
|
70
|
|
console.log(userid);
|
71
|
|
if(userid!=professorId) {
|
72
|
|
ifCollection(professorId,1)
|
73
|
|
$(".goSpan").show();
|
74
|
|
}
|
75
|
|
var professorFlag = autho($da.editProfessor.authType, $da.editProfessor.orgAuth, $da.editProfessor.authStatus);
|
76
|
|
$("#authFlag").addClass(professorFlag.sty).attr("title", professorFlag.title);
|
77
|
|
if($da.editProfessor.hasHeadImage == 1) {
|
78
|
|
$("#headImg").css("background-image", 'url(/images/head/' + $da.editProfessor.id + '_l.jpg)');
|
|
59
|
$("#nameS").text($da.editProfessor.name);
|
|
60
|
if($da.editProfessor.title) {
|
|
61
|
$("#titleOffice").text($da.editProfessor.title);
|
|
62
|
} else {
|
|
63
|
if($da.editProfessor.office) {
|
|
64
|
$("#titleOffice").text($da.editProfessor.office);
|
|
65
|
}
|
|
66
|
}
|
|
67
|
if($da.editProfessor.orgName) {
|
|
68
|
$("#orgType").text($da.editProfessor.orgName);
|
|
69
|
}
|
|
70
|
professorId = $da.editProfessor.id;
|
|
71
|
console.log(professorId);
|
|
72
|
console.log(userid);
|
|
73
|
if(userid != professorId) {
|
|
74
|
ifCollection(professorId, 1)
|
|
75
|
$(".goSpan").show();
|
|
76
|
}
|
|
77
|
var professorFlag = autho($da.editProfessor.authType, $da.editProfessor.orgAuth, $da.editProfessor.authStatus);
|
|
78
|
$("#authFlag").addClass(professorFlag.sty).attr("title", professorFlag.title);
|
|
79
|
if($da.editProfessor.hasHeadImage == 1) {
|
|
80
|
$("#headImg").css("background-image", 'url(/images/head/' + $da.editProfessor.id + '_l.jpg)');
|
|
81
|
}
|
|
82
|
}else{
|
|
83
|
$("#enterprise,#resPerson").show();
|
|
84
|
if(data.data.organization.hasOrgLogo) {
|
|
85
|
$("#Qimg").attr("style", "background-image: url(/images/org/" + data.data.organization.id + ".jpg);");
|
|
86
|
}
|
|
87
|
if(data.data.organization.authStatus==3){
|
|
88
|
$("#QauthFlag").addClass("authicon-com-ok").attr("title", "认证企业");
|
|
89
|
}
|
|
90
|
$("#Qindustry").text( data.data.organization.subject);
|
|
91
|
if(data.data.organization.orgType==2){
|
|
92
|
$("#QorgType").text("上市企业");
|
|
93
|
}else if(data.data.organization.orgType==3){
|
|
94
|
$("#QorgType").text("国有企业");
|
|
95
|
}else if(data.data.organization.orgType==4){
|
|
96
|
$("#QorgType").text("合资企业");
|
|
97
|
}else if(data.data.organization.orgType==5){
|
|
98
|
$("#QorgType").text("私人企业");
|
|
99
|
}else if(data.data.organization.orgType==6){
|
|
100
|
$("#QorgType").text("外资企业");
|
|
101
|
}else if(data.data.organization.orgType==7){
|
|
102
|
$("#QorgType").text("初创企业");
|
|
103
|
}else{
|
|
104
|
$("#QorgType").text("");
|
|
105
|
}
|
79
|
106
|
}
|
80
|
107
|
if($da.spec) { //厂商型号
|
81
|
108
|
$("#modelNumber").text($da.spec).parents("li").show();
|
|
@ -94,17 +121,17 @@ $(document).ready(function() {
|
94
|
121
|
oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
|
95
|
122
|
}
|
96
|
123
|
$(".tagList").html(oSt);
|
97
|
|
}else {
|
|
124
|
} else {
|
98
|
125
|
$(".aboutTit:contains('您可能感兴趣的资源')").parent().hide();
|
99
|
126
|
}
|
100
|
127
|
if($da.descp) { //编辑器
|
101
|
128
|
$("#descp").html($da.descp).parents("li").show();
|
102
|
129
|
}
|
103
|
130
|
var weibotitle = $da.resourceName;
|
104
|
|
var weibourl =window.location.href;
|
|
131
|
var weibourl = window.location.href;
|
105
|
132
|
//return;
|
106
|
133
|
if($da.images.length) {
|
107
|
|
var weibopic ="http://"+window.location.host+"/data/resource/" + $da.images[0].imageSrc;
|
|
134
|
var weibopic = "http://" + window.location.host + "/data/resource/" + $da.images[0].imageSrc;
|
108
|
135
|
$("#firstFigure").attr({
|
109
|
136
|
"src": "/data/resource/" + $da.images[0].imageSrc,
|
110
|
137
|
"rel": "/data/resource/" + $da.images[0].imageSrc
|
|
@ -132,11 +159,14 @@ $(document).ready(function() {
|
132
|
159
|
arr += oString;
|
133
|
160
|
}
|
134
|
161
|
$("#thumblist").html(arr);
|
135
|
|
}else{
|
136
|
|
var weibopic ="http://"+window.location.host+"../images/default-resource.jpg";
|
137
|
|
$("#firstFigure").attr({"src":'../images/default-resource.jpg',"rel":'../images/default-resource.jpg'});
|
|
162
|
} else {
|
|
163
|
var weibopic = "http://" + window.location.host + "../images/default-resource.jpg";
|
|
164
|
$("#firstFigure").attr({
|
|
165
|
"src": '../images/default-resource.jpg',
|
|
166
|
"rel": '../images/default-resource.jpg'
|
|
167
|
});
|
138
|
168
|
}
|
139
|
|
$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
|
|
169
|
$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + weibotitle + "&url=" + weibourl + "&pic=" + weibopic + "&ralateUid=6242830109&searchPic=false&style=simple");
|
140
|
170
|
}
|
141
|
171
|
/*点击名字及头像跳转个人浏览页面*/
|
142
|
172
|
$("#nameS,#headImg").click(function() {
|
|
@ -150,7 +180,7 @@ $(document).ready(function() {
|
150
|
180
|
"success": function(data) {
|
151
|
181
|
console.log(data);
|
152
|
182
|
if(data.success) {
|
153
|
|
if(data.data.length==0) {
|
|
183
|
if(data.data.length == 0) {
|
154
|
184
|
$("#oArticle").parent().hide();
|
155
|
185
|
$(".aboutTit:contains('相关文章')").hide();
|
156
|
186
|
return;
|
|
@ -180,7 +210,7 @@ $(document).ready(function() {
|
180
|
210
|
if(data.success) {
|
181
|
211
|
var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
|
182
|
212
|
var str = ""
|
183
|
|
str += '<li data-id="'+$html[n].article.articleId+'">'
|
|
213
|
str += '<li data-id="' + $html[n].article.articleId + '">'
|
184
|
214
|
if($html[n].article.articleImg) {
|
185
|
215
|
str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' + $html[n].article.articleImg + ')"></div>'
|
186
|
216
|
} else {
|
|
@ -203,8 +233,8 @@ $(document).ready(function() {
|
203
|
233
|
}
|
204
|
234
|
}
|
205
|
235
|
/*文章跳转*/
|
206
|
|
$("#oArticle").on("click","li",function(){
|
207
|
|
location.href="articalShow.html?articleId="+$(this).attr("data-id");
|
|
236
|
$("#oArticle").on("click", "li", function() {
|
|
237
|
location.href = "articalShow.html?articleId=" + $(this).attr("data-id");
|
208
|
238
|
})
|
209
|
239
|
/*感兴趣的资源*/
|
210
|
240
|
function interestingResources(arry) {
|
|
@ -214,7 +244,7 @@ $(document).ready(function() {
|
214
|
244
|
"success": function(data) {
|
215
|
245
|
console.log(data);
|
216
|
246
|
if(data.success) {
|
217
|
|
if(data.data.length==0) {
|
|
247
|
if(data.data.length == 0) {
|
218
|
248
|
$(".aboutTit:contains('您可能感兴趣的资源')").parent().hide();
|
219
|
249
|
return;
|
220
|
250
|
}
|
|
@ -224,9 +254,9 @@ $(document).ready(function() {
|
224
|
254
|
"data": {
|
225
|
255
|
"keys": arry,
|
226
|
256
|
"resourceId": resourceId,
|
227
|
|
"professorId":professorId
|
|
257
|
"professorId": professorId
|
228
|
258
|
},
|
229
|
|
"traditional":true,
|
|
259
|
"traditional": true,
|
230
|
260
|
dataType: "json",
|
231
|
261
|
'error': function() {
|
232
|
262
|
$.MsgBox.Alert('提示', '服务器连接超时!');
|
|
@ -235,32 +265,32 @@ $(document).ready(function() {
|
235
|
265
|
}
|
236
|
266
|
/*感兴趣资源的html*/
|
237
|
267
|
function interestingResourcesHtml($respond) {
|
238
|
|
for(var i=0;i<$respond.length;i++) {
|
|
268
|
for(var i = 0; i < $respond.length; i++) {
|
239
|
269
|
var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
|
240
|
|
var oStr='';
|
241
|
|
if($respond[i].images.length) {
|
242
|
|
oStr+='<li data-id="'+$respond[i].resourceId+'"><div class="madiaHead resouseHead"style="background-image: url(/data/resource/'+$respond[i].images[0].imageSrc+')"></div>'
|
243
|
|
}else {
|
244
|
|
oStr+='<li data-id="'+$respond[i].resourceId+'"><div class="madiaHead resouseHead"></div>'
|
245
|
|
}
|
246
|
|
oStr+='<div class="madiaInfo">'
|
247
|
|
oStr+='<p class="h1Font">'+$respond[i].resourceName+'</p>'
|
248
|
|
oStr += '<p><span class="h1Font">' + $respond[i].editProfessor.name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
|
249
|
|
oStr+='<p class="h2Font ellipsisSty">用途:<span>'+$respond[i].supportedServices+'</span></p>'
|
250
|
|
oStr+='</div></li>'
|
|
270
|
var oStr = '';
|
|
271
|
if($respond[i].images.length) {
|
|
272
|
oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
|
|
273
|
} else {
|
|
274
|
oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"></div>'
|
|
275
|
}
|
|
276
|
oStr += '<div class="madiaInfo">'
|
|
277
|
oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
|
|
278
|
oStr += '<p><span class="h1Font">' + $respond[i].editProfessor.name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
|
|
279
|
oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
|
|
280
|
oStr += '</div></li>'
|
251
|
281
|
$("#resourceList").append(oStr);
|
252
|
282
|
}
|
253
|
283
|
}
|
254
|
284
|
/*点击资源列表*/
|
255
|
|
$("#resourceList").on("click","li",function(){
|
256
|
|
location.href="resourceShow.html?resourceId="+$(this).attr("data-id");
|
|
285
|
$("#resourceList").on("click", "li", function() {
|
|
286
|
location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
|
257
|
287
|
})
|
258
|
288
|
/*点击咨询*/
|
259
|
289
|
$("#consultin").on("click", function() {
|
260
|
290
|
clickResouceConsultHandler();
|
261
|
291
|
});
|
262
|
|
$("#expertli").on("click",".addbtn",function(){
|
263
|
|
var $this=$(this);
|
|
292
|
$("#expertli").on("click", ".addbtn", function() {
|
|
293
|
var $this = $(this);
|
264
|
294
|
clickResouceConsultHandler($this);
|
265
|
295
|
})
|
266
|
296
|
/*咨询函数*/
|
|
@ -268,11 +298,11 @@ $(document).ready(function() {
|
268
|
298
|
if(userid && userid != "null" && userid != null) {
|
269
|
299
|
ConsultApply();
|
270
|
300
|
if(!professorId) {
|
271
|
|
concultProInfo($this.attr("data-id")); //专家信息common.js中
|
272
|
|
}else{
|
273
|
|
concultProInfo(professorId); //专家信息common.js中
|
|
301
|
concultProInfo($this.attr("data-id")); //专家信息common.js中
|
|
302
|
} else {
|
|
303
|
concultProInfo(professorId); //专家信息common.js中
|
274
|
304
|
}
|
275
|
|
|
|
305
|
|
276
|
306
|
//默认选中资源咨询和标题
|
277
|
307
|
for(var i = 0; i < $("ul.menucon").children().length; i++) {
|
278
|
308
|
$("ul.menucon").children().eq(i).removeClass("clicknow");
|
|
@ -303,189 +333,202 @@ $(document).ready(function() {
|
303
|
333
|
|
304
|
334
|
};
|
305
|
335
|
//点击专家关注
|
306
|
|
$('.attenSpan').click(function(){
|
307
|
|
if (userid && userid != "null" && userid != null) {
|
308
|
|
if($(this).is('.attenSpanyes')){
|
309
|
|
cancelCollectionExpert(professorId,1)
|
310
|
|
}else{
|
311
|
|
collectionExpert(professorId,1);
|
312
|
|
}
|
313
|
|
}else{
|
314
|
|
$.MsgBox.Alert('提示',"请先登录再进行关注");
|
315
|
|
$("#mb_btn_ok").val("去登录");
|
316
|
|
var aele = document.createElement('a');
|
317
|
|
$("#mb_btnbox").append(aele);
|
318
|
|
$("#mb_btnbox a").css({
|
319
|
|
'display': "block",
|
320
|
|
'width': '100%',
|
321
|
|
'height': '40px',
|
322
|
|
'position': 'absolute',
|
323
|
|
'bottom': '-6px',
|
324
|
|
'left': '0'
|
325
|
|
});
|
326
|
|
aele.setAttribute('href', '../login.html');
|
327
|
|
}
|
328
|
|
})
|
|
336
|
$('.attenSpan').click(function() {
|
|
337
|
if(userid && userid != "null" && userid != null) {
|
|
338
|
if($(this).is('.attenSpanyes')) {
|
|
339
|
cancelCollectionExpert(professorId, 1)
|
|
340
|
} else {
|
|
341
|
collectionExpert(professorId, 1);
|
|
342
|
}
|
|
343
|
} else {
|
|
344
|
$.MsgBox.Alert('提示', "请先登录再进行关注");
|
|
345
|
$("#mb_btn_ok").val("去登录");
|
|
346
|
var aele = document.createElement('a');
|
|
347
|
$("#mb_btnbox").append(aele);
|
|
348
|
$("#mb_btnbox a").css({
|
|
349
|
'display': "block",
|
|
350
|
'width': '100%',
|
|
351
|
'height': '40px',
|
|
352
|
'position': 'absolute',
|
|
353
|
'bottom': '-6px',
|
|
354
|
'left': '0'
|
|
355
|
});
|
|
356
|
aele.setAttribute('href', '../login.html');
|
|
357
|
}
|
|
358
|
})
|
329
|
359
|
|
330
|
|
//点击资源收藏
|
331
|
|
$('#attention em').click(function(){
|
332
|
|
if (userid && userid != "null" && userid != null) {
|
333
|
|
if($(this).is('.icon-collected')){
|
334
|
|
cancelCollectionExpert(resourceId,2)
|
335
|
|
}else{
|
336
|
|
collectionExpert(resourceId,2);
|
337
|
|
}
|
338
|
|
}else{
|
339
|
|
$.MsgBox.Alert('提示',"请先登录再进行收藏");
|
340
|
|
$("#mb_btn_ok").val("去登录");
|
341
|
|
var aele = document.createElement('a');
|
342
|
|
$("#mb_btnbox").append(aele);
|
343
|
|
$("#mb_btnbox a").css({
|
344
|
|
'display': "block",
|
345
|
|
'width': '100%',
|
346
|
|
'height': '40px',
|
347
|
|
'position': 'absolute',
|
348
|
|
'bottom': '-6px',
|
349
|
|
'left': '0'
|
|
360
|
//点击资源收藏
|
|
361
|
$('#attention em').click(function() {
|
|
362
|
if(userid && userid != "null" && userid != null) {
|
|
363
|
if($(this).is('.icon-collected')) {
|
|
364
|
cancelCollectionExpert(resourceId, 2)
|
|
365
|
} else {
|
|
366
|
collectionExpert(resourceId, 2);
|
|
367
|
}
|
|
368
|
} else {
|
|
369
|
$.MsgBox.Alert('提示', "请先登录再进行收藏");
|
|
370
|
$("#mb_btn_ok").val("去登录");
|
|
371
|
var aele = document.createElement('a');
|
|
372
|
$("#mb_btnbox").append(aele);
|
|
373
|
$("#mb_btnbox a").css({
|
|
374
|
'display': "block",
|
|
375
|
'width': '100%',
|
|
376
|
'height': '40px',
|
|
377
|
'position': 'absolute',
|
|
378
|
'bottom': '-6px',
|
|
379
|
'left': '0'
|
|
380
|
});
|
|
381
|
aele.setAttribute('href', '../login.html');
|
|
382
|
}
|
|
383
|
})
|
|
384
|
|
|
385
|
/*判断是非关注专家*/
|
|
386
|
function ifCollection(getid, num) {
|
|
387
|
var data = {
|
|
388
|
"professorId": userid,
|
|
389
|
"watchObject": getid
|
|
390
|
}
|
|
391
|
//alert(JSON.stringify(data))
|
|
392
|
$.ajax({
|
|
393
|
url: "/ajax/watch/hasWatch",
|
|
394
|
data: data,
|
|
395
|
dataType: 'json', //数据格式类型
|
|
396
|
type: 'get', //http请求类型
|
|
397
|
timeout: 10000,
|
|
398
|
async: true,
|
|
399
|
success: function(data) {
|
|
400
|
if(num == 1) {
|
|
401
|
if(data.success && data.data != null) {
|
|
402
|
$('.attenSpan').addClass("attenSpanyes");
|
|
403
|
$('.attenSpan').text('已关注');
|
|
404
|
zjreturnId = data.data.watchObject;
|
|
405
|
} else {
|
|
406
|
$('.attenSpan').removeClass("attenSpanyes");
|
|
407
|
$('.attenSpan').text('关注');
|
|
408
|
}
|
|
409
|
}
|
|
410
|
if(num == 2) {
|
|
411
|
if(data.success && data.data != null) {
|
|
412
|
$('#attention em').addClass("icon-collected").removeClass("icon-collect");
|
|
413
|
wzreturnId = data.data.watchObject;
|
|
414
|
} else {
|
|
415
|
$('#attention em').removeClass("icon-collected").addClass("icon-collect");
|
|
416
|
}
|
|
417
|
}
|
|
418
|
|
|
419
|
},
|
|
420
|
error: function() {
|
|
421
|
$.MsgBox.Alert('提示', "服务器链接超时");
|
|
422
|
}
|
350
|
423
|
});
|
351
|
|
aele.setAttribute('href', '../login.html');
|
352
|
424
|
}
|
353
|
|
})
|
354
|
425
|
|
355
|
|
/*判断是非关注专家*/
|
356
|
|
function ifCollection(getid,num) {
|
357
|
|
var data = {"professorId": userid,"watchObject": getid}
|
358
|
|
//alert(JSON.stringify(data))
|
359
|
|
$.ajax({
|
360
|
|
url:"/ajax/watch/hasWatch",
|
361
|
|
data:data,
|
362
|
|
dataType: 'json', //数据格式类型
|
363
|
|
type: 'get', //http请求类型
|
364
|
|
timeout: 10000,
|
365
|
|
async: true,
|
366
|
|
success: function(data) {
|
367
|
|
if(num==1){
|
368
|
|
if(data.success && data.data != null) {
|
369
|
|
$('.attenSpan').addClass("attenSpanyes");
|
370
|
|
$('.attenSpan').text('已关注');
|
371
|
|
zjreturnId = data.data.watchObject;
|
372
|
|
} else {
|
373
|
|
$('.attenSpan').removeClass("attenSpanyes");
|
374
|
|
$('.attenSpan').text('关注');
|
375
|
|
}
|
|
426
|
/*关注专家*/
|
|
427
|
function collectionExpert(watchObject, num) {
|
|
428
|
if(num == 1) {
|
|
429
|
var data = {
|
|
430
|
"professorId": userid,
|
|
431
|
"watchObject": watchObject,
|
|
432
|
"watchType": 1
|
376
|
433
|
}
|
377
|
|
if(num==2){
|
378
|
|
if(data.success && data.data != null) {
|
379
|
|
$('#attention em').addClass("icon-collected").removeClass("icon-collect");
|
380
|
|
wzreturnId = data.data.watchObject;
|
381
|
|
} else {
|
382
|
|
$('#attention em').removeClass("icon-collected").addClass("icon-collect");
|
383
|
|
}
|
|
434
|
} else {
|
|
435
|
var data = {
|
|
436
|
"professorId": userid,
|
|
437
|
"watchObject": watchObject,
|
|
438
|
"watchType": 3
|
384
|
439
|
}
|
385
|
|
|
386
|
|
},
|
387
|
|
error: function() {
|
388
|
|
$.MsgBox.Alert('提示',"服务器链接超时");
|
389
|
440
|
}
|
390
|
|
});
|
391
|
|
}
|
|
441
|
$.ajax({
|
|
442
|
url: "/ajax/watch",
|
|
443
|
data: data,
|
|
444
|
dataType: 'json', //数据格式类型
|
|
445
|
type: 'POST', //http请求类型
|
|
446
|
timeout: 10000,
|
|
447
|
async: false,
|
|
448
|
success: function(data) {
|
|
449
|
if(num == 1) {
|
|
450
|
if(data.success) {
|
|
451
|
$('.attenSpan').addClass("attenSpanyes");
|
|
452
|
$('.attenSpan').text('已关注');
|
|
453
|
zjreturnId = data.data.watchObject;
|
|
454
|
}
|
|
455
|
}
|
392
|
456
|
|
393
|
|
/*关注专家*/
|
394
|
|
function collectionExpert(watchObject,num) {
|
395
|
|
if(num==1){
|
396
|
|
var data = {"professorId": userid,"watchObject": watchObject,"watchType": 1}
|
397
|
|
}else{
|
398
|
|
var data = {"professorId": userid,"watchObject": watchObject,"watchType": 3}
|
399
|
|
}
|
400
|
|
$.ajax({
|
401
|
|
url:"/ajax/watch",
|
402
|
|
data:data,
|
403
|
|
dataType: 'json', //数据格式类型
|
404
|
|
type: 'POST', //http请求类型
|
405
|
|
timeout: 10000,
|
406
|
|
async: false,
|
407
|
|
success: function(data) {
|
408
|
|
if(num==1){
|
409
|
|
if(data.success) {
|
410
|
|
$('.attenSpan').addClass("attenSpanyes");
|
411
|
|
$('.attenSpan').text('已关注');
|
412
|
|
zjreturnId = data.data.watchObject;
|
|
457
|
if(num == 2) {
|
|
458
|
if(data.success) {
|
|
459
|
$('#attention em').addClass("icon-collected").removeClass("icon-collect");
|
|
460
|
wzreturnId = data.data.watchObject;
|
|
461
|
}
|
413
|
462
|
}
|
|
463
|
|
|
464
|
},
|
|
465
|
error: function() {
|
|
466
|
$.MsgBox.Alert('提示', "服务器链接超时");
|
414
|
467
|
}
|
415
|
|
|
416
|
|
if(num==2){
|
417
|
|
if(data.success) {
|
418
|
|
$('#attention em').addClass("icon-collected").removeClass("icon-collect");
|
419
|
|
wzreturnId = data.data.watchObject;
|
|
468
|
});
|
|
469
|
}
|
|
470
|
|
|
471
|
/*取消收藏专家*/
|
|
472
|
function cancelCollectionExpert(watchObject, num) {
|
|
473
|
$.ajax({
|
|
474
|
url: "/ajax/watch/delete",
|
|
475
|
data: {
|
|
476
|
professorId: userid,
|
|
477
|
watchObject: watchObject
|
|
478
|
},
|
|
479
|
dataType: 'json', //数据格式类型
|
|
480
|
type: 'post', //http请求类型
|
|
481
|
timeout: 10000,
|
|
482
|
async: true,
|
|
483
|
success: function(data) {
|
|
484
|
console.log(data.success)
|
|
485
|
if(num == 1) {
|
|
486
|
if(data.success) {
|
|
487
|
$('.attenSpan').removeClass("attenSpanyes");
|
|
488
|
$('.attenSpan').text('关注');
|
|
489
|
}
|
|
490
|
}
|
|
491
|
if(num == 2) {
|
|
492
|
if(data.success) {
|
|
493
|
$('#attention em').removeClass("icon-collected").addClass("icon-collect");
|
|
494
|
}
|
420
|
495
|
}
|
421
|
|
}
|
422
|
|
|
423
|
|
},
|
424
|
|
error: function() {
|
425
|
|
$.MsgBox.Alert('提示',"服务器链接超时");
|
426
|
|
}
|
427
|
|
});
|
428
|
|
}
|
429
|
496
|
|
430
|
|
/*取消收藏专家*/
|
431
|
|
function cancelCollectionExpert(watchObject,num) {
|
432
|
|
$.ajax({
|
433
|
|
url:"/ajax/watch/delete",
|
434
|
|
data: {
|
435
|
|
professorId: userid,
|
436
|
|
watchObject: watchObject
|
437
|
|
},
|
438
|
|
dataType: 'json', //数据格式类型
|
439
|
|
type: 'post', //http请求类型
|
440
|
|
timeout: 10000,
|
441
|
|
async: true,
|
442
|
|
success: function(data) {
|
443
|
|
console.log(data.success)
|
444
|
|
if(num==1){
|
445
|
|
if(data.success) {
|
446
|
|
$('.attenSpan').removeClass("attenSpanyes");
|
447
|
|
$('.attenSpan').text('关注');
|
448
|
|
}
|
449
|
|
}
|
450
|
|
if(num==2){
|
451
|
|
if(data.success) {
|
452
|
|
$('#attention em').removeClass("icon-collected").addClass("icon-collect");
|
453
|
|
}
|
|
497
|
},
|
|
498
|
error: function(data) {
|
|
499
|
$.MsgBox.Alert('提示', "服务器链接超时");
|
454
|
500
|
}
|
455
|
|
|
456
|
|
},
|
457
|
|
error: function(data) {
|
458
|
|
$.MsgBox.Alert('提示',"服务器链接超时");
|
459
|
|
}
|
460
|
|
});
|
|
501
|
});
|
461
|
502
|
|
462
|
|
}
|
463
|
|
//资源浏览量
|
464
|
|
function pageViewsVal(){
|
465
|
|
$.ajax({
|
466
|
|
"url" : "/ajax/resource/pageViews",
|
467
|
|
"type" : "POST" ,
|
468
|
|
"dataType" : "json",
|
469
|
|
"data" :{"resourceId":resourceId},
|
470
|
|
"success" : function(data) {
|
471
|
|
console.log(data);
|
472
|
|
if (data.success){
|
|
503
|
}
|
|
504
|
//资源浏览量
|
|
505
|
function pageViewsVal() {
|
|
506
|
$.ajax({
|
|
507
|
"url": "/ajax/resource/pageViews",
|
|
508
|
"type": "POST",
|
|
509
|
"dataType": "json",
|
|
510
|
"data": {
|
|
511
|
"resourceId": resourceId
|
|
512
|
},
|
|
513
|
"success": function(data) {
|
|
514
|
console.log(data);
|
|
515
|
if(data.success) {f(data.success) {}
|
|
516
|
},
|
|
517
|
"error": function() {
|
|
518
|
$.MsgBox.Alert('提示', '链接服务器超时')
|
473
|
519
|
}
|
474
|
|
if(data.success) {},
|
475
|
|
"error":function(){
|
476
|
|
$.MsgBox.Alert('提示','链接服务器超时')
|
477
|
|
}
|
478
|
|
});
|
479
|
|
}
|
480
|
|
pageViewsVal();
|
481
|
|
selUse();
|
|
520
|
});
|
|
521
|
}
|
|
522
|
pageViewsVal();
|
|
523
|
selUse();
|
|
524
|
|
482
|
525
|
function selUse() {
|
483
|
526
|
$.ajax({
|
484
|
527
|
url: "/ajax/resource/qaLinkman",
|
485
|
528
|
type: "GET",
|
486
|
529
|
timeout: 10000,
|
487
|
530
|
dataType: "json",
|
488
|
|
async:true,
|
|
531
|
async: true,
|
489
|
532
|
data: {
|
490
|
533
|
"resourceId": resourceId,
|
491
|
534
|
},
|
|
@ -500,37 +543,38 @@ selUse();
|
500
|
543
|
}
|
501
|
544
|
})
|
502
|
545
|
}
|
|
546
|
|
503
|
547
|
function unauthUser($res) {
|
504
|
|
var osting=""
|
505
|
|
for(var i = 0; i < $res.length; i++) {
|
506
|
|
var img;
|
507
|
|
var styC="";
|
508
|
|
var oClass = autho($res[i].professor.authType, $res[i].professor.orgAuth, $res[i].professor.authStatus);
|
509
|
|
var oTitle="";
|
510
|
|
if($res[i].professor.title) {
|
511
|
|
oTitle=$res[i].professor.title;
|
512
|
|
}else{
|
513
|
|
if($res[i].professor.office) {
|
514
|
|
oTitle=$res[i].professor.office;
|
|
548
|
var osting = ""
|
|
549
|
for(var i = 0; i < $res.length; i++) {
|
|
550
|
var img;
|
|
551
|
var styC = "";
|
|
552
|
var oClass = autho($res[i].professor.authType, $res[i].professor.orgAuth, $res[i].professor.authStatus);
|
|
553
|
var oTitle = "";
|
|
554
|
if($res[i].professor.title) {
|
|
555
|
oTitle = $res[i].professor.title;
|
|
556
|
} else {
|
|
557
|
if($res[i].professor.office) {
|
|
558
|
oTitle = $res[i].professor.office;
|
|
559
|
}
|
515
|
560
|
}
|
516
|
|
}
|
517
|
|
if($res[i].professor.hasHeadImage) {
|
|
561
|
if($res[i].professor.hasHeadImage) {
|
518
|
562
|
img = "/images/head/" + $res[i].professor.id + "_l.jpg";
|
519
|
563
|
} else {
|
520
|
564
|
img = "../images/default-photo.jpg"
|
521
|
565
|
}
|
522
|
|
var oSt = '<li class="flexCenter">'
|
523
|
|
oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url('+img+');"></div>'
|
524
|
|
oSt += '<div class = "madiaInfo">'
|
525
|
|
oSt += '<p class = "ellipsisSty">'
|
526
|
|
oSt += '<span class = "h1Font" id="name">'+$res[i].professor.name+'</span><em class="authiconNew '+oClass.sty+'" title="'+oClass.title+'"></em >'
|
527
|
|
oSt += '</p>'
|
528
|
|
oSt += '<p class="h2Font ellipsisSty">'+oTitle+'</p>'
|
529
|
|
oSt += '</div>'
|
530
|
|
oSt += '<span class="addbtn" data-id="'+$res[i].professor.id+'">咨询</span>'
|
531
|
|
oSt += '</li>'
|
532
|
|
osting+=oSt;
|
|
566
|
var oSt = '<li class="flexCenter">'
|
|
567
|
oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
|
|
568
|
oSt += '<div class = "madiaInfo">'
|
|
569
|
oSt += '<p class = "ellipsisSty">'
|
|
570
|
oSt += '<span class = "h1Font" id="name">' + $res[i].professor.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
|
|
571
|
oSt += '</p>'
|
|
572
|
oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
|
|
573
|
oSt += '</div>'
|
|
574
|
oSt += '<span class="addbtn" data-id="' + $res[i].professor.id + '">咨询</span>'
|
|
575
|
oSt += '</li>'
|
|
576
|
osting += oSt;
|
|
577
|
}
|
|
578
|
$("#expertli").html(osting);
|
533
|
579
|
}
|
534
|
|
$("#expertli").html(osting);
|
535
|
|
}
|
536
|
|
})
|
|
580
|
})
|