|
@ -1,669 +1,690 @@
|
1
|
|
$(function(){
|
2
|
|
var newc=GetQueryString("lookFor");
|
3
|
|
if(newc==0||newc==""){
|
4
|
|
var c=0;
|
5
|
|
}else{
|
6
|
|
var c=1;
|
7
|
|
// $(".lookwho option[value='1']").attr("selected","selected");
|
8
|
|
$("#div_select").text("找资源");
|
9
|
|
}
|
10
|
|
/*
|
11
|
|
var lookFor2 = 0;
|
12
|
|
$("#lookFor2 ul li").on("click",function(){
|
13
|
|
lookFor2=$(this).index();
|
14
|
|
});
|
15
|
|
//enter绑定时间
|
16
|
|
$("#searchContent").keydown(function(e){
|
17
|
|
if(e.which==13) {
|
18
|
|
synContent(2);
|
19
|
|
synContent(1);
|
20
|
|
var searchContent = $("#searchContent").val();
|
21
|
|
if(lookFor2 = 1){
|
22
|
|
$("#div_select").text("找资源");
|
23
|
|
location.href = "search.html?searchContent=" + encodeURI(searchContent);
|
24
|
|
}
|
25
|
|
}
|
26
|
|
|
27
|
|
})*/
|
28
|
|
|
29
|
|
var userid = $.cookie("userid");
|
30
|
|
var subject;
|
31
|
|
var subb=$.trim(GetQueryString("subject"));
|
32
|
|
var industry;
|
33
|
|
var pageSize;
|
34
|
|
var sub="SUBJECT";
|
35
|
|
var indu="INDUSTRY";
|
36
|
|
var address= $("#address .colorbg")[0].title;
|
37
|
|
$("#searchContent").val(GetQueryString("searchContent"));
|
38
|
|
$("#hsearchContent").val(GetQueryString("searchContent"));
|
39
|
|
var key=$("#searchContent").val();
|
40
|
|
var getData = function (key,subject,industry,pageSize,pageNo,isbind,add)
|
41
|
|
{
|
42
|
|
if(c==0)
|
43
|
|
{
|
44
|
|
$.ajax({"url" : "/ajax/professor/pqBaseInfo",
|
45
|
|
"type" : "GET",
|
46
|
|
"data" : {"key":key,"subject":subject,"industry":industry,"pageSize":pageSize,"pageNo":pageNo,"address":add},
|
47
|
|
"contentType" : "application/x-www-form-urlencoded",
|
48
|
|
"success" : function($data) {
|
49
|
|
if ($data.success) {
|
50
|
|
//console.log($data);
|
51
|
|
$("#professorList").html("");
|
52
|
|
for(var i = 0 ; i < $data.data.data.length ; i++){
|
53
|
|
//创建HTML标签
|
54
|
|
var dataHtml = "<div class='item'>";
|
55
|
|
dataHtml += "<a class='infoi' href='information-brow.html?professorId="+$data.data.data[i].id+"' ><div class='photo1 headRadius'>"
|
56
|
|
if($data.data.data[i].hasHeadImage) {
|
57
|
|
dataHtml += "<img class='images' style='width:100%;' src='/images/head/"+$data.data.data[i].id+"_l.jpg'/></div></a>";
|
58
|
|
}
|
59
|
|
else {
|
60
|
|
dataHtml += "<img class='images' style='width:100%;' src='/images/default-photo.jpg'/></div></a>";
|
61
|
|
}
|
62
|
|
dataHtml += "<div class='synopsis'>";
|
63
|
|
dataHtml += "<a href='javascript:void();' class='named'>";
|
64
|
|
if(typeof($data.data.data[i].name) !== "undefined"){
|
65
|
|
dataHtml += $data.data.data[i].name;
|
66
|
|
}
|
67
|
|
dataHtml += "</a><a href='information-brow.html?professorId="+$data.data.data[i].id+"' class='modify'></a>";
|
68
|
|
dataHtml += "<div class='position'>";
|
69
|
|
if($data.data.data[i].office){
|
70
|
|
dataHtml += $data.data.data[i].office+", ";
|
71
|
|
}
|
72
|
|
if($data.data.data[i].title){
|
73
|
|
dataHtml += $data.data.data[i].title+", ";
|
74
|
|
}
|
75
|
|
if($data.data.data[i].department){
|
76
|
|
dataHtml += $data.data.data[i].department+", ";
|
77
|
|
}
|
78
|
|
if($data.data.data[i].orgName){
|
79
|
|
dataHtml += $data.data.data[i].orgName;
|
80
|
|
}
|
81
|
|
if($data.data.data[i].address){
|
82
|
|
dataHtml += " | "+$data.data.data[i].address;
|
83
|
|
}
|
84
|
|
dataHtml += "</div>";
|
85
|
|
dataHtml += "<div class='ellipsisbox science'>";
|
86
|
|
if(typeof($data.data.data[i].subject) !== "undefined"){
|
87
|
|
dataHtml +="<p>学术领域:"+ $data.data.data[i].subject +"</p>";
|
88
|
|
}
|
89
|
|
dataHtml += "</div>";
|
90
|
|
dataHtml += "<div class='ellipsisbox industry'>";
|
91
|
|
if(typeof($data.data.data[i].industry) !== "undefined"){
|
92
|
|
dataHtml += "<p>应用行业:"+ $data.data.data[i].industry +"</p>";
|
93
|
|
}
|
94
|
|
if($data.data.data[i].researchAreas.length ){
|
95
|
|
dataHtml += "<p>研究方向:"+$data.data.data[i].researchAreas[0].caption +"</p>";
|
96
|
|
//console.log($data.data.data[i].researchAreas[0].caption);
|
97
|
|
}
|
98
|
|
|
99
|
|
dataHtml += "</div>";
|
100
|
|
dataHtml += "</div>";
|
101
|
|
if($data.data.data[i].id!=userid){
|
102
|
|
dataHtml += "<div class='operbox'><span class='operbtn onlyConsultbtn' id='"+$data.data.data[i]['id']+"'>咨询</span></div>";
|
103
|
|
}
|
104
|
|
|
105
|
|
|
106
|
|
$("#professorList").append(dataHtml);
|
107
|
|
if($data.data.data[i].authentication==false) {
|
108
|
|
$(".modify").eq(i).css("background-image","url(../images/icon-unauth.png)")
|
109
|
|
}
|
110
|
|
//点击查看当前信息
|
111
|
|
(function(i){
|
112
|
|
$('.photo1').click(function()
|
113
|
|
{
|
114
|
|
if(userid==$data.data.data[i].id)
|
115
|
|
{
|
116
|
|
$(".infoi").attr("href","information.html");
|
117
|
|
}
|
118
|
|
})
|
119
|
|
}
|
120
|
|
|
121
|
|
)(i);
|
122
|
|
//点击查看当前信息
|
123
|
|
(function(i){
|
124
|
|
$('.synopsis').eq(i).click(function()
|
125
|
|
{
|
126
|
|
if(userid==$data.data.data[i].id)
|
127
|
|
{
|
128
|
|
location.href='information.html';
|
129
|
|
}else{
|
130
|
|
location.href='information-brow.html?professorId='+$data.data.data[i].id;
|
131
|
|
}
|
132
|
|
|
133
|
|
})
|
134
|
|
}
|
135
|
|
|
136
|
|
)(i);
|
137
|
|
|
138
|
|
}
|
139
|
|
//找专家点击咨询
|
140
|
|
$(".onlyConsultbtn").bind("click",clickSeachProConsultHandler);
|
141
|
|
|
142
|
|
if(isbind == true){
|
143
|
|
$(".tcdPageCode").createPage({
|
144
|
|
pageCount:Math.ceil($data.data.total/pageSize),
|
145
|
|
current:$data.data.pageNo,
|
146
|
|
backFn:function(p){
|
147
|
|
getData(key,subject,industry,pageSize,p,false);
|
148
|
|
}
|
149
|
|
});
|
150
|
|
}
|
151
|
|
|
152
|
|
} else {
|
153
|
|
$.MsgBox.Alert("message",$data.msg);
|
154
|
|
}
|
155
|
|
}
|
156
|
|
});
|
157
|
|
}
|
158
|
|
else
|
159
|
|
{
|
160
|
|
//查询我的所有资源
|
161
|
|
$.ajax({
|
162
|
|
"url" :"/ajax/resource/pq",
|
163
|
|
"type" : "get",
|
164
|
|
"data" : {"key":key,"subject":subject,"industry":industry,"pageSize":pageSize,"pageNo":pageNo,"address":add},
|
165
|
|
"contentType" : "application/x-www-form-urlencoded",
|
166
|
|
"success" : function(data)
|
167
|
|
{console.log(data);
|
168
|
|
if (data.success)
|
169
|
|
{
|
170
|
|
$("#professorList").html("");
|
171
|
|
var $da=data.data.data;
|
172
|
|
for(var i=0;i<$da.length;i++)
|
173
|
|
{
|
174
|
|
var add='<div class="item">'
|
175
|
|
add+='<a class="resourcephoto headRadius" ><img src="" class="resourceImg remess" width="100%" height="100%" resourceId='+$da[i].resourceId+'></a>'
|
176
|
|
add+='<div class="synopsis" style="width:66%;">'
|
177
|
|
add+='<div class="cousultName"><a class="resouname" href="javascript:void();">'+$da[i].resourceName+'</a></div>'
|
178
|
|
if($da[i].professor.name){
|
179
|
|
add+='<div class="belongname">'+$da[i].professor.name+'<img class="modicon" src="images/onauth.png" width="14" ></div>'
|
180
|
|
}
|
181
|
|
if($da[i].professor.title==undefined){
|
182
|
|
$da[i].professor.title="";
|
183
|
|
}
|
184
|
|
if($da[i].professor.department==undefined){
|
185
|
|
$da[i].professor.department="";
|
186
|
|
}
|
187
|
|
if($da[i].professor.orgName==undefined){
|
188
|
|
$da[i].professor.orgName="";
|
189
|
|
}
|
190
|
|
add+='<div class="positionbox">'+$da[i].professor.title+$da[i].professor.department+$da[i].professor.orgName+'</div>'
|
191
|
|
if($da[i].subject)
|
192
|
|
{
|
193
|
|
add+='<div class="ellipsisbox sciencebox"><p>学术领域:'+$da[i].subject+'</p></div>'
|
194
|
|
}
|
195
|
|
if($da[i].industry)
|
196
|
|
{
|
197
|
|
add+='<div class="ellipsisbox industrybox"><p>应用行业:'+$da[i].industry+'</p></div>'
|
198
|
|
}
|
199
|
|
if($da[i].supportedServices)
|
200
|
|
{
|
201
|
|
add+='<div class="ellipsisbox provideservice"><p>应用用途:'+$da[i].supportedServices+'</p></div></div>'
|
202
|
|
}
|
203
|
|
add+='<div class="operbox"><span class="operbtn consultbtn" id="'+$da[i]["professor"]["id"]+'">咨询</span><span class="operbtn applybtn appl" resourceId='+$da[i].resourceId+' resourceName='+$da[i].resourceName+' professor='+$da[i].professor.name+'>申请</span></div>'
|
204
|
|
add+='</div>'
|
205
|
|
var $add=$(add);
|
206
|
|
$("#professorList").append($add);
|
207
|
|
if($da[i].professor.authentication==false) {
|
208
|
|
$add.find(".modicon").attr("src","images/icon-unauth.png");
|
209
|
|
}
|
210
|
|
if(data.data.data[i].images.length)
|
211
|
|
{
|
212
|
|
$add.find(".resourceImg").attr("src","/images/resource/"+$da[i].resourceId+".jpg");
|
213
|
|
}
|
214
|
|
else{
|
215
|
|
$add.find(".resourceImg").attr("src","/images/default-resource.jpg");
|
216
|
|
}
|
217
|
|
}
|
218
|
|
if(isbind == true){
|
219
|
|
$(".tcdPageCode").createPage({
|
220
|
|
pageCount:Math.ceil(data.data.total/pageSize),
|
221
|
|
current:data.data.pageNo,
|
222
|
|
backFn:function(p){
|
223
|
|
getData(key,subject,industry,pageSize,p,false);
|
224
|
|
}
|
225
|
|
});
|
226
|
|
}
|
227
|
|
}
|
228
|
|
else
|
229
|
|
{
|
230
|
|
$.MsgBox.Alert("message","请登录");
|
231
|
|
}
|
232
|
|
|
233
|
|
//找资源中点击咨询
|
234
|
|
$(".consultbtn").bind("click",clickResouceConsultHandler);
|
235
|
|
},
|
236
|
|
});
|
237
|
|
}
|
238
|
|
|
239
|
|
}
|
240
|
|
|
241
|
|
var subjectList = function (){
|
242
|
|
$.get("../ajax/dataDict/"+sub,function(data){
|
243
|
|
if(data.success){
|
244
|
|
if(data.data.length <=10) {
|
245
|
|
$(".andmore").eq(0).hide();
|
246
|
|
}
|
247
|
|
$("#subject").find(".sub").remove();
|
248
|
|
for(var i = 0 ; i < data.data.length; i++){
|
249
|
|
$("#subject").append("<a href='#' class='sub'title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");
|
250
|
|
if(subb) {
|
251
|
|
if(subb==data.data[i].caption) {
|
252
|
|
$('.sub').eq(i).addClass('colorbg').siblings().removeClass("colorbg");
|
253
|
|
}
|
254
|
|
}
|
255
|
|
if(i>20)
|
256
|
|
break;
|
257
|
|
}
|
258
|
|
}else{
|
259
|
|
$.MsgBox.Alert("message",data.msg);
|
260
|
|
}
|
261
|
|
})
|
262
|
|
}
|
263
|
|
var Address = function (){
|
264
|
|
$.get("../ajax/dataDict/ADDRESS",function(data){
|
265
|
|
if(data.success){
|
266
|
|
if(data.data.length <=10) {
|
267
|
|
$(".andmore").eq(2).hide();
|
268
|
|
}
|
269
|
|
for(var i = 0 ; i < data.data.length; i++){
|
270
|
|
$("#address").append("<a href='#' title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");
|
271
|
|
if(i>20)
|
272
|
|
break;
|
273
|
|
}
|
274
|
|
}else{
|
275
|
|
$.MsgBox.Alert("message",data.msg);
|
276
|
|
}
|
277
|
|
})
|
278
|
|
}
|
279
|
|
var industryList = function (){
|
280
|
|
$.get("../ajax/dataDict/"+indu,function(data){
|
281
|
|
if(data.success){
|
282
|
|
if(data.data.length <=10) {
|
283
|
|
$(".andmore").eq(1).hide();
|
284
|
|
}
|
285
|
|
$("#industry").find(".indu").remove();
|
286
|
|
for(var i = 0 ; i < data.data.length; i++){
|
287
|
|
$("#industry").append("<a href='#' class='indu'title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");
|
288
|
|
if(i>20)
|
289
|
|
break;
|
290
|
|
}
|
291
|
|
}else{
|
292
|
|
$.MsgBox.Alert("message",data.msg);
|
293
|
|
}
|
294
|
|
})
|
295
|
|
}
|
296
|
|
var findProfessor = function (){
|
297
|
|
if(subb){
|
298
|
|
subject=subb;
|
299
|
|
}else{
|
300
|
|
subject = $("#subject .colorbg")[0].title;
|
301
|
|
}
|
302
|
|
industry = $("#industry .colorbg")[0].title;
|
303
|
|
pageSize = 10;
|
304
|
|
getData(key,subject,industry,pageSize,1,true,address);
|
305
|
|
}
|
306
|
|
$("#search1").on("click",function(){
|
307
|
|
$("#hsearchContent").val($("#searchContent").val());
|
308
|
|
key = $("#searchContent").val();
|
309
|
|
$("#professorList").remove();
|
310
|
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
311
|
|
$(".tcdPageCode").remove();
|
312
|
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
313
|
|
getData(key,subject,industry,10,1,true,address);
|
314
|
|
})
|
315
|
|
$("#hsearch1").on("click",function(){
|
316
|
|
$("#searchContent").val($("#hsearchContent").val());
|
317
|
|
key = $("#hsearchContent").val();
|
318
|
|
$("#professorList").remove();
|
319
|
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
320
|
|
$(".tcdPageCode").remove();
|
321
|
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
322
|
|
getData(key,subject,industry,10,1,true,address);
|
323
|
|
})
|
324
|
|
|
325
|
|
subjectList();
|
326
|
|
industryList();
|
327
|
|
findProfessor();
|
328
|
|
Address();
|
329
|
|
$(".class1").eq(0).on("click","a",function (){
|
330
|
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
331
|
|
key=$("#searchContent").val();
|
332
|
|
subject = $(this).attr('title');
|
333
|
|
$("#professorList").remove();
|
334
|
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
335
|
|
$(".tcdPageCode").remove();
|
336
|
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
337
|
|
getData(key,subject,industry,10,1,true,address);
|
338
|
|
|
339
|
|
});
|
340
|
|
$(".class1").eq(1).on("click","a",function (){
|
341
|
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
342
|
|
industry = $(this).attr('title');
|
343
|
|
key=$("#searchContent").val();
|
344
|
|
$("#professorList").remove();
|
345
|
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
346
|
|
$(".tcdPageCode").remove();
|
347
|
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
348
|
|
getData(key,subject,industry,10,1,true,address);
|
349
|
|
});
|
350
|
|
$(".class1").eq(2).on("click","a",function (){
|
351
|
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
352
|
|
address = $(this).attr('title');
|
353
|
|
key=$("#searchContent").val();
|
354
|
|
$("#professorList").remove();
|
355
|
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
356
|
|
$(".tcdPageCode").remove();
|
357
|
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
358
|
|
getData(key,subject,industry,10,1,true,address);
|
359
|
|
});
|
360
|
|
/*搜索分类展开*/
|
361
|
|
var listi = 0;
|
362
|
|
$(".andmore").click(function() {
|
363
|
|
$(this).find(".updown").css("background-position", "left");
|
364
|
|
$(this).parent().css("height", "52px");
|
365
|
|
if (listi % 2 == 0) {
|
366
|
|
|
367
|
|
} else {
|
368
|
|
$(this).find(".updown").css("background-position", "right");
|
369
|
|
$(this).parent().css("height", "auto");
|
370
|
|
|
371
|
|
}
|
372
|
|
listi++;
|
373
|
|
})
|
374
|
|
|
375
|
|
/*搜索分类背景切换*/
|
376
|
|
$(".class1").on("click","a",function (){
|
377
|
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
378
|
|
})
|
379
|
|
|
380
|
|
/*专家、资源菜单切换*/
|
381
|
|
// $(".lookwho").change(function(){
|
382
|
|
// //$(this).addClass("tabcurrent").siblings().removeClass("tabcurrent");
|
383
|
|
// //$(".aboutcon").eq($(this).index()).show().siblings().hide();
|
384
|
|
// if($(this).value == "0"){
|
385
|
|
// $(".aboutpro").show();
|
386
|
|
// $(".aboutresou").hide();
|
387
|
|
// }
|
388
|
|
// else{
|
389
|
|
// $(".aboutresou").show();
|
390
|
|
// $(".aboutpro").hide();
|
391
|
|
// }
|
392
|
|
//
|
393
|
|
// })
|
394
|
|
|
395
|
|
//判断是搜寻专家还是资源
|
396
|
|
$(".lishow li").on("click",function(){
|
397
|
|
c=$(this).index();
|
398
|
|
|
399
|
|
$("#industry").find(".no2").addClass("colorbg").siblings().removeClass("colorbg");
|
400
|
|
$("#subject").find(".nox").addClass("colorbg").siblings().removeClass("colorbg");
|
401
|
|
key=$("#searchContent").val();
|
402
|
|
industry="";
|
403
|
|
subject="";
|
404
|
|
address="";
|
405
|
|
if(c==0){
|
406
|
|
sub="SUBJECT";
|
407
|
|
indu="INDUSTRY";
|
408
|
|
}
|
409
|
|
else{
|
410
|
|
sub="SUBJECT";
|
411
|
|
indu="INDUSTRY";
|
412
|
|
|
413
|
|
}
|
414
|
|
industryList();
|
415
|
|
subjectList();
|
416
|
|
Address();
|
417
|
|
$("#professorList").remove();
|
418
|
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
419
|
|
$(".tcdPageCode").remove();
|
420
|
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
421
|
|
getData(key,subject,industry,pageSize,1,true,address);
|
422
|
|
});
|
423
|
|
//查询资源详细信息
|
424
|
|
$('.about').on("click",'.remess',function(){
|
425
|
|
var resourceID=$(this).attr("resourceId");
|
426
|
|
ResourceMessage();
|
427
|
|
$.ajax({
|
428
|
|
"url":"/ajax/resource/"+resourceID,
|
429
|
|
"type":"get",
|
430
|
|
"async": true,
|
431
|
|
"success":function(info){
|
432
|
|
if(info.success)
|
433
|
|
{
|
434
|
|
$("#resourceName").text(info.data.resourceName);
|
435
|
|
$("#supportedServices").text(info.data.supportedServices);
|
436
|
|
$("#hopePayMethod").text(info.data.hopePayMethod) ;
|
437
|
|
$("#cooperationNotes").text(info.data.cooperationNotes) ;
|
438
|
|
$("#subject").text(info.data.subject);
|
439
|
|
$("#industry").text(info.data.industry);
|
440
|
|
$("#descp").text(info.data.descp);
|
441
|
|
$("#professor").text(info.data.professor.name);
|
442
|
|
$(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
|
443
|
|
$(".resouImage").load(function(){})
|
444
|
|
.error(function(){
|
445
|
|
$(this).attr("src","/images/default-resource.jpg");
|
446
|
|
});
|
447
|
|
limitHeight();
|
448
|
|
}
|
449
|
|
else
|
450
|
|
{
|
451
|
|
$.MsgBox.Alert('message',"系统异常!");
|
452
|
|
}
|
453
|
|
},
|
454
|
|
"error":function(){$.MsgBox.Alert('message','failed')}
|
455
|
|
});
|
456
|
|
})
|
457
|
|
//资源申请
|
458
|
|
function getIdentity(professorId){
|
459
|
|
$.ajax({
|
460
|
|
"url":"ajax/professor/"+professorId,
|
461
|
|
"type":"get",
|
462
|
|
"async": false,
|
463
|
|
"success":function(data){
|
464
|
|
if(data.success)
|
465
|
|
{
|
466
|
|
$(".frmtype option")[0].value=data.data.name;
|
467
|
|
$(".frmtype option")[1].value=data.data.organization.name;
|
468
|
|
}
|
469
|
|
else
|
470
|
|
{
|
471
|
|
$.MsgBox.Alert("消息","系统异常!");
|
472
|
|
}
|
473
|
|
},
|
474
|
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
475
|
|
})
|
476
|
|
}
|
477
|
|
function replaceStr(s)
|
478
|
|
{
|
479
|
|
var pattern = new RegExp("-");
|
480
|
|
var rs = "";
|
481
|
|
for (var i = 0; i < s.length; i++) {
|
482
|
|
rs = rs+s.substr(i, 1).replace(pattern, '');
|
483
|
|
}
|
484
|
|
return rs;
|
485
|
|
}
|
486
|
|
$('.aboutpro').on("click",'.appl',function(){
|
487
|
|
ResourceApply();//调用资源申请HTML创建函数
|
488
|
|
$(".limitBox").removeClass("limitBox");
|
489
|
|
$(".limitwords").removeClass("limitwords");
|
490
|
|
$(".limitwordbox").removeClass("limitwordbox");
|
491
|
|
//获取当前时间并且格式化时间
|
492
|
|
var myDate = new Date();
|
493
|
|
var nowYear = myDate.getFullYear();
|
494
|
|
var nowMonth = myDate.getMonth()+1;
|
495
|
|
var nowDate = myDate.getDate();
|
496
|
|
if(nowMonth<10){
|
497
|
|
nowMonth="0"+nowMonth.toString();
|
498
|
|
}
|
499
|
|
if(nowDate<10){
|
500
|
|
nowDate="0"+nowDate.toString();
|
501
|
|
}
|
502
|
|
var now = nowYear + "-" + nowMonth + "-" + nowDate;
|
503
|
|
$( "#datepicker").val(now);
|
504
|
|
$( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
|
505
|
|
$(".timelo").css("display","none");
|
506
|
|
var resName=$(this).attr("resourcename");
|
507
|
|
var name=$(this).attr("professor");
|
508
|
|
var resourceID=$(this).attr("resourceId");
|
509
|
|
$.ajax({
|
510
|
|
"url":"/ajax/resource/"+resourceID,
|
511
|
|
"type":"get",
|
512
|
|
"async": false,
|
513
|
|
"success":function(info)
|
514
|
|
{
|
515
|
|
if(info.success)
|
516
|
|
{
|
517
|
|
if(info.data.images.length)
|
518
|
|
{
|
519
|
|
$(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
|
520
|
|
}
|
521
|
|
else{
|
522
|
|
$(".resouImage").attr("src","/images/default-resource.jpg");
|
523
|
|
}
|
524
|
|
}
|
525
|
|
}
|
526
|
|
})
|
527
|
|
$(".namecon").text(name);
|
528
|
|
$(".applysure").hide();
|
529
|
|
$(".btnboxup").hide();
|
530
|
|
$(".log").text(resName);
|
531
|
|
getIdentity(userid);
|
532
|
|
$("#deliver").on("click",function()
|
533
|
|
{
|
534
|
|
var $data = {};
|
535
|
|
$data.demandId = userid;
|
536
|
|
$data.resourceId=resourceID;
|
537
|
|
$data.detailDemand=$(".detail").val();
|
538
|
|
//去除时间里面的- 和字符串前后的空格
|
539
|
|
$data.deliverTime=replaceStr($.trim($(".dealTime").val()));
|
540
|
|
$data.operationStatus=1;
|
541
|
|
$data.applysquare=$(".frmtype option:selected").val();
|
542
|
|
$.ajax({
|
543
|
|
"url" : "/ajax/operation",
|
544
|
|
"type" : "POST",
|
545
|
|
"success" : function(rdata) {
|
546
|
|
if (rdata.success) {
|
547
|
|
$.MsgBox.Alert('message','资源"'+ resName +'"申请发送成功!');
|
548
|
|
$(".blackcover").remove();
|
549
|
|
$("body").css("position","static");
|
550
|
|
//location.reload(true);
|
551
|
|
} else {
|
552
|
|
$.MsgBox.Alert('message','资源"'+ resName +'"申请发送失败,请重新申请!');
|
553
|
|
}
|
554
|
|
},
|
555
|
|
"data" : $data,
|
556
|
|
"beforeSend":function(){/*console.log(this.data)*/},
|
557
|
|
"contentType" : "application/x-www-form-urlencoded",
|
558
|
|
dataType : "json"
|
559
|
|
});
|
560
|
|
});
|
561
|
|
});
|
562
|
|
|
563
|
|
|
564
|
|
//找专家中 点击咨询处理函数
|
565
|
|
function clickSeachProConsultHandler (){
|
566
|
|
|
567
|
|
var professorId = $(this).attr("id");
|
568
|
|
ConsultApply();
|
569
|
|
//点击的发送
|
570
|
|
$("#sendConsultBtn").click(function(){
|
571
|
|
sendConsultHandler($(this).attr("proId"))
|
572
|
|
});
|
573
|
|
|
574
|
|
if(userid && userid != null && userid != "null"){
|
575
|
|
concultProInfo(professorId);
|
576
|
|
|
577
|
|
}else {
|
578
|
|
$.MsgBox.Alert("message","请登录");
|
579
|
|
}
|
580
|
|
|
581
|
|
};
|
582
|
|
|
583
|
|
|
584
|
|
//找资源中 点击咨询
|
585
|
|
function clickResouceConsultHandler(){
|
586
|
|
var professorId = $(this).attr("id");
|
587
|
|
ConsultApply();
|
588
|
|
//默认选中资源咨询和标题
|
589
|
|
$("ul.menucon").children().eq(1).addClass("clicknow");
|
590
|
|
var consultTitleVal = $(this).parent().prev().find("a").text();
|
591
|
|
console.log($(this).parent());
|
592
|
|
console.log($(this).parent().prev());
|
593
|
|
alert(consultTitleVal);
|
594
|
|
$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
|
595
|
|
//点击的发送
|
596
|
|
$("#sendConsultBtn").click(function(){
|
597
|
|
sendConsultHandler($(this).attr("proId"));
|
598
|
|
});
|
599
|
|
|
600
|
|
if(userid && userid != null && userid != "null"){
|
601
|
|
concultProInfo(professorId);
|
602
|
|
|
603
|
|
}else {
|
604
|
|
$.MsgBox.Alert("message","请登录");
|
605
|
|
}
|
606
|
|
|
607
|
|
};
|
608
|
|
|
609
|
|
|
610
|
|
/* function sendConsultHandler(){
|
611
|
|
var professorId = $(this).attr("proId");
|
612
|
|
var consult_type = $(".clicknow").text();//咨询类型
|
613
|
|
var consult_title = $("#consultTitle").val();//咨询主题
|
614
|
|
var consult_content = $("#consultcontent").val();//咨询内容
|
615
|
|
var consultStr = {
|
616
|
|
"consultType":consult_type,
|
617
|
|
"consultTitle":consult_title,
|
618
|
|
"consultContant":consult_content,
|
619
|
|
"professorId":professorId,
|
620
|
|
"consultantId":userid
|
621
|
|
};
|
622
|
|
|
623
|
|
if(consult_type == '' || consult_title == '' || consult_content == ''){
|
624
|
|
$.MsgBox.Alert("message","请填写完整");
|
625
|
|
};
|
626
|
|
if(consult_type == ''){
|
627
|
|
$.MsgBox.Alert("消息","请选择联系目的");
|
628
|
|
}
|
629
|
|
if(consult_title == ''){
|
630
|
|
$.MsgBox.Alert("消息","请填写咨询目的");
|
631
|
|
}
|
632
|
|
if(consult_content == ''){
|
633
|
|
$.MsgBox.Alert("消息","请填写咨询内容");
|
634
|
|
}
|
635
|
|
|
636
|
|
if(userid && userid != null && userid != "null" && consult_type != '' &&
|
637
|
|
consult_title != '' && consult_content != ''
|
638
|
|
){
|
639
|
|
|
640
|
|
$.ajax({
|
641
|
|
"url" :"/ajax/consult",
|
642
|
|
"type" : "post",
|
643
|
|
//传值:咨询类型、主题、内容、专家id、申请人id
|
644
|
|
"data" : consultStr,
|
645
|
|
"contentType" : "application/x-www-form-urlencoded",
|
646
|
|
"dataType" : "json",
|
647
|
|
"success" : function(response) {
|
648
|
|
consultId = response.data;//咨询id
|
649
|
|
|
650
|
|
|
651
|
|
},
|
652
|
|
"error":function (){
|
653
|
|
$.MsgBox.Alert("消息","咨询申请失败");
|
654
|
|
},
|
655
|
|
|
656
|
|
"complete":function(){
|
657
|
|
//$(".consultapply").remove();
|
658
|
|
$(".blackcover").remove();
|
659
|
|
$("body").css("position","static");
|
660
|
|
$.MsgBox.Alert("消息","咨询申请成功");
|
661
|
|
},
|
662
|
|
});
|
663
|
|
}
|
664
|
|
|
665
|
|
}*/
|
666
|
|
|
667
|
|
|
668
|
|
});
|
|
1
|
$(function(){
|
|
2
|
var newc=GetQueryString("lookFor");
|
|
3
|
if(newc==0||newc==""){
|
|
4
|
var c=0;
|
|
5
|
}else{
|
|
6
|
var c=1;
|
|
7
|
// $(".lookwho option[value='1']").attr("selected","selected");
|
|
8
|
$("#div_select").text("找资源");
|
|
9
|
}
|
|
10
|
/*
|
|
11
|
var lookFor2 = 0;
|
|
12
|
$("#lookFor2 ul li").on("click",function(){
|
|
13
|
lookFor2=$(this).index();
|
|
14
|
});
|
|
15
|
//enter绑定时间
|
|
16
|
$("#searchContent").keydown(function(e){
|
|
17
|
if(e.which==13) {
|
|
18
|
synContent(2);
|
|
19
|
synContent(1);
|
|
20
|
var searchContent = $("#searchContent").val();
|
|
21
|
if(lookFor2 = 1){
|
|
22
|
$("#div_select").text("找资源");
|
|
23
|
location.href = "search.html?searchContent=" + encodeURI(searchContent);
|
|
24
|
}
|
|
25
|
}
|
|
26
|
|
|
27
|
})*/
|
|
28
|
|
|
29
|
var userid = $.cookie("userid");
|
|
30
|
var subject;
|
|
31
|
var subb=$.trim(GetQueryString("subject"));
|
|
32
|
var industry;
|
|
33
|
var pageSize;
|
|
34
|
var sub="SUBJECT";
|
|
35
|
var indu="INDUSTRY";
|
|
36
|
var address= $("#address .colorbg")[0].title;
|
|
37
|
$("#searchContent").val(GetQueryString("searchContent"));
|
|
38
|
$("#hsearchContent").val(GetQueryString("searchContent"));
|
|
39
|
var key=$("#searchContent").val();
|
|
40
|
var getData = function (key,subject,industry,pageSize,pageNo,isbind,add)
|
|
41
|
{
|
|
42
|
if(c==0)
|
|
43
|
{
|
|
44
|
$.ajax({"url" : "/ajax/professor/pqBaseInfo",
|
|
45
|
"type" : "GET",
|
|
46
|
"data" : {"key":key,"subject":subject,"industry":industry,"pageSize":pageSize,"pageNo":pageNo,"address":add},
|
|
47
|
"contentType" : "application/x-www-form-urlencoded",
|
|
48
|
"success" : function($data) {
|
|
49
|
if ($data.success) {
|
|
50
|
//console.log($data);
|
|
51
|
$("#professorList").html("");
|
|
52
|
for(var i = 0 ; i < $data.data.data.length ; i++){
|
|
53
|
//创建HTML标签
|
|
54
|
var dataHtml = "<div class='item'>";
|
|
55
|
dataHtml += "<a class='infoi' href='information-brow.html?professorId="+$data.data.data[i].id+"' ><div class='photo1 headRadius'>"
|
|
56
|
if($data.data.data[i].hasHeadImage) {
|
|
57
|
dataHtml += "<img class='images' style='width:100%;' src='/images/head/"+$data.data.data[i].id+"_l.jpg'/></div></a>";
|
|
58
|
}
|
|
59
|
else {
|
|
60
|
dataHtml += "<img class='images' style='width:100%;' src='/images/default-photo.jpg'/></div></a>";
|
|
61
|
}
|
|
62
|
dataHtml += "<div class='synopsis'>";
|
|
63
|
dataHtml += "<a href='javascript:void();' class='named'>";
|
|
64
|
if(typeof($data.data.data[i].name) !== "undefined"){
|
|
65
|
dataHtml += $data.data.data[i].name;
|
|
66
|
}
|
|
67
|
dataHtml += "</a><a href='information-brow.html?professorId="+$data.data.data[i].id+"' class='modify'></a>";
|
|
68
|
dataHtml += "<div class='position'>";
|
|
69
|
if($data.data.data[i].office){
|
|
70
|
dataHtml += $data.data.data[i].office+", ";
|
|
71
|
}
|
|
72
|
if($data.data.data[i].title){
|
|
73
|
dataHtml += $data.data.data[i].title+", ";
|
|
74
|
}
|
|
75
|
if($data.data.data[i].department){
|
|
76
|
dataHtml += $data.data.data[i].department+", ";
|
|
77
|
}
|
|
78
|
if($data.data.data[i].orgName){
|
|
79
|
dataHtml += $data.data.data[i].orgName;
|
|
80
|
}
|
|
81
|
if($data.data.data[i].address){
|
|
82
|
dataHtml += " | "+$data.data.data[i].address;
|
|
83
|
}
|
|
84
|
dataHtml += "</div>";
|
|
85
|
dataHtml += "<div class='ellipsisbox science'>";
|
|
86
|
if(typeof($data.data.data[i].subject) !== "undefined"){
|
|
87
|
dataHtml +="<p>学术领域:"+ $data.data.data[i].subject +"</p>";
|
|
88
|
}
|
|
89
|
dataHtml += "</div>";
|
|
90
|
dataHtml += "<div class='ellipsisbox industry'>";
|
|
91
|
if(typeof($data.data.data[i].industry) !== "undefined"){
|
|
92
|
dataHtml += "<p>应用行业:"+ $data.data.data[i].industry +"</p>";
|
|
93
|
}
|
|
94
|
if($data.data.data[i].researchAreas.length ){
|
|
95
|
dataHtml += "<p>研究方向:"+$data.data.data[i].researchAreas[0].caption +"</p>";
|
|
96
|
//console.log($data.data.data[i].researchAreas[0].caption);
|
|
97
|
}
|
|
98
|
|
|
99
|
dataHtml += "</div>";
|
|
100
|
dataHtml += "</div>";
|
|
101
|
if($data.data.data[i].id!=userid){
|
|
102
|
dataHtml += "<div class='operbox'><span class='operbtn onlyConsultbtn' id='"+$data.data.data[i]['id']+"'>咨询</span></div>";
|
|
103
|
}
|
|
104
|
|
|
105
|
|
|
106
|
$("#professorList").append(dataHtml);
|
|
107
|
if($data.data.data[i].authentication==false) {
|
|
108
|
$(".modify").eq(i).css("background-image","url(../images/icon-unauth.png)")
|
|
109
|
}
|
|
110
|
//点击查看当前信息
|
|
111
|
(function(i){
|
|
112
|
$('.photo1').click(function()
|
|
113
|
{
|
|
114
|
if(userid==$data.data.data[i].id)
|
|
115
|
{
|
|
116
|
$(".infoi").attr("href","information.html");
|
|
117
|
}
|
|
118
|
})
|
|
119
|
}
|
|
120
|
|
|
121
|
)(i);
|
|
122
|
//点击查看当前信息
|
|
123
|
(function(i){
|
|
124
|
$('.synopsis').eq(i).click(function()
|
|
125
|
{
|
|
126
|
if(userid==$data.data.data[i].id)
|
|
127
|
{
|
|
128
|
location.href='information.html';
|
|
129
|
}else{
|
|
130
|
location.href='information-brow.html?professorId='+$data.data.data[i].id;
|
|
131
|
}
|
|
132
|
|
|
133
|
})
|
|
134
|
}
|
|
135
|
|
|
136
|
)(i);
|
|
137
|
|
|
138
|
}
|
|
139
|
//找专家点击咨询
|
|
140
|
$(".onlyConsultbtn").bind("click",clickSeachProConsultHandler);
|
|
141
|
|
|
142
|
if(isbind == true){
|
|
143
|
$(".tcdPageCode").createPage({
|
|
144
|
pageCount:Math.ceil($data.data.total/pageSize),
|
|
145
|
current:$data.data.pageNo,
|
|
146
|
backFn:function(p){
|
|
147
|
getData(key,subject,industry,pageSize,p,false);
|
|
148
|
}
|
|
149
|
});
|
|
150
|
}
|
|
151
|
|
|
152
|
} else {
|
|
153
|
$.MsgBox.Alert("message",$data.msg);
|
|
154
|
}
|
|
155
|
}
|
|
156
|
});
|
|
157
|
}
|
|
158
|
else
|
|
159
|
{
|
|
160
|
//查询我的所有资源
|
|
161
|
$.ajax({
|
|
162
|
"url" :"/ajax/resource/pq",
|
|
163
|
"type" : "get",
|
|
164
|
"data" : {"key":key,"subject":subject,"industry":industry,"pageSize":pageSize,"pageNo":pageNo,"address":add},
|
|
165
|
"contentType" : "application/x-www-form-urlencoded",
|
|
166
|
"success" : function(data)
|
|
167
|
{console.log(data);
|
|
168
|
if (data.success)
|
|
169
|
{
|
|
170
|
$("#professorList").html("");
|
|
171
|
var $da=data.data.data;
|
|
172
|
for(var i=0;i<$da.length;i++)
|
|
173
|
{
|
|
174
|
var add='<div class="item">'
|
|
175
|
add+='<a class="resourcephoto headRadius" ><img src="" class="resourceImg remess" width="100%" height="100%" resourceId='+$da[i].resourceId+'></a>'
|
|
176
|
add+='<div class="synopsis" style="width:66%;">'
|
|
177
|
add+='<div class="cousultName"><a class="resouname" href="javascript:void();">'+$da[i].resourceName+'</a></div>'
|
|
178
|
if($da[i].professor.name){
|
|
179
|
add+='<div class="belongname">'+$da[i].professor.name+'<img class="modicon" src="images/onauth.png" width="14" ></div>'
|
|
180
|
}
|
|
181
|
if($da[i].professor.title==undefined){
|
|
182
|
$da[i].professor.title="";
|
|
183
|
}
|
|
184
|
if($da[i].professor.department==undefined){
|
|
185
|
$da[i].professor.department="";
|
|
186
|
}
|
|
187
|
if($da[i].professor.orgName==undefined){
|
|
188
|
$da[i].professor.orgName="";
|
|
189
|
}
|
|
190
|
add+='<div class="positionbox">'+$da[i].professor.title+$da[i].professor.department+$da[i].professor.orgName+'</div>'
|
|
191
|
if($da[i].subject)
|
|
192
|
{
|
|
193
|
add+='<div class="ellipsisbox sciencebox"><p>学术领域:'+$da[i].subject+'</p></div>'
|
|
194
|
}
|
|
195
|
if($da[i].industry)
|
|
196
|
{
|
|
197
|
add+='<div class="ellipsisbox industrybox"><p>应用行业:'+$da[i].industry+'</p></div>'
|
|
198
|
}
|
|
199
|
if($da[i].supportedServices)
|
|
200
|
{
|
|
201
|
add+='<div class="ellipsisbox provideservice"><p>应用用途:'+$da[i].supportedServices+'</p></div></div>'
|
|
202
|
}
|
|
203
|
add+='<div class="operbox"><span class="operbtn consultbtn" id="'+$da[i]["professor"]["id"]+'">咨询</span><span class="operbtn applybtn appl" resourceId='+$da[i].resourceId+' resourceName='+$da[i].resourceName+' professor='+$da[i].professor.name+'>申请</span></div>'
|
|
204
|
add+='</div>'
|
|
205
|
var $add=$(add);
|
|
206
|
$("#professorList").append($add);
|
|
207
|
if($da[i].professor.authentication==false) {
|
|
208
|
$add.find(".modicon").attr("src","images/icon-unauth.png");
|
|
209
|
}
|
|
210
|
if(data.data.data[i].images.length)
|
|
211
|
{
|
|
212
|
$add.find(".resourceImg").attr("src","/images/resource/"+$da[i].resourceId+".jpg");
|
|
213
|
}
|
|
214
|
else{
|
|
215
|
$add.find(".resourceImg").attr("src","/images/default-resource.jpg");
|
|
216
|
}
|
|
217
|
}
|
|
218
|
if(isbind == true){
|
|
219
|
$(".tcdPageCode").createPage({
|
|
220
|
pageCount:Math.ceil(data.data.total/pageSize),
|
|
221
|
current:data.data.pageNo,
|
|
222
|
backFn:function(p){
|
|
223
|
getData(key,subject,industry,pageSize,p,false);
|
|
224
|
}
|
|
225
|
});
|
|
226
|
}
|
|
227
|
}
|
|
228
|
else
|
|
229
|
{
|
|
230
|
$.MsgBox.Alert("message","请登录");
|
|
231
|
}
|
|
232
|
|
|
233
|
//找资源中点击咨询
|
|
234
|
$(".consultbtn").bind("click",clickResouceConsultHandler);
|
|
235
|
},
|
|
236
|
});
|
|
237
|
}
|
|
238
|
|
|
239
|
}
|
|
240
|
|
|
241
|
var subjectList = function (){
|
|
242
|
$.get("../ajax/dataDict/"+sub,function(data){
|
|
243
|
if(data.success){
|
|
244
|
if(data.data.length <=10) {
|
|
245
|
$(".andmore").eq(0).hide();
|
|
246
|
}
|
|
247
|
$("#subject").find(".sub").remove();
|
|
248
|
for(var i = 0 ; i < data.data.length; i++){
|
|
249
|
$("#subject").append("<a href='#' class='sub'title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");
|
|
250
|
if(subb) {
|
|
251
|
if(subb==data.data[i].caption) {
|
|
252
|
$('.sub').eq(i).addClass('colorbg').siblings().removeClass("colorbg");
|
|
253
|
}
|
|
254
|
}
|
|
255
|
if(i>20)
|
|
256
|
break;
|
|
257
|
}
|
|
258
|
}else{
|
|
259
|
$.MsgBox.Alert("message",data.msg);
|
|
260
|
}
|
|
261
|
})
|
|
262
|
}
|
|
263
|
var Address = function (){
|
|
264
|
$.get("../ajax/dataDict/ADDRESS",function(data){
|
|
265
|
if(data.success){
|
|
266
|
if(data.data.length <=10) {
|
|
267
|
$(".andmore").eq(2).hide();
|
|
268
|
}
|
|
269
|
for(var i = 0 ; i < data.data.length; i++){
|
|
270
|
$("#address").append("<a href='#' title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");
|
|
271
|
if(i>20)
|
|
272
|
break;
|
|
273
|
}
|
|
274
|
}else{
|
|
275
|
$.MsgBox.Alert("message",data.msg);
|
|
276
|
}
|
|
277
|
})
|
|
278
|
}
|
|
279
|
var industryList = function (){
|
|
280
|
$.get("../ajax/dataDict/"+indu,function(data){
|
|
281
|
if(data.success){
|
|
282
|
if(data.data.length <=10) {
|
|
283
|
$(".andmore").eq(1).hide();
|
|
284
|
}
|
|
285
|
$("#industry").find(".indu").remove();
|
|
286
|
for(var i = 0 ; i < data.data.length; i++){
|
|
287
|
$("#industry").append("<a href='#' class='indu'title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");
|
|
288
|
if(i>20)
|
|
289
|
break;
|
|
290
|
}
|
|
291
|
}else{
|
|
292
|
$.MsgBox.Alert("message",data.msg);
|
|
293
|
}
|
|
294
|
})
|
|
295
|
}
|
|
296
|
var findProfessor = function (){
|
|
297
|
if(subb){
|
|
298
|
subject=subb;
|
|
299
|
}else{
|
|
300
|
subject = $("#subject .colorbg")[0].title;
|
|
301
|
}
|
|
302
|
industry = $("#industry .colorbg")[0].title;
|
|
303
|
pageSize = 10;
|
|
304
|
getData(key,subject,industry,pageSize,1,true,address);
|
|
305
|
}
|
|
306
|
$("#search1").on("click",function(){
|
|
307
|
$("#hsearchContent").val($("#searchContent").val());
|
|
308
|
key = $("#searchContent").val();
|
|
309
|
$("#professorList").remove();
|
|
310
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
|
311
|
$(".tcdPageCode").remove();
|
|
312
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
|
313
|
getData(key,subject,industry,10,1,true,address);
|
|
314
|
})
|
|
315
|
$("#hsearch1").on("click",function(){
|
|
316
|
$("#searchContent").val($("#hsearchContent").val());
|
|
317
|
key = $("#hsearchContent").val();
|
|
318
|
$("#professorList").remove();
|
|
319
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
|
320
|
$(".tcdPageCode").remove();
|
|
321
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
|
322
|
getData(key,subject,industry,10,1,true,address);
|
|
323
|
})
|
|
324
|
|
|
325
|
subjectList();
|
|
326
|
industryList();
|
|
327
|
findProfessor();
|
|
328
|
Address();
|
|
329
|
$(".class1").eq(0).on("click","a",function (){
|
|
330
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
|
331
|
key=$("#searchContent").val();
|
|
332
|
subject = $(this).attr('title');
|
|
333
|
$("#professorList").remove();
|
|
334
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
|
335
|
$(".tcdPageCode").remove();
|
|
336
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
|
337
|
getData(key,subject,industry,10,1,true,address);
|
|
338
|
|
|
339
|
});
|
|
340
|
$(".class1").eq(1).on("click","a",function (){
|
|
341
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
|
342
|
industry = $(this).attr('title');
|
|
343
|
key=$("#searchContent").val();
|
|
344
|
$("#professorList").remove();
|
|
345
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
|
346
|
$(".tcdPageCode").remove();
|
|
347
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
|
348
|
getData(key,subject,industry,10,1,true,address);
|
|
349
|
});
|
|
350
|
$(".class1").eq(2).on("click","a",function (){
|
|
351
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
|
352
|
address = $(this).attr('title');
|
|
353
|
key=$("#searchContent").val();
|
|
354
|
$("#professorList").remove();
|
|
355
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
|
356
|
$(".tcdPageCode").remove();
|
|
357
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
|
358
|
getData(key,subject,industry,10,1,true,address);
|
|
359
|
});
|
|
360
|
/*搜索分类展开*/
|
|
361
|
var listi = 0;
|
|
362
|
$(".andmore").click(function() {
|
|
363
|
$(this).find(".updown").css("background-position", "left");
|
|
364
|
$(this).parent().css("height", "52px");
|
|
365
|
if (listi % 2 == 0) {
|
|
366
|
|
|
367
|
} else {
|
|
368
|
$(this).find(".updown").css("background-position", "right");
|
|
369
|
$(this).parent().css("height", "auto");
|
|
370
|
|
|
371
|
}
|
|
372
|
listi++;
|
|
373
|
})
|
|
374
|
|
|
375
|
/*搜索分类背景切换*/
|
|
376
|
$(".class1").on("click","a",function (){
|
|
377
|
$(this).addClass("colorbg").siblings().removeClass("colorbg");
|
|
378
|
})
|
|
379
|
|
|
380
|
/*专家、资源菜单切换*/
|
|
381
|
// $(".lookwho").change(function(){
|
|
382
|
// //$(this).addClass("tabcurrent").siblings().removeClass("tabcurrent");
|
|
383
|
// //$(".aboutcon").eq($(this).index()).show().siblings().hide();
|
|
384
|
// if($(this).value == "0"){
|
|
385
|
// $(".aboutpro").show();
|
|
386
|
// $(".aboutresou").hide();
|
|
387
|
// }
|
|
388
|
// else{
|
|
389
|
// $(".aboutresou").show();
|
|
390
|
// $(".aboutpro").hide();
|
|
391
|
// }
|
|
392
|
//
|
|
393
|
// })
|
|
394
|
|
|
395
|
//判断是搜寻专家还是资源
|
|
396
|
$(".lishow li").on("click",function(){
|
|
397
|
c=$(this).index();
|
|
398
|
|
|
399
|
$("#industry").find(".no2").addClass("colorbg").siblings().removeClass("colorbg");
|
|
400
|
$("#subject").find(".nox").addClass("colorbg").siblings().removeClass("colorbg");
|
|
401
|
key=$("#searchContent").val();
|
|
402
|
industry="";
|
|
403
|
subject="";
|
|
404
|
address="";
|
|
405
|
if(c==0){
|
|
406
|
sub="SUBJECT";
|
|
407
|
indu="INDUSTRY";
|
|
408
|
}
|
|
409
|
else{
|
|
410
|
sub="SUBJECT";
|
|
411
|
indu="INDUSTRY";
|
|
412
|
|
|
413
|
}
|
|
414
|
industryList();
|
|
415
|
subjectList();
|
|
416
|
Address();
|
|
417
|
$("#professorList").remove();
|
|
418
|
$(".aboutpro").append('<div class="about-in" id="professorList"></div>')
|
|
419
|
$(".tcdPageCode").remove();
|
|
420
|
$(".aboutpro").append('<div class="tcdPageCode"></div>');
|
|
421
|
getData(key,subject,industry,pageSize,1,true,address);
|
|
422
|
});
|
|
423
|
//查询资源详细信息
|
|
424
|
$('.about').on("click",'.remess',function(){
|
|
425
|
var resourceID=$(this).attr("resourceId");
|
|
426
|
ResourceMessage();
|
|
427
|
$.ajax({
|
|
428
|
"url":"/ajax/resource/"+resourceID,
|
|
429
|
"type":"get",
|
|
430
|
"async": true,
|
|
431
|
"success":function(info){
|
|
432
|
if(info.success)
|
|
433
|
{
|
|
434
|
$("#resourceName").text(info.data.resourceName);
|
|
435
|
$("#supportedServices").text(info.data.supportedServices);
|
|
436
|
$("#hopePayMethod").text(info.data.hopePayMethod) ;
|
|
437
|
$("#cooperationNotes").text(info.data.cooperationNotes) ;
|
|
438
|
$("#subject").text(info.data.subject);
|
|
439
|
$("#industry").text(info.data.industry);
|
|
440
|
$("#descp").text(info.data.descp);
|
|
441
|
$("#professor").text(info.data.professor.name);
|
|
442
|
$(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
|
|
443
|
$(".resouImage").load(function(){})
|
|
444
|
.error(function(){
|
|
445
|
$(this).attr("src","/images/default-resource.jpg");
|
|
446
|
});
|
|
447
|
limitHeight();
|
|
448
|
}
|
|
449
|
else
|
|
450
|
{
|
|
451
|
$.MsgBox.Alert('message',"系统异常!");
|
|
452
|
}
|
|
453
|
},
|
|
454
|
"error":function(){$.MsgBox.Alert('message','failed')}
|
|
455
|
});
|
|
456
|
})
|
|
457
|
//资源申请
|
|
458
|
function getIdentity(professorId){
|
|
459
|
$.ajax({
|
|
460
|
"url":"ajax/professor/"+professorId,
|
|
461
|
"type":"get",
|
|
462
|
"async": false,
|
|
463
|
"success":function(data){
|
|
464
|
if(data.success)
|
|
465
|
{
|
|
466
|
$(".frmtype option")[0].value=data.data.name;
|
|
467
|
$(".frmtype option")[1].value=data.data.organization.name;
|
|
468
|
}
|
|
469
|
else
|
|
470
|
{
|
|
471
|
$.MsgBox.Alert("消息","系统异常!");
|
|
472
|
}
|
|
473
|
},
|
|
474
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
|
475
|
})
|
|
476
|
}
|
|
477
|
function replaceStr(s)
|
|
478
|
{
|
|
479
|
var pattern = new RegExp("-");
|
|
480
|
var rs = "";
|
|
481
|
for (var i = 0; i < s.length; i++) {
|
|
482
|
rs = rs+s.substr(i, 1).replace(pattern, '');
|
|
483
|
}
|
|
484
|
return rs;
|
|
485
|
}
|
|
486
|
$('.aboutpro').on("click",'.appl',function(){
|
|
487
|
ResourceApply();//调用资源申请HTML创建函数
|
|
488
|
$(".limitBox").removeClass("limitBox");
|
|
489
|
$(".limitwords").removeClass("limitwords");
|
|
490
|
$(".limitwordbox").removeClass("limitwordbox");
|
|
491
|
//获取当前时间并且格式化时间
|
|
492
|
var myDate = new Date();
|
|
493
|
var nowYear = myDate.getFullYear();
|
|
494
|
var nowMonth = myDate.getMonth()+1;
|
|
495
|
var nowDate = myDate.getDate();
|
|
496
|
if(nowMonth<10){
|
|
497
|
nowMonth="0"+nowMonth.toString();
|
|
498
|
}
|
|
499
|
if(nowDate<10){
|
|
500
|
nowDate="0"+nowDate.toString();
|
|
501
|
}
|
|
502
|
var now = nowYear + "-" + nowMonth + "-" + nowDate;
|
|
503
|
$( "#datepicker").val(now);
|
|
504
|
$( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
|
|
505
|
$(".timelo").css("display","none");
|
|
506
|
var resName=$(this).attr("resourcename");
|
|
507
|
var name=$(this).attr("professor");
|
|
508
|
var resourceID=$(this).attr("resourceId");
|
|
509
|
$.ajax({
|
|
510
|
"url":"/ajax/resource/"+resourceID,
|
|
511
|
"type":"get",
|
|
512
|
"async": false,
|
|
513
|
"success":function(info)
|
|
514
|
{
|
|
515
|
if(info.success)
|
|
516
|
{
|
|
517
|
if(info.data.images.length)
|
|
518
|
{
|
|
519
|
$(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
|
|
520
|
}
|
|
521
|
else{
|
|
522
|
$(".resouImage").attr("src","/images/default-resource.jpg");
|
|
523
|
}
|
|
524
|
}
|
|
525
|
}
|
|
526
|
})
|
|
527
|
$(".namecon").text(name);
|
|
528
|
$(".applysure").hide();
|
|
529
|
$(".btnboxup").hide();
|
|
530
|
$(".log").text(resName);
|
|
531
|
getIdentity(userid);
|
|
532
|
$("#deliver").on("click",function()
|
|
533
|
{
|
|
534
|
var $data = {};
|
|
535
|
$data.demandId = userid;
|
|
536
|
$data.resourceId=resourceID;
|
|
537
|
$data.detailDemand=$(".detail").val();
|
|
538
|
//去除时间里面的- 和字符串前后的空格
|
|
539
|
$data.deliverTime=replaceStr($.trim($(".dealTime").val()));
|
|
540
|
$data.operationStatus=1;
|
|
541
|
$data.applysquare=$(".frmtype option:selected").val();
|
|
542
|
$.ajax({
|
|
543
|
"url" : "/ajax/operation",
|
|
544
|
"type" : "POST",
|
|
545
|
"success" : function(rdata) {
|
|
546
|
if (rdata.success) {
|
|
547
|
$.MsgBox.Alert('message','资源"'+ resName +'"申请发送成功!');
|
|
548
|
$(".blackcover").remove();
|
|
549
|
$("body").css("position","static");
|
|
550
|
//location.reload(true);
|
|
551
|
} else {
|
|
552
|
$.MsgBox.Alert('message','资源"'+ resName +'"申请发送失败,请重新申请!');
|
|
553
|
}
|
|
554
|
},
|
|
555
|
"data" : $data,
|
|
556
|
"beforeSend":function(){/*console.log(this.data)*/},
|
|
557
|
"contentType" : "application/x-www-form-urlencoded",
|
|
558
|
dataType : "json"
|
|
559
|
});
|
|
560
|
});
|
|
561
|
});
|
|
562
|
|
|
563
|
|
|
564
|
//找专家中 点击咨询处理函数
|
|
565
|
function clickSeachProConsultHandler (){
|
|
566
|
|
|
567
|
if(userid && userid != null && userid != "null"){
|
|
568
|
var professorId = $(this).attr("id");
|
|
569
|
ConsultApply();
|
|
570
|
//点击的发送
|
|
571
|
$("#sendConsultBtn").click(function(){
|
|
572
|
sendConsultHandler($(this).attr("proId"))
|
|
573
|
});
|
|
574
|
concultProInfo(professorId);
|
|
575
|
|
|
576
|
}else {
|
|
577
|
$.MsgBox.Alert("message","请登录");
|
|
578
|
var aele = document.createElement('a');
|
|
579
|
$("#mb_btnbox").append(aele);
|
|
580
|
$("#mb_btnbox a").css({
|
|
581
|
'display':"block",
|
|
582
|
'width':'100%',
|
|
583
|
'height':'40px',
|
|
584
|
'position':'relative',
|
|
585
|
'bottom':'40px',
|
|
586
|
'left':0
|
|
587
|
});
|
|
588
|
aele.setAttribute('href', '../login.html');
|
|
589
|
}
|
|
590
|
|
|
591
|
};
|
|
592
|
|
|
593
|
|
|
594
|
//找资源中 点击咨询
|
|
595
|
function clickResouceConsultHandler(){
|
|
596
|
|
|
597
|
if(userid){
|
|
598
|
var professorId = $(this).attr("id");
|
|
599
|
ConsultApply();
|
|
600
|
//默认选中资源咨询和标题
|
|
601
|
$("ul.menucon").children().eq(1).addClass("clicknow");
|
|
602
|
var consultTitleVal = $(this).parent().prev().find("a").text();
|
|
603
|
console.log($(this).parent());
|
|
604
|
console.log($(this).parent().prev());
|
|
605
|
alert(consultTitleVal);
|
|
606
|
$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
|
|
607
|
//点击的发送
|
|
608
|
$("#sendConsultBtn").click(function(){
|
|
609
|
sendConsultHandler($(this).attr("proId"));
|
|
610
|
});
|
|
611
|
concultProInfo(professorId);
|
|
612
|
|
|
613
|
}else {
|
|
614
|
$.MsgBox.Alert("message","请登录");
|
|
615
|
var aele = document.createElement('a');
|
|
616
|
$("#mb_btnbox").append(aele);
|
|
617
|
$("#mb_btnbox a").css({
|
|
618
|
'display':"block",
|
|
619
|
'width':'100%',
|
|
620
|
'height':'40px',
|
|
621
|
'position':'relative',
|
|
622
|
'bottom':'40px',
|
|
623
|
'left':0
|
|
624
|
});
|
|
625
|
aele.setAttribute('href', '../login.html');
|
|
626
|
}
|
|
627
|
|
|
628
|
};
|
|
629
|
|
|
630
|
|
|
631
|
/* function sendConsultHandler(){
|
|
632
|
var professorId = $(this).attr("proId");
|
|
633
|
var consult_type = $(".clicknow").text();//咨询类型
|
|
634
|
var consult_title = $("#consultTitle").val();//咨询主题
|
|
635
|
var consult_content = $("#consultcontent").val();//咨询内容
|
|
636
|
var consultStr = {
|
|
637
|
"consultType":consult_type,
|
|
638
|
"consultTitle":consult_title,
|
|
639
|
"consultContant":consult_content,
|
|
640
|
"professorId":professorId,
|
|
641
|
"consultantId":userid
|
|
642
|
};
|
|
643
|
|
|
644
|
if(consult_type == '' || consult_title == '' || consult_content == ''){
|
|
645
|
$.MsgBox.Alert("message","请填写完整");
|
|
646
|
};
|
|
647
|
if(consult_type == ''){
|
|
648
|
$.MsgBox.Alert("消息","请选择联系目的");
|
|
649
|
}
|
|
650
|
if(consult_title == ''){
|
|
651
|
$.MsgBox.Alert("消息","请填写咨询目的");
|
|
652
|
}
|
|
653
|
if(consult_content == ''){
|
|
654
|
$.MsgBox.Alert("消息","请填写咨询内容");
|
|
655
|
}
|
|
656
|
|
|
657
|
if(userid && userid != null && userid != "null" && consult_type != '' &&
|
|
658
|
consult_title != '' && consult_content != ''
|
|
659
|
){
|
|
660
|
|
|
661
|
$.ajax({
|
|
662
|
"url" :"/ajax/consult",
|
|
663
|
"type" : "post",
|
|
664
|
//传值:咨询类型、主题、内容、专家id、申请人id
|
|
665
|
"data" : consultStr,
|
|
666
|
"contentType" : "application/x-www-form-urlencoded",
|
|
667
|
"dataType" : "json",
|
|
668
|
"success" : function(response) {
|
|
669
|
consultId = response.data;//咨询id
|
|
670
|
|
|
671
|
|
|
672
|
},
|
|
673
|
"error":function (){
|
|
674
|
$.MsgBox.Alert("消息","咨询申请失败");
|
|
675
|
},
|
|
676
|
|
|
677
|
"complete":function(){
|
|
678
|
//$(".consultapply").remove();
|
|
679
|
$(".blackcover").remove();
|
|
680
|
$("body").css("position","static");
|
|
681
|
$.MsgBox.Alert("消息","咨询申请成功");
|
|
682
|
},
|
|
683
|
});
|
|
684
|
}
|
|
685
|
|
|
686
|
}*/
|
|
687
|
|
|
688
|
|
|
689
|
});
|
669
|
690
|
|