xiaoai_123 преди 8 години
родител
ревизия
479238d647
променени са 2 файла, в които са добавени 53 реда и са изтрити 39 реда
  1. 1 1
      src/main/webapp/css/workspace.css
  2. 52 38
      src/main/webapp/js/consultFlat.js

+ 1 - 1
src/main/webapp/css/workspace.css

27
.workmysrctit{font-size:16px;line-height:30px;position:relative;}
27
.workmysrctit{font-size:16px;line-height:30px;position:relative;}
28
.worksamlltit{ font-size:13px;line-height:30px; margin:0 10px; padding:10px;cursor:pointer;}
28
.worksamlltit{ font-size:13px;line-height:30px; margin:0 10px; padding:10px;cursor:pointer;}
29
.worksamlltitnow{ border-bottom:1px solid #ff8400; color:#ff8400;text-decoration: none;}
29
.worksamlltitnow{ border-bottom:1px solid #ff8400; color:#ff8400;text-decoration: none;}
30
.workcontit a:link{color:#313131;}
30
.workcontit a:link,.workcontit a:active,.workcontit a:visited  {color:#313131;}
31

31

32
.workmysrc{display:none;}
32
.workmysrc{display:none;}
33
.workmysrc:first-child{display:block;}
33
.workmysrc:first-child{display:block;}

+ 52 - 38
src/main/webapp/js/consultFlat.js

50
			data[i]["professor"]["office"] = '';
50
			data[i]["professor"]["office"] = '';
51
		}
51
		}
52
		
52
		
53

54
		//未读信息接口
55
		var unreadConsultFn = function (senderId,consultId){
56
			var unreadCount;
57
			var params = {
58
					    "senderId":senderId, //发送者ID
59
					    "consultId":consultId //咨询ID
60
					};
61
			$.ajax({
62
				url:"/ajax/tidings/qaNotReadTidings",
63
				type:"get",
64
				async:false,
65
				data:params,
66
				success:function(response){
67
					unreadCount = response["data"];
68
				},
69
				error:function(error){
70
					$.MsgBox.Alert('提示',"未读消息请求失败");
71
				}
72
				
73
			});
74
			return unreadCount;
75
			console.log(unreadCount);
76
		};
53
		var unread = unreadConsultFn (userid,data[i]["consultId"],i);
54
		
77
		
55
		
78
		
56
		
79
		htmlStr += 
57
		htmlStr += 
84
							"<a class='workhead workitimg'>" +
62
							"<a class='workhead workitimg'>" +
85
								"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
63
								"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
86
							"</a>" +
64
							"</a>" +
87
							"<span class='msgprompt showUnreadMsg' id='" +data[i]["consultId"] +"'>"+unreadConsultFn(userid,data[i]["consultId"])+"</span>" +
65
							"<span class='msgprompt showUnreadMsg' style='"+unread.style+"' id='" +data[i]["consultId"] +"'>"+unread.unreadCount+"</span>" +
88
						"</td>" +
66
						"</td>" +
89
						"<td style='position:relative;' width='86%'>" +
67
						"<td style='position:relative;' width='86%'>" +
90
							"<div class='workinfor worksitcon'>" +
68
							"<div class='workinfor worksitcon'>" +
125
		"</div>";
103
		"</div>";
126
		
104
		
127
		
105
		
106
		
107
		
128
	};
108
	};
129

109

130
	return htmlStr
110
	return htmlStr
131
};
111
};
132

112

133

113

114
//未读信息接口
115
function unreadConsultFn (senderId,consultId,i){
116
	var unreadCount,style;
117
	var params = {
118
			    "senderId":senderId, //发送者ID
119
			    "consultId":consultId //咨询ID
120
			};
121
	$.ajax({
122
		url:"/ajax/tidings/qaNotReadTidings",
123
		type:"get",
124
		async:false,
125
		data:params,
126
		success:function(response){
127
			unreadCount = response["data"];
128
			console.log()
129
			if(unreadCount == 0){
130
				style = "display:none;"
131
			}else{
132
				style = "display:block;"
133
				
134
			}
135
		},
136
		error:function(error){
137
			$.MsgBox.Alert('提示',"未读消息请求失败");
138
		}
139
		
140
	});
141
	return {"unreadCount":unreadCount,
142
			"style":style
143
			}
144
	
145

146
};
147

148

149

150

151

