浏览代码

1.工作台:最新咨询和最新回复,数据渲染(查看全部未作)

xiaoai_123 8 年之前
父节点
当前提交
11d9aa95b9
共有 3 个文件被更改,包括 458 次插入115 次删除
  1. 325 96
      src/main/webapp/js/consultFlat.js
  2. 115 1
      src/main/webapp/js/workindex.js
  3. 18 18
      src/main/webapp/workindex.html

+ 325 - 96
src/main/webapp/js/consultFlat.js

1
/**
2
 * 
3
 */
1
function Ajax(){
4

2

5

6

7
//ajax封装函数
8

9
//创建构造函数类
10
function Conslut(){
11
	
12
		
13
};
3
};
14

4

15
Conslut.prototype = {
16
	init:function(consultanatId,professorId){
17
		var userid = $.cookie("userid");
18
		this.consultanatId = {
19
			"consultantId":userid
20
		};
21
		this.professorId = {
22
				"professorId":userid
23
		};
24
	},
25
	getConsultData:function(url,type,params,successConsultFn,errorMsg){
26
		
5
Ajax.prototype = {
6
	getHtml:function(url,method,dataType,params,contianer){
27
		$.ajax({
7
		$.ajax({
28
			"url":url,
29
			"type" : type,
30
			"data" :params,
31
			"success":successConsultFn,
32
			"error":function(){
8
			url:url,
9
			dataType:type,
10
			data:params,
11
			success:function(response){
12
				$(contianer).html(response);
13
			},
14
			error:function(errorResponse){
33
				$.MsgBox.Alert(errorMsg);
15
				$.MsgBox.Alert(errorMsg);
34
			}
16
			}
35
		});
17
		});
36
	},
18
	},
37
	getReplyData:function(url,type,params,successRelyFn,errorMsg){
19
	//url,
20
	getData:function(url,method,dataType,params,errorMsg){
21
		
38
		$.ajax({
22
		$.ajax({
39
			"url":url,
40
			"type" : type,
41
			"data" :params,
42
			"success":successRelyFn,
43
			"error":function(){
23
			url:url,
24
			dataType : dataType,
25
			type:method,
26
			data :params,
27
			success:function(response){
28
				var allData = response["data"];
29
				var total = allData["total"];
30
				var myData = allData["data"];
31
				var oData = {
32
					"myData":myData,
33
					"total":total
34
				};
35
				return oData;
36
			},
37
			error:function(errorResponse){
44
				$.MsgBox.Alert(errorMsg);
38
				$.MsgBox.Alert(errorMsg);
45
			}
39
			}
46
		});
40
		});
47
	},
41
	},
48
	getConsultHtml:function(url,type,params,successHtmlFn,errorMsg){
49
		$.ajax({
50
			"url":url,
51
			"type" : type,
52
			"data" :params,
53
			"success":successHtmlFn,
54
			"error":function(){
55
				$.MsgBox.Alert(errorMsg);
42

43
	getItemStr:function(data,htmlStr,attrParams,text,btnCls){
44
		htmlStr = '';
45
		for(var i = 0; i < data.length;i++){
46
			if(data[i]["consultStatus"] == 0){
47
				data[i]["consultStatus"] = "进行中";
48
			};
49
			if(data[i]["consultStatus"] == 1){
50
				data[i]["consultStatus"] = "完成";
51
			};
52

53
			if(data[i]["assessStatus"] == 0){
54
				data[i]["assessStatus"] = "未评价";
55
			};
56
			if(data[i]["assessStatus"] == 1){
57
				data[i]["assessStatus"] = "已评价";
58
			};
59

60
			if(data[i]["thanksStatus"] == 0){
61
				data[i]["thanksStatus"] = "未感谢";
62
			};
63
			if(data[i]["thanksStatus"] == 1){
64
				data[i]["thanksStatus"] = "已感谢";
65
			};
66

67
			htmlStr +=
68
				"<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
69
					"<table width='100%'>" +
70
						"<tbody><tr>" +
71
							"<td width='14%' class='messagebox'>" +
72
								"<a class='workhead workitimg' href='information.html'>" +
73
									"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
74
								"</a>" +
75
								"<span class='msgprompt'>1</span>" +
76
							"</td>" +
77
							"<td style='position:relative;' width='86%'>" +
78
								"<div class='workinfor worksitcon'>" +
79
									"<h4><a href='' class='named' id='nameS'> " + data[i]["professor"]["name"] +
80
										" </a><img class='modifyicon' src='images/rz.png' width='30'><input type='text' class='assessStar' value='"+data[i]["assessStar"] +"' style='display: none;'></h4>" +
81
										"<h6><span>职称  " + data[i]["professor"]["title"] +"  </span>,<span>职位  " + data[i]["consultId"] +"  </span>,<span> "
82
										+ data[i]["professor"]["orgName"] +"  </span>,<span> " + data[i]["professor"]["department"] +
83
										" </span>&nbsp;|&nbsp;<span> " + data[i]["professor"]["adress"] +"  </span></h6>" +
84
									"<h6>"+
85
									"<span>咨询主题:<em> " + data[i]["consultTitle"] +"  </em></span>" +
86
										"&nbsp;&nbsp;&nbsp;&nbsp;" +
87
										"<span>咨询类型:<em> " + data[i]["consultType"] +"  </em></span>" +
88
										"&nbsp;&nbsp;&nbsp;&nbsp;<span>" +
89
										"咨询发起时间:<em>  " +
90
										data[i]["createTime"].substr(0,4) + "-" + data[i]["createTime"].substr(4,2) + "-" + data[i]["createTime"].substr(6,2) + " "
91
											+ data[i]["createTime"].substr(8,2)+ ":" +data[i]["createTime"].substr(10,2)+
92
										"</em>" +
93
										"</span></h6>" +
94
										"<p>最后回复<span class='lasttime'> (  " +
95
										data[i]["revoveryTime"].substr(0,4) + "-" + data[i]["revoveryTime"].substr(4,2) + "-" + data[i]["revoveryTime"].substr(6,2) + " "
96
										 + data[i]["revoveryTime"].substr(8,2)+ ":" +data[i]["revoveryTime"].substr(10,2) +
97
										") </span>" +
98
										"</p>" +
99
										"<p class='rebackcon'>  " + data[i]["consultContant"] +"  </p>" +
100
										"</div>" +
101
										"<div class='workhandle'>" +
102
											"<div class='rightopert floatR'>" +
103
												"<span class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+ "'>" +text +"</span>" +
104
												"<span class='moreopert'>...</span>" +
105
												"<ul class='moreopertbtn'>" +
106
													"<li>投诉</li>" +
107
												"</ul>" +
108
											"</div>" +
109
											"<div class='leftstate floatR'>" +
110
												"<span class='coultstate'><i class='coultState'>" +data[i]["consultStatus"]+"/ </i><i class='assessStatus'> "
111
												+data[i]["assessStatus"]+" / </i><i class='thanksStatus' >"+data[i]["thanksStatus"]+"</i></span>" +
112
											"</div>" +
113
										"</div>" +
114
									"</td>" +
115
								"</tr></tbody></table>" +
116
			"</div>";
117

118
		};
119

120
		return htmlStr
121
	},
122

123
	getDilogStrFn:function(data){
124
		var htmlStr ="";
125
		var dialogitem,float,dilinfobox,dilarrow,dilarrow_bor;
126
		for(var i = 0; i < data.length;i++){
127
			if(data[i]["professor"]["id"] == userid){
128
				dialogitem = "dialogrightitem";
129
				float = "floatR";
130
				dilinfobox = "dilinfobox_r";
131
				dilarrow = "dilarrow_r";
132
				dilarrow_bor="dilarrow_r_bor";
56
			}
133
			}
57
		});
134
			else{
135
				dialogitem = "dialogleftitem";
136
				float = "floatL";
137
				dilarrow = "dilarrow_l";
138
				dilinfobox = "dilinfobox_l";
139
				dilarrow_bor="dilarrow_l_bor";
140
			}
141
			htmlStr +=
142
				"<div class='"+dialogitem+"'>" +
143
				"<div class='dilmod'>" +
144
					"<div class='diluser "+float+"'>" +
145
						"<a href='' target='_blank' class='userface'>" +
146
							"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
147
						"</a>" +
148
					"</div>" +
149
					"<div class='dilinfobox "+ dilinfobox+" "+ float +"'>" +
150
						"<div class='delinfocon clearfix'>" +
151
							"<div class='dilarrow "+ dilarrow+"'></div>" +
152
							"<div class='dilarrow "+dilarrow_bor+"'></div>" +
153
							"<div class='delinfomain "+float+"'>" +
154
								"<div class='cont'>" +
155
									"<p>"+data[i]["tidingsContant"]+"</p>" +
156
								"</div>" +
157
							"</div>" +
158
						"</div>" + //dilinfobox
159
					"</div>" + //dilinfobox
160
				"</div>" +  //dilmod
161
			"</div>" + //dialogrightitem
162
		"</div> "
163
		};
164

165
		return htmlStr;
166
	},
167

168
	getObjId:function(){
169
		return $(this).attr("id");
170
	},
171

172
	//总体评价中点击星级评价
173
	showStar:function(){
174
		var starStart;
175

176
		return function clickStar(){
177
				$(".evastar2").removeClass('addStar');
178
				starStart=$(this).index()+1;
179
				for(var i=0;i<starStart;i++){
180
					if(i<starStart){
181
						$(".evastar2").eq(i).addClass("addStar");
182
					}
183
					else{
184
						$(".evastar2").eq(i).removeClass('addStar');
185
					}
186
				}
187
				$("#startCount").val($(".addStar").length);
188
		};
58
	},
189
	},
190

191
	//点击箭头,排序
192
	sortFn:function(){
193
		var sortFlag2 = true;
194
		return function clickSortFn(){
195

196
			if(sortFlag2 == true){
197
		  		$(this).find("div").css("background-position","-20px 1px");
198
		  		$("#timeSortId2").val("1");
199

200
		  		sortFlag2 =false;
201

202
		  	}else{
203
		  		$(this).find("div").css("background-position","0px 1px");
204
		  		$("#timeSortId2").val("0");
205

206
		  		sortFlag2=true;
207
		  	};
208
		};
209
	}
210

59
}
211
}
60

