浏览代码

找资源和找专家中咨询的bug修改

xiaoai_123 8 年之前
父节点
当前提交
0391e63713

+ 12 - 7
src/main/webapp/diloags.html

8
        </div>
8
        </div>
9
        <div class="dialogcontain">
9
        <div class="dialogcontain">
10
        	<div class="dialoginfo">
10
        	<div class="dialoginfo">
11
                <div class="dialoginfotype"><span class="dialogtit" id="dialog_consultTitle">咨询主题:</span><span id="dial_consultTitle"></span></div>
12
                <div class="dialoginfotype"><span class="dialogtit" id="dialog_consultType">咨询类型:</span><span id="dial_consultType"></span></div>
11
                <div class="dialoginfotype">
12
	                <span class="dialogtit" id="">咨询主题:</span>
13
	                <span id="dialog_consultTitle"></span>
14
                </div>
15
                <div class="dialoginfotype">
16
                	<span class="dialogtit" id="">咨询类型:</span>
17
                	<span id="dialog_consultType"></span></div>
13
                <div class="dialoginfotype dialogbtnbox">
18
                <div class="dialoginfotype dialogbtnbox">
14
	                <div class="dialogsurebtn displayNone" id="dial_confirmFinishConsult">
15
	                	<span>点击确认完成咨询</span>
19
	                <div class="dialogsurebtn displayNone" >
20
	                	<span id="dial_confirmFinishConsult">点击确认完成咨询</span>
16
	                </div>
21
	                </div>
17
	                <div class="dialogsurebtn displayNone" id="dialog_assessBtn">
22
	                <div class="dialogsurebtn displayNone" id="dialog_assessBtn">
18
	                	<span>评价</span>
23
	                	<span>评价</span>
22
	                </div>
27
	                </div>
23
                </div>
28
                </div>
24
                <div class="dialoginfotype">
29
                <div class="dialoginfotype">
25
                	<div id="showAllAssess" class="thanksblock clearfix">
30
                	<!-- <div id="showAllAssess" class="thanksblock clearfix">
26
	                	<div class="evadbox floatL">
31
	                	<div class="evadbox floatL">
27
		                	<div class="evadtit floatL">总体评价</div>
32
		                	<div class="evadtit floatL">总体评价</div>
28
		                	<div class="evadegree floatL">
33
		                	<div class="evadegree floatL">
36
		                	</div>
41
		                	</div>
37
	                	</div>	
42
	                	</div>	
38
	                	<div class="thankbox floatR" id="dialog_thanks">感谢金额<span id="dialog_thanksMoney"></span>元</div>
43
	                	<div class="thankbox floatR" id="dialog_thanks">感谢金额<span id="dialog_thanksMoney"></span>元</div>
39
	                </div>
40
	                <div id="showAllAssess" class="thanksblock clearfix">
44
	                </div> -->
45
	                <div id="showAllAssess" class="thanksblock clearfix displayNone">
41
	                	<div class="evadbox evamargin">
46
	                	<div class="evadbox evamargin">
42
		                	<div class="evadtit floatL">总体评价</div>
47
		                	<div class="evadtit floatL">总体评价</div>
43
		                	<div class="evadegree floatL">
48
		                	<div class="evadegree floatL">

+ 47 - 91
src/main/webapp/js/consultFlat.js