134
//列表最后回复
152
//列表最后回复
135
function lastReplyFn(sendId,consultId){
153
function lastReplyFn(sendId,consultId){
136
	
154
	
228
		    "pageSize":pageSize, //每页记录数 默认为5
246
		    "pageSize":pageSize, //每页记录数 默认为5
229
		    "pageNo":pageNo //当前页码 默认为1
247
		    "pageNo":pageNo //当前页码 默认为1
230
		};
248
		};
231
	console.log("回复参数");
232
	console.log(params)
249
	
233
	$.ajax({
250
	$.ajax({
234
    	url:url,//收到回复接口,//收到回复接口
251
    	url:url,//收到回复接口,//收到回复接口
235
		type:"get",
252
		type:"get",
238
		dataType: "json",
255
		dataType: "json",
239
		contentType: "application/x-www-form-urlencoded",
256
		contentType: "application/x-www-form-urlencoded",
240
		"success":function(response){
257
		"success":function(response){
241
			console.log("收到回复数据");
242
			console.log(response);
258
			
243
			/*if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
259
			/*if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
244
				$.MsgBox.Alert('提示',"没有收到回复");
260
				$.MsgBox.Alert('提示',"没有收到回复");
245
				return false;
261
				return false;
290
		    "pageSize":pageSize, //每页记录数 默认为5
306
		    "pageSize":pageSize, //每页记录数 默认为5
291
		    "pageNo":pageNo //当前页码 默认为1
307
		    "pageNo":pageNo //当前页码 默认为1
292
		};
308
		};
293
	console.log("咨询参数");
294
	console.log(params)
309
	
295
	$.ajax({
310
	$.ajax({
296
    	url:url,//收到回复接口,//收到回复接口
311
    	url:url,//收到回复接口,//收到回复接口
297
		type:"get",
312
		type:"get",
301
		dataType: "json",
316
		dataType: "json",
302
		contentType: "application/x-www-form-urlencoded",
317
		contentType: "application/x-www-form-urlencoded",
303
		success:function(response){
318
		success:function(response){
304
			console.log("收到咨询数据");
305
			console.log(response);
319
			
306
			//拿到收到回复数据
320
			//拿到收到回复数据
307
//			if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
321
//			if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
308
//				$.MsgBox.Alert('提示',"没有此项数据");
322
//				$.MsgBox.Alert('提示',"没有此项数据");
363
			error:function(error){
377
			error:function(error){
364
				//console.log(data);
378
				//console.log(data);
365
				//加载对话页面失败
379
				//加载对话页面失败
366
				console.log(error);
380
//				console.log(error);
367
			}
381
			}
368
		})
382
		})
369

383

401
			error:function(error){
415
			error:function(error){
402
				//console.log(data);
416
				//console.log(data);
403
				//加载对话页面失败
417
				//加载对话页面失败
404
				console.log(error);
418
//				console.log(error);
405
			}
419
			}
406
			
420
			
407
		})
421
		})
560
		    "consultStatus":"1", //咨询状态 0-进行中,1-已完成
574
		    "consultStatus":"1", //咨询状态 0-进行中,1-已完成
561
		},
575
		},
562
		success:function(response){
576
		success:function(response){
563
			console.log(response);
577
//			console.log(response);
564
			dialogHeadFn2("/ajax/consult/qacon","consultId",consultId,thanksStatus);
578
			dialogHeadFn2("/ajax/consult/qacon","consultId",consultId,thanksStatus);
565
			dialogContentDataHandle2(consultId);
579
			dialogContentDataHandle2(consultId);
566
			
580
			
604
		"type":"post",
618
		"type":"post",
605
		"data":{"tidingsContant":tidingsContant,"senderId":sendId,"consultId":consultId},
619
		"data":{"tidingsContant":tidingsContant,"senderId":sendId,"consultId":consultId},
606
		"success":function(response){
620
		"success":function(response){
607
			console.log(response);//返回对话内容的id
621
//			console.log(response);//返回对话内容的id
608
			$("#dialogContent").empty();
622
			$("#dialogContent").empty();
609
			dialogContentDataHandle2(consultId);
623
			dialogContentDataHandle2(consultId);
610
		},
624
		},
816
			        getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
830
			        getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
817
			        //点击下拉菜单
831
			        //点击下拉菜单
818
			        $(".replyOption ul").find("li").click(function(){
832
			        $(".replyOption ul").find("li").click(function(){
819
			        	console.log($("#showTimeSort2"));
833
			        	
820
			        	getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
834
			        	getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
821
			        	});
835
			        	});
822
					$(".timeOption2 ul").find("li").click(function(){
836
					$(".timeOption2 ul").find("li").click(function(){