212

61
//登陆人id
213
//登陆人id
62
var userid = $.cookie("userid");
214
var userid = $.cookie("userid");
63
//收到咨询数据成功函数
64
function successRelyFn(response){
65
	
66
};
215

216
var consult = new Ajax();
217

67

218

68
//data:需要处理的数据,htmlStr:页面中需要的html字符串拼接,
219
//data:需要处理的数据,htmlStr:页面中需要的html字符串拼接,
69
//attrParams:数据中不同的参数比如:收到咨询是professorId,收到答复:consultantId
220
//attrParams:数据中不同的参数比如:收到咨询是professorId,收到答复:consultantId
122
									"</div>" +
273
									"</div>" +
123
									"<div class='workhandle'>" +
274
									"<div class='workhandle'>" +
124
										"<div class='rightopert floatR'>" +
275
										"<div class='rightopert floatR'>" +
125
											"<span class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+ "'>" +text +"</span>" +
276
											"<span class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+ "' assess='"+ data[i]["assessStatus"]+ "'  thanks='"+ data[i]["thanksStatus"]+ "'>" +text +"</span>" +
126
											"<span class='moreopert'>...</span>" +
277
											"<span class='moreopert'>...</span>" +
127
											"<ul class='moreopertbtn'>" +
278
											"<ul class='moreopertbtn'>" +