12
};
12
};
13
//data:需要处理的数据,htmlStr:页面中需要的html字符串拼接,
13
//data:需要处理的数据,htmlStr:页面中需要的html字符串拼接,
14
//attrParams:数据中不同的参数比如:收到咨询是professorId,收到答复:consultantId
14
//attrParams:数据中不同的参数比如:收到咨询是professorId,收到答复:consultantId
15
function handleData(data,htmlStr,attrParams,text,btnCls){
15
function handleData(data,htmlStr,attrParams,btnCls){
16
	var text;
16
	htmlStr = '';
17
	htmlStr = '';
17
	for(var i = 0; i < data.length;i++){
18
	for(var i = 0; i < data.length;i++){
19
		if(data[i]["professor"]["title"] == undefined){
20
			data[i]["professor"]["title"] = '';
21
		}
22
		if(data[i]["professor"]["orgName"] == undefined){
23
			data[i]["professor"]["orgName"] = '';
24
		}
25
		if(data[i]["professor"]["department"] == undefined){
26
			data[i]["professor"]["department"] = '';
27
		}
28
		if(data[i]["professor"]["adress"] == undefined){
29
			data[i]["professor"]["adress"]  = '';
30
		};
31
		
32
		
18
		if(data[i]["consultStatus"] == 0){
33
		if(data[i]["consultStatus"] == 0){
19
			data[i]["consultStatus"] = "进行中";
34
			data[i]["consultStatus"] = "进行中";
20
		};
35
			text = '回复';
36
			};
21
		if(data[i]["consultStatus"] == 1){
37
		if(data[i]["consultStatus"] == 1){
22
			data[i]["consultStatus"] = "完成";
38
			data[i]["consultStatus"] = "完成";
23
		};
24
		
39
			text = "查看";
40
		}
25
		if(data[i]["assessStatus"] == 0){
41
		if(data[i]["assessStatus"] == 0){
26
			data[i]["assessStatus"] = "未评价";
42
			data[i]["assessStatus"] = "未评价";
27
		}
43
		}
28
		if(data[i]["assessStatus"] == 1){
44
		if(data[i]["assessStatus"] == 1){
29
			data[i]["assessStatus"] = "已评价";
45
			data[i]["assessStatus"] = "已评价";
30
		}
46
		}
31
		
47

32
		if(data[i]["thanksStatus"] == 0){
48
		if(data[i]["thanksStatus"] == 0){
33
			data[i]["thanksStatus"] = "未感谢";
49
			data[i]["thanksStatus"] = "未感谢";
34
		}
50
		}
35
		if(data[i]["thanksStatus"] == 1){
51
		if(data[i]["thanksStatus"] == 1){
36
			data[i]["thanksStatus"] = "已感谢";
52
			data[i]["thanksStatus"] = "已感谢";
37
		}
38
		if(attrParams == "professorId"){
39
			text = "回复"
40
		}
41
		else{
42
			text = "查看"
43
		}
53
		};
44
		
54
		
45
		htmlStr += 
55
		htmlStr += 
46
			"<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
56
			"<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
74
									"<div class='workhandle'>" +
84
									"<div class='workhandle'>" +
75
										"<div class='rightopert floatR'>" +
85
										"<div class='rightopert floatR'>" +
76
											"<span class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+ "' assess='"+ data[i]["assessStatus"]+ "'  thanks='"+ data[i]["thanksStatus"]+ "'>" +text +"</span>" +
86
											"<span class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+ "' assess='"+ data[i]["assessStatus"]+ "'  thanks='"+ data[i]["thanksStatus"]+ "'>" +text +"</span>" +
77
											"<span class='moreopert'>...</span>" +
87
											"<span class='moreopert complain'>...</span>" +
78
											"<ul class='moreopertbtn'>" +
88
											"<ul class='moreopertbtn'>" +
79
												"<li>投诉</li>" +
89
												"<li>投诉</li>" +
80
											"</ul>" +
90
											"</ul>" +
146
function clickConsultBtn(){
156
function clickConsultBtn(){
147

157

148
	//1.先ajax请求,判断是否有收到咨询消息,然后ajax-html,然后渲染数据
158
	//1.先ajax请求,判断是否有收到咨询消息,然后ajax-html,然后渲染数据
149
//	console.log(professorIdStrByconsult);
150
	//检查用户是否登录
159
	//检查用户是否登录
151
	if(userid != "" && userid != null){
160
	if(userid != "" && userid != null){
152
		$.ajax({
161
		$.ajax({
155
			//传值:登陆人id:专家id
164
			//传值:登陆人id:专家id
156
			"data" :{"professorId":userid},
165
			"data" :{"professorId":userid},
157
			"contentType" : "application/x-www-form-urlencoded",
166
			"contentType" : "application/x-www-form-urlencoded",
158
			"beforeSend":function(response){
159
//				console.log(response)
160
			},
161
			"success":function(consultResponse){
167
			"success":function(consultResponse){
162
//				console.log(consultResponse);
168
//				console.log(consultResponse);
163
				//如果没有咨询数据 隐藏收到咨询
169
				//如果没有咨询数据 隐藏收到咨询
164
				if(consultResponse["data"]["total"] == 0){
170
				if(consultResponse["data"]["total"] == 0){
165
//					alert("未收到咨询");
166

167
			        //ajax页面
168
			        $.ajax({
171
			        $.ajax({
169
			        	"url":"consult.html",
172
			        	"url":"consult.html",
170
						"dataType" : "html",
173
						"dataType" : "html",
185
					        	"data":{"consultantId":userid},
188
					        	"data":{"consultantId":userid},
186
								"dataType" : "json",
189
								"dataType" : "json",
187
								"success":function(replyResponse){
190
								"success":function(replyResponse){
188
									console.log(replyResponse)
189
									
190
									var allData = replyResponse.data;
191
									var allData = replyResponse.data;
191
									var replyData = allData["data"];
192
									var replyData = allData["data"];
192
									
193
									
193
									if(replyData.length != 0 &&  replyData.length != null){
194
									if(replyData.length != 0 &&  replyData.length != null){
194
										replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
195
										replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
195
										$("#workContainer2").prepend(replyTrHtml);
196
										$("#workContainer2").prepend(replyTrHtml);
196
										
197
										
197
									}else{
198
									}else{
235
					      timeType2 = $("#timeTypeId2").val();//时间类型值
236
					      timeType2 = $("#timeTypeId2").val();//时间类型值
236
					      sortType2 = $("#timeSortId2").val();//排序值;
237
					      sortType2 = $("#timeSortId2").val();//排序值;
237

238

238
					      //console.log(consultStatus,timeType,sortType+"res333");
239

240
					      //默认传值:
239
					      //默认传值:
241
					      var replyInfo = {
240
					      var replyInfo = {
242
					      		"consultantId":userid,
241
					      		"consultantId":userid,
263
									"url":"/ajax/consult/pqcon",//更新下拉菜单接口
262
									"url":"/ajax/consult/pqcon",//更新下拉菜单接口
264
									"type":"get",
263
									"type":"get",
265
						        	"data":replyInfo,
264
						        	"data":replyInfo,
266
									"beforeSend":function(response){
267
										console.log(response);
268
									},
269
									"success":function(response){
265
									"success":function(response){
270
										$("#workContainer2 .workselectitem").remove();
266
										$("#workContainer2 .workselectitem").remove();
271
										var allData = response.data;
267
										var allData = response.data;
272
										var replyData = allData["data"];
268
										var replyData = allData["data"];
273
										replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
274
										console.log(replyTrHtml);
275
//										$(".tcdPageCode:last").before(replyTrHtml);
269
										replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
276
										$("#workContainer2").prepend(replyTrHtml);
270
										$("#workContainer2").prepend(replyTrHtml);
277

271

278
									},
272
									},
316
							var consultTrHtml;
310
							var consultTrHtml;
317
					        var allData = consultResponse.data;
311
					        var allData = consultResponse.data;
318
							var consultData = allData["data"];
312
							var consultData = allData["data"];
319
					        consultTrHtml = handleData(consultData,consultTrHtml,"professorId","回复","replyBtn");
313
					        consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
320
					        $("#workContainer").prepend(consultTrHtml);
314
					        $("#workContainer").prepend(consultTrHtml);
321
					        
315
					        
322
					        
316
					        
344
							consultStatus = $("#consultSelectId").val();//咨询状态值
338
							consultStatus = $("#consultSelectId").val();//咨询状态值
345
							timeType = $("#timeTypeId").val();//时间类型值
339
							timeType = $("#timeTypeId").val();//时间类型值
346
							sortType = $("#timeSortId").val();//排序值;
340
							sortType = $("#timeSortId").val();//排序值;
347
//							console.log(consultStatus,timeType,sortType+"res333");
348
							
341
							
349
							//默认传值:
342
							//默认传值:
350
							var consultInfo = {
343
							var consultInfo = {
378
									"url":"/ajax/consult/pqpro",//更新下拉菜单接口
371
									"url":"/ajax/consult/pqpro",//更新下拉菜单接口
379
						        	"data":consultInfo,
372
						        	"data":consultInfo,
380
						        	"type":"get",
373
						        	"type":"get",
381
									"beforeSend":function(response){
382
//										console.log(response);
383
									},
384
									"success":function(response){
374
									"success":function(response){
385
										$("#workContainer .workselectitem").remove();
375
										$("#workContainer .workselectitem").remove();
386
//										$(".tcdPageCode:first").before().empty();
376
//										$(".tcdPageCode:first").before().empty();
387
										var allData = response.data;
377
										var allData = response.data;
388
										var consultData = allData["data"];
378
										var consultData = allData["data"];
389
										console.log(consultData.length);
390
										consultTrHtml = handleData(consultData,consultTrHtml,"professorId","回复","replyBtn");
391
//										$(".tcdPageCode:first").before(consultTrHtml);
379
										consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
392
										$("#workContainer").prepend(consultTrHtml);
380
										$("#workContainer").prepend(consultTrHtml);
381
										
393
										//给咨询页回复绑定事件
382
										//给咨询页回复绑定事件
394
										$("#workContainer .workselectitem").find(".replyBtn").bind("click",clickReplyFn);
383
										$("#workContainer .workselectitem").find(".replyBtn").bind("click",clickReplyFn);
395
										
384
										
466
												"type":"get",
455
												"type":"get",
467
												"data":consultIdStr,
456
												"data":consultIdStr,
468
												"success":function(response){
457
												"success":function(response){
469
													console.log("点击回复返回数据");
470
													console.log(response)
471
													var consultantData = response["data"];
458
													var consultantData = response["data"];
472
													//对话框标题信息
459
													//对话框标题信息
473
													//进行中,
460
													//进行中,
558
												"url":"/ajax/tidings/qacon",//对话内容显示接口
545
												"url":"/ajax/tidings/qacon",//对话内容显示接口
559
												"type":"get",
546
												"type":"get",
560
												"data":consultIdStr,
547
												"data":consultIdStr,
561
												"beforeSend":function(response){
562
													//对话发送消息失败
563
													//console.log(response);
564
												},
565
												"success":function(response){
548
												"success":function(response){
566
													console.log()
567
													var dialogConData = response["data"];
549
													var dialogConData = response["data"];
568
													console.log(dialogConData);
569
													var dialogStr;
550
													var dialogStr;
570
													dialogStr = dialogContentStrFn(dialogConData);
551
													dialogStr = dialogContentStrFn(dialogConData);
571
													$("#dialogContent").prepend(dialogStr);
552
													$("#dialogContent").prepend(dialogStr);
594
												"url":"/ajax/tidings",
575
												"url":"/ajax/tidings",
595
												"type":"post",
576
												"type":"post",
596
												"data":tidingStr,
577
												"data":tidingStr,
597
												"beforeSend":function(response){
598
													//对话发送消息失败
599
													console.log(response);
600
												},
601
												"success":function(response){
578
												"success":function(response){
602
													console.log(response);//返回对话内容的id
603
													$("#dialogContent").empty();
579
													$("#dialogContent").empty();
604
													dialogContentDataHandle();
580
													dialogContentDataHandle();
605
												},
581
												},
613
										$("#dialog_sendBtn").bind("click",sendDialogContentFn);
589
										$("#dialog_sendBtn").bind("click",sendDialogContentFn);
614
										
590
										
615
										
591
										
616
										//==============点击确认完成
592
										//==============发表评价
617
										function assessFn(){
593
										function assessFn(){
618
											ConsultComment();
594
											ConsultComment();
619
											if($(this).attr("id") == "dialog_thanksBtn"){
595
											if($(this).attr("id") == "dialog_thanksBtn"){
642
											$("#sendAssessBtn").bind("click",clickSendAssessBtn);
618
											$("#sendAssessBtn").bind("click",clickSendAssessBtn);
643
											
619
											
644
										};
620
										};
645
										//绑定对话页面确认完成咨询
646
										$("#dial_confirmFinishConsult").bind("click",assessFn);
621
										/*//绑定对话页面确认完成咨询
622
										$("#dial_confirmFinishConsult").bind("click",assessFn);*/
647
										
623
										
648
										
624
										
649
										//点击发表评论:保存发表内容和星级
625
										//点击发表评论:保存发表内容和星级
659
												    "assessStar":assessStar, //评价星级
635
												    "assessStar":assessStar, //评价星级
660
												    "assessContant":assessContant //评价内容
636
												    "assessContant":assessContant //评价内容
661
											};
637
											};
662
											console.log(assessContentStr);
638
//											console.log(assessContentStr);
663
											//如果未评论,提示未评论
639
											//如果未评论,提示未评论
664
											if(assessStar == "" || assessStar == null || assessStar == undefined){
640
											if(assessStar == "" || assessStar == null || assessStar == undefined){
665
												if(assessContant == "" || assessContant == null || assessContant == undefined){
641
												if(assessContant == "" || assessContant == null || assessContant == undefined){
672
												"type":"post",
648
												"type":"post",
673
												"data":assessContentStr,
649
												"data":assessContentStr,
674
												"success":function(response){
650
												"success":function(response){
675
													console.log(response);
651
//													console.log(response);
676
													$(".blackcover").remove();
652
													$(".blackcover").remove();
677
													$("body").css("position","static");
653
													$("body").css("position","static");
678
													$.MsgBox.Alert('提示',"评论成功");
654
													$.MsgBox.Alert('提示',"评论成功");
679
													
655
													
680
													//评价状态改变,所以头部信息改变
656
													//评价状态改变,所以头部信息改变
681
													dialogHeadDataHandleFn();
657
													dialogHeadDataHandleFn();
658
													//点击确认完成
659
													//绑定对话页面确认完成咨询
660
													$("#dial_confirmFinishConsult").bind("click",assessFn);
682
												},
661
												},
683
												"error":function(error){
662
												"error":function(error){
684
													//发表评论失败
663
													//发表评论失败
733
								},
712
								},
734
								"success":function(replyResponse){
713
								"success":function(replyResponse){
735
									//拿到收到回复数据
714
									//拿到收到回复数据
736
									console.log(replyResponse);
737
									var replyTrHtml;
715
									var replyTrHtml;
738
									var allData = replyResponse.data;
716
									var allData = replyResponse.data;
739
									var replyData = allData["data"];
717
									var replyData = allData["data"];
740
//									console.log(replyData.length);
741
									if(replyData.length != 0 &&  replyData.length != null){
718
									if(replyData.length != 0 &&  replyData.length != null){
742
										replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
743
//										$(".tcdPageCode:last").before(replyTrHtml);	
719
										replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
744
										$("#workContainer2").prepend(replyTrHtml);
720
										$("#workContainer2").prepend(replyTrHtml);
745
										
721
										
746
										
722
										
816
										"url":"/ajax/consult/pqcon",//更新下拉菜单接口
792
										"url":"/ajax/consult/pqcon",//更新下拉菜单接口
817
										"type":"get",
793
										"type":"get",
818
							        	"data":replyInfo,
794
							        	"data":replyInfo,
819
										"beforeSend":function(response){
820
											console.log(response);
821
										},
822
										"success":function(response){
795
										"success":function(response){
823
											$("#workContainer2 .workselectitem").remove();
796
											$("#workContainer2 .workselectitem").remove();
824
//											$(".tcdPageCode:first").before().empty();
797
//											$(".tcdPageCode:first").before().empty();
825
											var allData = response.data;
798
											var allData = response.data;
826
											var replyData = allData["data"];
799
											var replyData = allData["data"];
827
											var replyTrHtml;
800
											var replyTrHtml;
828
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
829
//											$(".tcdPageCode:last").before(replyTrHtml);
801
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
830
											$("#workContainer2").prepend(replyTrHtml);
802
											$("#workContainer2").prepend(replyTrHtml);
831
											
803
											
832
											$("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
804
											$("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
1171
											
1143
											
1172
											//稍后评价、
1144
											//稍后评价、
1173
											function noAssess(){
1145
											function noAssess(){
1174
//												$(".blackcover").remove();
1175
//												$("body").css("position","static");
1176
												$.ajax({
1146
												$.ajax({
1177
													"url":"diloags.html",
1147
													"url":"diloags.html",
1178
													"dataType":"html",
1148
													"dataType":"html",
1180
														//console.log(data);
1150
														//console.log(data);
1181
														$(this).attr("id");
1151
														$(this).attr("id");
1182
														$(".workcon").html(result);
1152
														$(".workcon").html(result);
1183
														
1184
														$(".blackcover").remove();
1153
														$(".blackcover").remove();
1185
														$("body").css("position","static");
1154
														$("body").css("position","static");
1186
														lookDialogHeadDataHandleFn();
1155
														lookDialogHeadDataHandleFn();
1187
														dialogContentDataHandle();
1156
														dialogContentDataHandle();
1188
														$("#dialog_sendBtn").bind("click",sendDialogContentFn);
1157
														$("#dialog_sendBtn").bind("click",sendDialogContentFn);
1189
														
1190
														
1158

1191
													},
1159
													},
1192
													"error":function(error){
1160
													"error":function(error){
1193
														//console.log(data);
1194
														//加载对话页面失败
1161
														//加载对话页面失败
1195
														console.log(error);
1162
														$.MsgBox.Alert('提醒',"对话请求错误");
1196
													}
1163
													}
1197
												});
1164
												});
1198
											};
1165
											};
1199
											
1200
										
1201

1166

1202
										
1203
										
1204
									
1205
									
1167
									
1206
								};//收到回复点击查看函数结束
1168
								};//收到回复点击查看函数结束
1207
								
1208
								
1209

1169

1210
							
1170
							
1211
							
1212
						},
1171
						},
1213
			        })
1172
			        })
1214
					
1173
					
1215
				}
1174
				}
1216
			},
1175
			},
1217
			"complete":function(response){
1218
//				console.log(response)
1219
			},
1220
			"error":function(response){
1176
			"error":function(response){
1221
				//收到咨询页面失败
1177
				//收到咨询页面失败
1222
//				console.log(response)
1178
				$.MsgBox.Alert('提醒',"咨询页面请求错误");
1223
			},
1179
			},
1224
			
1180
			
1225
			
1181
			
1288
										var replyData = allData["data"];
1244
										var replyData = allData["data"];
1289
										
1245
										
1290
										if(replyData.length != 0 &&  replyData.length != null){
1246
										if(replyData.length != 0 &&  replyData.length != null){
1291
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
1247
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
1292
											$("#workContainer2").prepend(replyTrHtml);
1248
											$("#workContainer2").prepend(replyTrHtml);
1293
											
1249
											
1294
										}else{
1250
										}else{
1367
											$("#workContainer2 .workselectitem").remove();
1323
											$("#workContainer2 .workselectitem").remove();
1368
											var allData = response.data;
1324
											var allData = response.data;
1369
											var replyData = allData["data"];
1325
											var replyData = allData["data"];
1370
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
1326
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
1371
											console.log(replyTrHtml);
1327
											console.log(replyTrHtml);
1372
//											$(".tcdPageCode:last").before(replyTrHtml);
1328
//											$(".tcdPageCode:last").before(replyTrHtml);
1373
											$("#workContainer2").prepend(replyTrHtml);
1329
											$("#workContainer2").prepend(replyTrHtml);
1413
								var consultTrHtml;
1369
								var consultTrHtml;
1414
						        var allData = consultResponse.data;
1370
						        var allData = consultResponse.data;
1415
								var consultData = allData["data"];
1371
								var consultData = allData["data"];
1416
						        consultTrHtml = handleData(consultData,consultTrHtml,"professorId","回复","replyBtn");
1372
						        consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
1417
						        $("#workContainer").prepend(consultTrHtml);
1373
						        $("#workContainer").prepend(consultTrHtml);
1418
						        
1374
						        
1419
						        
1375
						        
1484
											var allData = response.data;
1440
											var allData = response.data;
1485
											var consultData = allData["data"];
1441
											var consultData = allData["data"];
1486
											console.log(consultData.length);
1442
											console.log(consultData.length);
1487
											consultTrHtml = handleData(consultData,consultTrHtml,"professorId","回复","replyBtn");
1443
											consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
1488
//											$(".tcdPageCode:first").before(consultTrHtml);
1444
//											$(".tcdPageCode:first").before(consultTrHtml);
1489
											$("#workContainer").prepend(consultTrHtml);
1445
											$("#workContainer").prepend(consultTrHtml);
1490
											//给咨询页回复绑定事件
1446
											//给咨询页回复绑定事件
1836
										var replyData = allData["data"];
1792
										var replyData = allData["data"];
1837
//										console.log(replyData.length);
1793
//										console.log(replyData.length);
1838
										if(replyData.length != 0 &&  replyData.length != null){
1794
										if(replyData.length != 0 &&  replyData.length != null){
1839
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
1795
											replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
1840
//											$(".tcdPageCode:last").before(replyTrHtml);	
1796
//											$(".tcdPageCode:last").before(replyTrHtml);	
1841
											$("#workContainer2").prepend(replyTrHtml);
1797
											$("#workContainer2").prepend(replyTrHtml);
1842
											
1798
											
1922
												var allData = response.data;
1878
												var allData = response.data;
1923
												var replyData = allData["data"];
1879
												var replyData = allData["data"];
1924
												var replyTrHtml;
1880
												var replyTrHtml;
1925
												replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看","lookBtn");
1881
												replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
1926
//												$(".tcdPageCode:last").before(replyTrHtml);
1882
//												$(".tcdPageCode:last").before(replyTrHtml);
1927
												$("#workContainer2").prepend(replyTrHtml);
1883
												$("#workContainer2").prepend(replyTrHtml);
1928
												
1884
												

+ 1 - 2
src/main/webapp/js/information.brow.js

597
	function consultHandler(){
597
	function consultHandler(){
598
		ConsultApply();
598
		ConsultApply();
599
		//点击的发送
599
		//点击的发送
600
		var sendConsultBtn = $("#sendConsultBtn");
601
		sendConsultBtn.on("click",sendConsultHandler);
600
		$("#sendConsultBtn").on("click",sendConsultHandler);
602
		
601
		
603
		if(userid && userid != null && userid != "null"){
602
		if(userid && userid != null && userid != "null"){
604
			$.ajax({
603
			$.ajax({

+ 60 - 9
src/main/webapp/js/search.js

1
$(function(){
1
$(function(){
2
	    var newc=GetQueryString("lookFor");
2
	    var newc=GetQueryString("lookFor");
3
	    console.log(newc);
4
	    if(newc==0||newc==""){
3
	    if(newc==0||newc==""){
5
	       var c=0;	
4
	       var c=0;	
6
	    }else{
5
	    }else{
27
					"contentType" : "application/x-www-form-urlencoded",
26
					"contentType" : "application/x-www-form-urlencoded",
28
					"success" : function($data) {							
27
					"success" : function($data) {							
29
						if ($data.success) {
28
						if ($data.success) {
30
							console.log($data);
29
//							console.log($data);
31
							$("#professorList").html("");
30
							$("#professorList").html("");
32
							for(var i = 0 ; i < $data.data.data.length ; i++){
31
							for(var i = 0 ; i < $data.data.data.length ; i++){
33
								//创建HTML标签  
32
								//创建HTML标签  
183
 						}
182
 						}
184
 						
183
 						
185
 						//找资源中点击咨询
184
 						//找资源中点击咨询
186
						$(".consultbtn").bind("click",clickConsultFn);
185
						$(".consultbtn").bind("click",clickFindResourceConsult);
187
 					},				
186
 					},				
188
 				});	
187
 				});	
189
 			}
188
 			}
445
		});
444
		});
446
	 
445
	 
447
	 
446
	 
447
	 //找资源中咨询处理函数
448
	 function clickFindResourceConsult(){
449
			var professorId = $(this).attr("id");
450
			ConsultApply();
451
			if(userid && userid != null && userid != "null"){
452
				$.ajax({
453
					"url" :"/ajax/professor/"+ professorId,
454
					"type" : "get",
455
					"data" : {"professorId":professorId},
456
					"success" : function(response) {
457
						if (response.success) {
458
//							console.log(response);
459
							$("#professorName").text(response.data["name"]);
460
							$("#professorName").attr("professorId",response.data["id"]);
461
							$("#professorTitle").text(response.data["title"]);
462
							
463
							if(response.data["department"] == "" || response.data["department"] == null){
464
								$("#profOrganization").text(response.data["organization"]["name"]);
465
							}else{
466
								$("#profDepartment").text(response.data["department"]+",");
467
								$("#profOrganization").text(response.data["organization"]["name"]);
468
								
469
							}
470
							if(response.data["adress"] == "" || response.data["adress"] == null ){
471
								$("#adress").html("");
472
							}else{
473
								$("#profAdress").text(response.data["adress"]);
474
							}
475

476
							
477
						} else {
478
							return false;
479
						}
480
					},
481
					"error":function(error){
482
						$.MsgBox.Alert("message","咨询失败");
483
					}
484
				});
485
			}
486
			else{
487
				
488
				$.MsgBox.Alert("message","请登录");
489
			}
490
			
491
			//点击的发送
492
			$("#sendConsultBtn").on("click",sendConsultHandler);
493
			$("ul.menucon").children().eq(1).addClass("clicknow");
494
			var consultTitleVal = $(this).parent().prev().find(".resouname").text();
495
			$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
496
			
497
	};
498
	 
499
	 
448
	 
500
	 
449
	//点击咨询处理函数
501
	//点击咨询处理函数
450
	 function clickConsultFn(){
502
	 function clickConsultFn(){
451
			ConsultApply();
452
			
503
		 	ConsultApply();
453
			//点击的发送
504
			//点击的发送
454
			$("#sendConsultBtn").on("click",sendConsultHandler);
505
			$("#sendConsultBtn").on("click",sendConsultHandler);
455
			var professorId = $(this).attr("id");
506
			var professorId = $(this).attr("id");
507
			
456
			if(userid && userid != null && userid != "null"){
508
			if(userid && userid != null && userid != "null"){
457
				$.ajax({
509
				$.ajax({
458
					"url" :"/ajax/professor/"+ professorId,
510
					"url" :"/ajax/professor/"+ professorId,
483
						} else {
535
						} else {
484
							$.MsgBox.Alert("message","请登录");
536
							$.MsgBox.Alert("message","请登录");
485
						}
537
						}
486
					},
487
					"complete":function(){
488
						
489
					}
538
					}
490
				});
539
				});
491
			}
540
			}
541
			else{
542
				return false;
543
			}
492
		
544
		
493
	 };
545
	 };
494
	 
546
	 
528
					//传值:咨询类型、主题、内容、专家id、申请人id
580
					//传值:咨询类型、主题、内容、专家id、申请人id
529
					"data" : consultStr,				
581
					"data" : consultStr,				
530
					"contentType" : "application/x-www-form-urlencoded",
582
					"contentType" : "application/x-www-form-urlencoded",
531
					"beforeSend":function(){console.log(this.data)},
532
					"dataType" : "json",
583
					"dataType" : "json",
533
					"success" : function(response) {
584
					"success" : function(response) {
534
						consultId = response.data;//咨询id
585
						consultId = response.data;//咨询id

+ 1 - 1
src/main/webapp/workindex.html

132
    </div>
132
    </div>
133
</div>
133
</div>
134
<!-- 我的工作台 //-->
134
<!-- 我的工作台 //-->
135
<script type="text/javascript" src="js/consultFlat.js"></script>
135
<!-- <script type="text/javascript" src="js/consultFlat.js"></script> -->
136
<script type="text/javascript" src="js/workindex.js"></script>
136
<script type="text/javascript" src="js/workindex.js"></script>