128
												"<li>投诉</li>" +
279
												"<li>投诉</li>" +
129
											"</ul>" +
280
											"</ul>" +
130
										"</div>" +
281
										"</div>" +
131
										"<div class='leftstate floatR'>" +
282
										"<div class='leftstate floatR'>" +
132
											"<span class='coultstate'><i class='coultState'>" +data[i]["consultStatus"]+"/ </i><i class='assessStatus'> "+data[i]["assessStatus"]+" / </i><i class='thanksStatus' >"+data[i]["thanksStatus"]+"</i></span>" +
283
											"<span class='coultstate'><i class='coultState'>" +data[i]["consultStatus"]+"/</i><i class='assessStatus'> "+data[i]["assessStatus"]+"/ </i><i class='thanksStatus' >"+data[i]["thanksStatus"]+"</i></span>" +
133
										"</div>" +
284
										"</div>" +
134
									"</div>" +
285
									"</div>" +
135
								"</td>" +
286
								"</td>" +
207

358

208

359

209

360

210
//点击:正序倒叙函数:只改变了样式
361
/*//点击:正序倒叙函数:只改变了样式
211
var sortFlag2 = true;
362
var sortFlag2 = true;
212
function clickSortFn(){
363
function clickSortFn(){
213
	
364
	
223
  		
374
  		
224
  		sortFlag2=true;
375
  		sortFlag2=true;
225
  	};
376
  	};
226
};
227

228

377
};*/
229

378

230

379

231
$(document).ready(function(){
380
$(document).ready(function(){
526
								//============================================点击咨询页面中回复按钮=====================
675
								//============================================点击咨询页面中回复按钮=====================
527
						        function clickReplyFn(){
676
						        function clickReplyFn(){
528
									var consultId     = $.trim($(this).attr("id"));//咨询id
677
									var consultId     = $.trim($(this).attr("id"));//咨询id
529
									var assessStatus  = $.trim($(this).find(".coultState").text());//评价状态 0-未评价,1-已评价
530
									var consultStatus = $.trim($(this).find(".assessStatus").text());//咨询状态 0-进行中,1-已完成
678
									var assessStatus  = $.trim($(this).find(".assessStatus").text());//评价状态 0-未评价,1-已评价
679
									var consultStatus = $.trim($(this).find(".coultState").text());//咨询状态 0-进行中,1-已完成
531
									var thanksStatus  = $.trim($(this).find(".thanksStatus").text());//感谢状态 0-未感谢,1-已感谢
680
									var thanksStatus  = $.trim($(this).find(".thanksStatus").text());//感谢状态 0-未感谢,1-已感谢
532
									var assessStar    = $.trim($(this).find(".assessStar").val());//星级,几颗星 用隐藏域做
681
									var assessStar    = $.trim($(this).find(".assessStar").val());//星级,几颗星 用隐藏域做
533
									
682
									
723
											
872
											
724
											
873
											
725
											//==============点击确认完成
874
											//==============点击确认完成
726
											function confirmFinishFn(){
875
											function assessFn(){
727
												ConsultComment();
876
												ConsultComment();
728
												if($(this).attr("id") == "dialog_thanksBtn"){
877
												if($(this).attr("id") == "dialog_thanksBtn"){
729
													$(".overcomment").css("display","block");//显示感谢
878
													$(".overcomment").css("display","block");//显示感谢
752
												
901
												
753
											};
902
											};
754
											//绑定对话页面确认完成咨询
903
											//绑定对话页面确认完成咨询
755
											$("#dial_confirmFinishConsult").bind("click",confirmFinishFn);
904
											$("#dial_confirmFinishConsult").bind("click",assessFn);
756
											
905
											
757
											
906
											
758
											//点击发表评论:保存发表内容和星级
907
											//点击发表评论:保存发表内容和星级
783
													"success":function(response){
932
													"success":function(response){
784
														console.log(response);
933
														console.log(response);
785
														$(".blackcover").remove();
934
														$(".blackcover").remove();
786
														$("body").css("overflow","auto");
935
														$("body").css("position","static");
787
														$.MsgBox.Alert('提示',"评论成功");
936
														$.MsgBox.Alert('提示',"评论成功");
788
														
937
														
789
														//评价状态改变,所以头部信息改变
938
														//评价状态改变,所以头部信息改变
852
//											$(".tcdPageCode:last").before(replyTrHtml);	
1001
//											$(".tcdPageCode:last").before(replyTrHtml);	
853
											$("#workContainer2").prepend(replyTrHtml);
1002
											$("#workContainer2").prepend(replyTrHtml);
854
											
1003
											
1004
											
855
											$("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
1005
											$("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
856
											
1006
											
857
										}else{
1007
										}else{
962
									//=======================================================点击回复中查看
1112
									//=======================================================点击回复中查看
963
									function clickLookBtn(){
1113
									function clickLookBtn(){
964
										var consultId     = $.trim($(this).attr("id"));//咨询id
1114
										var consultId     = $.trim($(this).attr("id"));//咨询id
965
										var assessStatus  = $.trim($(this).find(".coultState").text());//评价状态 0-未评价,1-已评价
966
										var consultStatus = $.trim($(this).find(".assessStatus").text());//咨询状态 0-进行中,1-已完成
967
										var thanksStatus  = $.trim($(this).find(".thanksStatus").text());//感谢状态 0-未感谢,1-已感谢
968
										var assessStar    = $.trim($(this).find(".assessStar").val());//星级,几颗星 用隐藏域做
969
										
1115
										var assessStatus  = $.trim($(this).attr("assess"));//评价状态 0-未评价,1-已评价
1116
										/*var consultStatus = $(this).find(".coultState").text();//咨询状态 0-进行中,1-已完成
1117
										var thanksStatus  = $(this).find(".thanksStatus").text();//感谢状态 0-未感谢,1-已感谢
1118
										var assessStar    = $(this).find(".assessStar").val();//星级,几颗星 用隐藏域做
1119
*/										localStorage.setItem("consultId", consultId);
970
										//点击确认完成的传值:consultId,咨询状态
1120
										//点击确认完成的传值:consultId,咨询状态
971
										var confirmFinishStr = {
1121
										var confirmFinishStr = {
972
											"consultId":consultId,
1122
											"consultId":consultId,
976
										var consultIdStr = {
1126
										var consultIdStr = {
977
											"consultId":consultId
1127
											"consultId":consultId
978
										}
1128
										}
979

980
										//ajax加载对话页面
981
										$.ajax({
982
											"url":"diloags.html",
983
											"dataType":"html",
984
											"success":function(result){
985
												//console.log(data);
986
												$(this).attr("id");
987
												$(".workcon").html(result);
988
												
1129
										if(assessStatus == "已评价"){
1130
											//ajax加载对话页面
1131
											$.ajax({
1132
												"url":"diloags.html",
1133
												"dataType":"html",
1134
												"success":function(result){
1135
													//console.log(data);
1136
													$(this).attr("id");
1137
													$(".workcon").html(result);
1138
													
1139
													lookDialogHeadDataHandleFn();
1140
													dialogContentDataHandle();
1141
													$("#dialog_sendBtn").bind("click",sendDialogContentFn);
1142
													
1143
													
1144
												},
1145
												"error":function(error){
1146
													//console.log(data);
1147
													//加载对话页面失败
1148
													console.log(error);
1149
												}
1150
											});
1151
										}else{
1152
											assessFn();
1153
											//点击稍后评价
1154
											$("#noAssessBtn").bind("click",noAssess);
1155
											
1156
										}
1157
										
989
												//===========================================dialog数据==================
1158
												//===========================================dialog数据==================
990
												//=========对话头部
1159
												//=========对话头部
991
												//对话头部数据渲染
1160
												//对话头部数据渲染
1011
														"type":"get",
1180
														"type":"get",
1012
														"data":consultIdStr,
1181
														"data":consultIdStr,
1013
														"success":function(response){
1182
														"success":function(response){
1014
															console.log("点击查看返回数据");
1015
															console.log(response)
1183
//															console.log("点击查看返回数据");
1184
//															console.log(response)
1016
															var consultantData = response["data"];
1185
															var consultantData = response["data"];
1017
															//对话框标题信息
1186
															//对话框标题信息
1018
															//进行中,
1187
															//进行中,
1088
													
1257
													
1089
												};
1258
												};
1090
											
1259
											
1091
												lookDialogHeadDataHandleFn();
1260
												
1092
												
1261
												
1093
												//============对话内容数据处理函数
1262
												//============对话内容数据处理函数
1094
												function dialogContentDataHandle(){
1263
												function dialogContentDataHandle(){
1103
														"success":function(response){
1272
														"success":function(response){
1104
															console.log()
1273
															console.log()
1105
															var dialogConData = response["data"];
1274
															var dialogConData = response["data"];
1106
															console.log(dialogConData);
1275
//															console.log(dialogConData);
1107
															var dialogStr;
1276
															var dialogStr;
1108
															dialogStr = dialogContentStrFn(dialogConData);
1277
															dialogStr = dialogContentStrFn(dialogConData);
1109
															$("#dialogContent").prepend(dialogStr);
1278
															$("#dialogContent").prepend(dialogStr);
1116
													
1285
													
1117
													
1286
													
1118
												};
1287
												};
1119
												dialogContentDataHandle();
1288
												
1120
												
1289
												
1121
												//=============================对话页面底部发送
1290
												//=============================对话页面底部发送
1122
												//发送按钮处理函数
1291
												//发送按钮处理函数
1148
													});
1317
													});
1149
													$("#dialog_sendContent").val("");
1318
													$("#dialog_sendContent").val("");
1150
												};
1319
												};
1151
												$("#dialog_sendBtn").bind("click",sendDialogContentFn);
1152
												
1320
												
1153
												
1321
												
1154
												//==============点击确认完成
1155
												function confirmFinish(){
1322
												
1323
												//==============发表评价页
1324
												function assessFn(){
1156
													ConsultComment();
1325
													ConsultComment();
1326
													
1327
													if($.trim($(this).attr("thanks")) == "未感谢"){
1328
														$(".addcomment2").css("display","none");//
1329
														
1330
													}else{
1331
														
1332
														$(".overcomment").css("display","none");
1333
													}
1157
													//评价星星样式
1334
													//评价星星样式
1158
													var start;
1335
													var start;
1159
													function clickStar(){
1336
													function clickStar(){
1176
												};
1353
												};
1177
												
1354
												
1178
												//绑定对话页面确认完成咨询
1355
												//绑定对话页面确认完成咨询
1179
												$("#dial_confirmFinishConsult").bind("click",confirmFinishFn);
1180
												$("#dialog_assessBtn").bind("click",confirmFinishFn);
1356
												$("#dial_confirmFinishConsult").bind("click",assessFn);
1357
												$("#dialog_assessBtn").bind("click",assessFn);
1358
												
1181
												
1359
												
1182
												//点击发表评论:保存发表内容和星级
1360
												//点击发表评论:保存发表内容和星级
1183
												function clickSendAssessBtn(){
1361
												function clickSendAssessBtn(){
1362
													var consultId = localStorage.getItem("consultId");//
1184
													var assessStar = $("#startCount").val();
1363
													var assessStar = $("#startCount").val();
1185
													var assessContant = $(".resouinforcon").find("textarea").val();
1364
													var assessContant = $(".resouinforcon").find("textarea").val();
1186
													//评价状态 0-未评价,1-已评价
1365
													//评价状态 0-未评价,1-已评价
1192
														    "assessStar":assessStar, //评价星级
1371
														    "assessStar":assessStar, //评价星级
1193
														    "assessContant":assessContant //评价内容
1372
														    "assessContant":assessContant //评价内容
1194
													};
1373
													};
1195
													console.log(assessContentStr);
1374
//													console.log(assessContentStr);
1196
													//如果未评论,提示未评论
1375
													//如果未评论,提示未评论
1197
													if(assessStar == "" || assessStar == null || assessStar == undefined){
1376
													/*if(assessStar == "" || assessStar == null || assessStar == undefined){
1198
														if(assessContant == "" || assessContant == null || assessContant == undefined){
1377
														if(assessContant == "" || assessContant == null || assessContant == undefined){
1199
															$.MsgBox.Alert('提示',"未评论,是否退出评论");
1378
															$.MsgBox.Alert('提示',"未评论,是否退出评论");
1200
														}
1379
														}
1201
														$.MsgBox.Alert('提示',"未选择星级");
1380
														$.MsgBox.Alert('提示',"未选择星级");
1202
													};
1381
													};*/
1382
													//保存
1203
													$.ajax({
1383
													$.ajax({
1204
														"url":"/ajax/consult/assess",//点击发表评论接口
1384
														"url":"/ajax/consult/assess",//点击发表评论接口
1205
														"type":"post",
1385
														"type":"post",
1206
														"data":assessContentStr,
1386
														"data":assessContentStr,
1207
														"success":function(response){
1387
														"success":function(response){
1208
															console.log(response);
1388
//															console.log(response);
1209
															$(".blackcover").remove();
1389
															$(".blackcover").remove();
1210
															$("body").css("overflow","auto");
1390
															$("body").css("position","static");
1211
															$.MsgBox.Alert('提示',"评论成功");
1391
															$.MsgBox.Alert('提示',"评论成功");
1212
															
1213
															//评价状态改变,所以头部信息改变
1392
															//评价状态改变,所以头部信息改变
1214
															lookDialogHeadDataHandleFn();
1393
															lookDialogHeadDataHandleFn();
1215
														},
1394
														},
1219
														}
1398
														}
1220
														
1399
														
1221
													});
1400
													});
1401
													//发表评论
1402
													$.ajax({
1403
														"url":"diloags.html",
1404
														"dataType":"html",
1405
														"success":function(result){
1406
															//console.log(data);
1407
															$(this).attr("id");
1408
															$(".workcon").html(result);
1409
															
1410
															$(".blackcover").remove();
1411
															$("body").css("position","static");
1412
															lookDialogHeadDataHandleFn();
1413
															dialogContentDataHandle();
1414
															$("#dialog_sendBtn").bind("click",sendDialogContentFn);
1415
															
1416
															
1417
														},
1418
														"error":function(error){
1419
															//console.log(data);
1420
															//加载对话页面失败
1421
															console.log(error);
1422
														}
1423
													});
1424
													
1425
													
1426
													
1427
												};
1428
												
1429
												
1430
												//稍后评价、
1431
												function noAssess(){
1432
//													$(".blackcover").remove();
1433
//													$("body").css("position","static");
1434
													$.ajax({
1435
														"url":"diloags.html",
1436
														"dataType":"html",
1437
														"success":function(result){
1438
															//console.log(data);
1439
															$(this).attr("id");
1440
															$(".workcon").html(result);
1441
															
1442
															$(".blackcover").remove();
1443
															$("body").css("position","static");
1444
															lookDialogHeadDataHandleFn();
1445
															dialogContentDataHandle();
1446
															$("#dialog_sendBtn").bind("click",sendDialogContentFn);
1447
															
1448
															
1449
														},
1450
														"error":function(error){
1451
															//console.log(data);
1452
															//加载对话页面失败
1453
															console.log(error);
1454
														}
1455
													});
1222
												};
1456
												};
1457
												
1223
											
1458
											
1224

1459

1225
											
1460
											
1226
											},
1227
											"error":function(error){
1228
												//console.log(data);
1229
												//加载对话页面失败
1230
												console.log(error);
1231
											}
1232
										})
1461
											
1233
										
1462
										
1234
										
1463
										
1235
									};//收到回复点击查看函数结束
1464
									};//收到回复点击查看函数结束

+ 115 - 1
src/main/webapp/js/workindex.js

677
		"error":function(){$.MsgBox.Alert('message','failddd')}
677
		"error":function(){$.MsgBox.Alert('message','failddd')}
678
		})	
678
		})	
679
	}
679
	}
680
});
680
	
681
	function getConsultData(professorId){
682
		var params = {"professorId":professorId};
683
		$.ajax({
684
			"url":"/ajax/consult/pqpro",
685
			"type":"get",
686
			"async": false,
687
			"data":params,
688
			"success":function(response){
689
				var newConsultData = response["data"]["data"][0];
690
				$("#myFlatConsultTime").attr("consultId",newConsultData["consultId"]);
691
				$("#myFlatProName").html(newConsultData["professor"]["name"]);
692
				$("#myFlatProTitle").html(newConsultData["professor"]["title"]);
693
				$("#myFlatProDepartment").html(newConsultData["professor"]["orgName"]);
694
				$("#myFlatConsultTime").html(newConsultData["createTime"].substr(0,4) + "-" + newConsultData["createTime"].substr(4,2) + "-" + newConsultData["createTime"].substr(6,2) + " "
695
						+ newConsultData["createTime"].substr(8,2)+ ":" +newConsultData["createTime"].substr(10,2));
696
				$("#myFlatConsultTitle").html(newConsultData["consultTitle"]);
697
				$("#myFlatConsultContent").html(newConsultData["consultContant"]);
698
				
699
			},
700
			"error":function(){
701
				$.MsgBox.Alert('message','失败');
702
			}
703
		
704
		})
705
	}
706
	getConsultData(userid);
707
	
708
	function getReplyData(consultantId){
709
		var params = {"consultantId":consultantId};
710
		$.ajax({
711
			"url":"/ajax/consult/pqcon",
712
			"type":"get",
713
			"async": false,
714
			"data":params,
715
			"success":function(response){
716
				var newReplyData = response["data"]["data"][0];
717
				$("#myFlatRelpyTime").attr("consultId",newReplyData["consultId"])
718
				$("#myFlatReplyProName").html(newReplyData["professor"]["name"]);
719
				$("#myFlatReplyProTitle").html(newReplyData["professor"]["title"]);
720
				$("#myFlatReplyProDepartment").html(newReplyData["professor"]["orgName"]);
721
				$("#myFlatRelpyTime").html(newReplyData["createTime"].substr(0,4) + "-" + newReplyData["createTime"].substr(4,2) + "-" + newReplyData["createTime"].substr(6,2) + " "
722
						+ newReplyData["createTime"].substr(8,2)+ ":" +newReplyData["createTime"].substr(10,2));
723
				$("#myFlatRelpyTitle").html(newReplyData["consultTitle"]);
724
				$("#myFlatRelpyContent").html(newReplyData["consultContant"]);
725
				
726
			},
727
			"error":function(){
728
				$.MsgBox.Alert('message','失败');
729
			}
730
		
731
		})
732
	}
733
	getReplyData(userid);
734
	
735
	//发送userid:用户id,container:获得内容的container
736
	function newConsultSendFn(){
737
		var consultId = $("#myFlatConsultTime").attr("consultId");
738
		var consultCon = $("#myFlatConsultCon").val();
739
		var params = {
740
				"tidingsContant":consultCon,
741
				"consultId":consultId,
742
				"senderId":userid		
743
		}
744
		$.ajax({
745
			url:"/ajax/tidings",
746
			type:"post",
747
//			async:false,
748
			data:params,
749
			success:function(response){
750
				console.log(response);
751
			},
752
			error:function(error){
753
				
754
			}
755
			
756
		});
757
		
758
		$("#myFlatConsultCon").val("");
759
	};
760
	
761
	function newReplySendFn(){
762
		var consultId = $("#myFlatRelpyTime").attr("consultId");
763
		var consultCon = $("#myFlatReplyCon").val();
764
		var params = {
765
				"tidingsContant":consultCon,
766
				"consultId":consultId,
767
				"senderId":userid		
768
		}
769
		$.ajax({
770
			url:"/ajax/tidings",
771
			type:"post",
772
//			async:false,
773
			data:params,
774
			success:function(response){
775
				console.log(response);
776
			},
777
			error:function(error){
778
				
779
			}
780
			
781
		});
782
//		$.MsgBox.Alert("消息","回复成功!");
783
		$("#myFlatReplyCon").val("");
784
	};
785
	
786
	//最新咨询中的发送
787
	$("#myFlatSendConsultBtn").bind("click",newConsultSendFn);
788
	//最新回复中的发送
789
	$("#myFlatSendReplyBtn").bind("click",newReplySendFn);
790
	
791
	
792
	
793
});
794


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

41
            <!--最新咨询、最新回复-->
41
            <!--最新咨询、最新回复-->
42
            <div class="workblock">
42
            <div class="workblock">
43
                <div class="floatL worksubblock">
43
                <div class="floatL worksubblock">
44
                    <div class="worktit">最新咨询<a class="worklinkbtn floatR">查看全部</a></div>
44
                    <div class="worktit">最新咨询<a class="worklinkbtn floatR" href="">查看全部</a></div>
45
                    <div class="wbcon">
45
                    <div class="wbcon">
46
                        <div class="leftwb floatL">
46
                        <div class="leftwb floatL">
47
                            <a href="" class="wbimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>
47
                            <a href="" class="wbimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>
48
                            <p>专家姓名</p>
49
                            <p>职称,职位</p>
50
                            <p>XXX学校,XXX机构</p>
48
                            <p id="myFlatProName">专家姓名</p>
49
                            <p id="myFlatProTitle">职称,职位</p>
50
                            <p id="myFlatProDepartment">XXX学校,XXX机构</p>
51
                        </div>
51
                        </div>
52
                        <div class="rightwb floatL">
52
                        <div class="rightwb floatL">
53
                            <ul class="evasort">
53
                            <ul class="evasort">
54
                                <li class="worktopic">咨询时间:<span>2016-09-06</span></li>
55
                                <li class="worktopic">咨询主题:<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </span></li>
56
                                <li class="workrecord"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.consectetur adipiscing elit.consectetur adipiscing elit. </span></li>
54
                                <li class="worktopic">咨询时间:<span id="myFlatConsultTime">2016-09-06</span></li>
55
                                <li class="worktopic">咨询主题:<span id="myFlatConsultTitle">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </span></li>
56
                                <li class="workrecord"><span id="myFlatConsultContent">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.consectetur adipiscing elit.consectetur adipiscing elit. </span></li>
57
                            </ul>
57
                            </ul>
58
                            <div class="writespan floatL">快速回复:</div>
58
                            <div class="writespan floatL">快速回复:</div>
59
                            <form class="writebackbox">
59
                            <form class="writebackbox">
60
                                <textarea class="frmtype"></textarea>
61
                                <input type="button" name="enterback" value="发送" class="writeback floatR">
60
                                <textarea class="frmtype" id="myFlatConsultCon"></textarea>
61
                                <input type="button" name="enterback" value="发送" id="myFlatSendConsultBtn" class="writeback floatR">
62
                            </form>
62
                            </form>
63
                        </div>
63
                        </div>
64
                    </div>
64
                    </div>
65
                                
65
                                
66
                </div>
66
                </div>
67
                <div class="floatL worksubblock">
67
                <div class="floatL worksubblock">
68
                    <div class="worktit">最新回复<a class="worklinkbtn floatR">查看全部</a></div>
68
                    <div class="worktit">最新回复<a class="worklinkbtn floatR" href="">查看全部</a></div>
69
                    <div class="wbcon">
69
                    <div class="wbcon">
70
                        <div class="leftwb floatL">
70
                        <div class="leftwb floatL">
71
                            <a href="" class="wbimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>
71
                            <a href="" class="wbimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>
72
                            <p>专家姓名</p>
73
                            <p>职称,职位</p>
74
                            <p>XXX学校,XXX机构</p>
72
                            <p id="myFlatReplyProName">专家姓名</p>
73
                            <p id="myFlatReplyProTitle">职称,职位</p>
74
                            <p id="myFlatReplyProDepartment">XXX学校,XXX机构</p>
75
                        </div>
75
                        </div>
76
                        <div class="rightwb floatL">
76
                        <div class="rightwb floatL">
77
                            <ul class="evasort">
77
                            <ul class="evasort">
78
                                <li class="worktopic">咨询时间:<span>2016-09-06</span></li>
79
                                <li class="worktopic">咨询主题:<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </span></li>
80
                                <li class="workrecord"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.consectetur adipiscing elit.consectetur adipiscing elit. </span></li>
78
                                <li class="worktopic">咨询时间:<span id="myFlatRelpyTime" >2016-09-06</span></li>
79
                                <li class="worktopic">咨询主题:<span id="myFlatRelpyTitle">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </span></li>
80
                                <li class="workrecord"><span id="myFlatRelpyContent">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.consectetur adipiscing elit.consectetur adipiscing elit. </span></li>
81
                            </ul>
81
                            </ul>
82
                            <div class="writespan floatL">快速回复:</div>
82
                            <div class="writespan floatL">快速回复:</div>
83
                            <form class="writebackbox">
83
                            <form class="writebackbox">
84
                                <textarea class="frmtype"></textarea>
85
                                <input type="button" name="enterback" value="发送" class="writeback floatR">
84
                                <textarea class="frmtype" id="myFlatReplyCon"></textarea>
85
                                <input type="button" name="enterback" value="发送" id="myFlatSendReplyBtn" class="writeback floatR">
86
                            </form>
86
                            </form>
87
                        </div>
87
                        </div>
88
                    </div>
88
                    </div>