|
@ -1,14 +1,5 @@
|
1
|
|
//用于判断是否收到咨询传值
|
|
1
|
//用户id
|
2
|
2
|
var userid = $.cookie("userid");
|
3
|
|
var professorIdStrByconsult = {
|
4
|
|
"professorId":userid
|
5
|
|
|
6
|
|
};
|
7
|
|
//用于收到回复传值
|
8
|
|
var consultIdStrByReply = {
|
9
|
|
"consultantId":userid,
|
10
|
|
|
11
|
|
};
|
12
|
3
|
|
13
|
4
|
//点击主页面咨询
|
14
|
5
|
$(".workmenu").on("click","#consultbtn",clickConsultBtn);
|
|
@ -51,8 +42,7 @@ function handleData(data,attrParams,btnCls){
|
51
|
42
|
}
|
52
|
43
|
|
53
|
44
|
var unread = unreadConsultFn (userid,data[i]["consultId"],i);
|
54
|
|
|
55
|
|
|
|
45
|
|
56
|
46
|
|
57
|
47
|
htmlStr +=
|
58
|
48
|
"<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
|
|
@ -100,10 +90,7 @@ function handleData(data,attrParams,btnCls){
|
100
|
90
|
"</div>" +
|
101
|
91
|
"</td>" +
|
102
|
92
|
"</tr></tbody></table>" +
|
103
|
|
"</div>";
|
104
|
|
|
105
|
|
|
106
|
|
|
|
93
|
"</div>";
|
107
|
94
|
|
108
|
95
|
};
|
109
|
96
|
|
|
@ -140,15 +127,13 @@ function unreadConsultFn (senderId,consultId,i){
|
140
|
127
|
});
|
141
|
128
|
return {"unreadCount":unreadCount,
|
142
|
129
|
"style":style
|
143
|
|
}
|
|
130
|
}
|
144
|
131
|
|
145
|
132
|
|
146
|
133
|
};
|
147
|
134
|
|
148
|
135
|
|
149
|
136
|
|
150
|
|
|
151
|
|
|
152
|
137
|
//列表最后回复
|
153
|
138
|
function lastReplyFn(sendId,consultId){
|
154
|
139
|
|
|
@ -174,7 +159,7 @@ function lastReplyFn(sendId,consultId){
|
174
|
159
|
|
175
|
160
|
},
|
176
|
161
|
error:function(error){
|
177
|
|
|
|
162
|
$.MsgBox.Alert('提示',"最后回复数据失败");
|
178
|
163
|
}
|
179
|
164
|
|
180
|
165
|
});
|
|
@ -250,25 +235,24 @@ var getMyData = function (url,pageSize,pageNo,isbind,status,timeType,sortType){
|
250
|
235
|
$.ajax({
|
251
|
236
|
url:url,//收到回复接口,//收到回复接口
|
252
|
237
|
type:"get",
|
253
|
|
//传值:登陆人id:咨询id
|
254
|
238
|
data :params,
|
255
|
239
|
dataType: "json",
|
256
|
240
|
contentType: "application/x-www-form-urlencoded",
|
257
|
241
|
"success":function(response){
|
258
|
|
|
259
|
|
/*if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
|
260
|
|
$.MsgBox.Alert('提示',"没有收到回复");
|
261
|
|
return false;
|
|
242
|
$("#workContainer2 .workselectitem").remove();
|
|
243
|
if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
|
|
244
|
// $.MsgBox.Alert('提示',"没有收到回复");
|
|
245
|
$("#workContainer").prepend("<div>没有咨询</div>");
|
|
246
|
// return false;
|
262
|
247
|
}
|
263
|
|
else{*/
|
|
248
|
else{
|
264
|
249
|
//拿到收到回复数据
|
265
|
250
|
var replyStr;
|
266
|
251
|
var allData = response.data;
|
267
|
252
|
var myData = allData.data;
|
268
|
|
$("#workContainer2 .workselectitem").remove();
|
|
253
|
|
269
|
254
|
if(myData.length != 0 && myData.length != null){
|
270
|
255
|
replyStr = handleData(myData,"consultId","lookBtn");
|
271
|
|
// console.log(replyStr);
|
272
|
256
|
$("#workContainer2").prepend(replyStr);
|
273
|
257
|
|
274
|
258
|
// $("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
|
|
@ -286,7 +270,7 @@ var getMyData = function (url,pageSize,pageNo,isbind,status,timeType,sortType){
|
286
|
270
|
}else{
|
287
|
271
|
return false;
|
288
|
272
|
}
|
289
|
|
// }
|
|
273
|
}
|
290
|
274
|
|
291
|
275
|
},
|
292
|
276
|
"error":function(response){
|
|
@ -308,7 +292,7 @@ var getConsultData = function (url,pageSize,pageNo,isbind,status,timeType,sortTy
|
308
|
292
|
};
|
309
|
293
|
|
310
|
294
|
$.ajax({
|
311
|
|
url:url,//收到回复接口,//收到回复接口
|
|
295
|
url:url,
|
312
|
296
|
type:"get",
|
313
|
297
|
//传值:登陆人id:咨询id
|
314
|
298
|
data :params,
|
|
@ -317,16 +301,17 @@ var getConsultData = function (url,pageSize,pageNo,isbind,status,timeType,sortTy
|
317
|
301
|
contentType: "application/x-www-form-urlencoded",
|
318
|
302
|
success:function(response){
|
319
|
303
|
|
320
|
|
//拿到收到回复数据
|
321
|
|
// if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
|
322
|
|
// $.MsgBox.Alert('提示',"没有此项数据");
|
323
|
|
// return false;
|
324
|
|
// }
|
325
|
|
// else{
|
|
304
|
//拿到收到咨询数据
|
|
305
|
$("#workContainer .workselectitem").remove();
|
|
306
|
if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
|
|
307
|
// $("#workContainer").prepend("<div style='text-align: center;font-weight: 700;color: blue;'>没有咨询</div>");
|
|
308
|
return false;
|
|
309
|
}
|
|
310
|
else{
|
326
|
311
|
var consultStr;
|
327
|
312
|
var allData = response.data;
|
328
|
313
|
var myData = allData["data"];
|
329
|
|
$("#workContainer .workselectitem").remove();
|
|
314
|
|
330
|
315
|
if(myData.length != 0 && myData.length != null){
|
331
|
316
|
consultStr = handleData(myData,"professorId","lookBtn");
|
332
|
317
|
|
|
@ -346,7 +331,7 @@ var getConsultData = function (url,pageSize,pageNo,isbind,status,timeType,sortTy
|
346
|
331
|
}else{
|
347
|
332
|
return false;
|
348
|
333
|
}
|
349
|
|
// }
|
|
334
|
}
|
350
|
335
|
|
351
|
336
|
},
|
352
|
337
|
error:function(response){
|
|
@ -423,6 +408,7 @@ function clickLookBtn2(sendId,attrParams,consultId,consultStatus,assessStatus,th
|
423
|
408
|
|
424
|
409
|
};
|
425
|
410
|
|
|
411
|
//对话标题处理函数
|
426
|
412
|
function dialogHeadFn2(url,attrParams,consultId,thanksStatus){
|
427
|
413
|
|
428
|
414
|
$.ajax({
|
|
@ -432,7 +418,6 @@ function dialogHeadFn2(url,attrParams,consultId,thanksStatus){
|
432
|
418
|
aysnc:false,
|
433
|
419
|
success:function(response){
|
434
|
420
|
var myData = response["data"];
|
435
|
|
// console.log(myData);
|
436
|
421
|
//咨询
|
437
|
422
|
if(attrParams == 'professorId'){
|
438
|
423
|
|
|
@ -454,7 +439,7 @@ function dialogHeadFn2(url,attrParams,consultId,thanksStatus){
|
454
|
439
|
$("#dial_consultName").text(myData["professor"]["name"]);//与@@@对话
|
455
|
440
|
$(".dialogfoot").css("display","none");//隐藏发送对话部分
|
456
|
441
|
//如果评价
|
457
|
|
if(myData["assessStatus"] == 1){alert("已评价")
|
|
442
|
if(myData["assessStatus"] == 1){
|
458
|
443
|
|
459
|
444
|
var startConut = myData["assessStar"];
|
460
|
445
|
for(var i = 0; i < startConut; i ++){
|
|
@ -463,9 +448,10 @@ function dialogHeadFn2(url,attrParams,consultId,thanksStatus){
|
463
|
448
|
$("#showAllAssess").removeClass("displayNone");//总体评价
|
464
|
449
|
|
465
|
450
|
//如果感谢
|
466
|
|
if(myData["thanksStatus"] == 1){alert("已感谢")
|
|
451
|
if(myData["thanksStatus"] == 1){
|
|
452
|
|
467
|
453
|
if(myData["thanksMoney"] != null && myData["thanksMoney"] != undefined && myData["thanksMoney"] != "" && myData["thanksMoney"] != 0 ){
|
468
|
|
alert("money");
|
|
454
|
|
469
|
455
|
$("#dialog_thanks").removeClass("displayNone");//感谢
|
470
|
456
|
$("#dialog_thanksMoney").text(myData["thanksMoney"]);
|
471
|
457
|
}
|
|
@ -574,17 +560,16 @@ function clickConfirmFn(consultId,thanksStatus){
|
574
|
560
|
"consultStatus":"1", //咨询状态 0-进行中,1-已完成
|
575
|
561
|
},
|
576
|
562
|
success:function(response){
|
577
|
|
// console.log(response);
|
578
|
|
dialogHeadFn2("/ajax/consult/qacon","consultId",consultId,thanksStatus);
|
579
|
|
dialogContentDataHandle2(consultId);
|
580
|
|
|
581
|
|
|
|
563
|
console.log(response);
|
|
564
|
assessFn2(consultId,"consultId",thanksStatus);
|
582
|
565
|
},
|
583
|
566
|
error:function(error){
|
584
|
567
|
|
585
|
568
|
}
|
586
|
569
|
});
|
587
|
|
assessFn2(consultId,"consultId",thanksStatus);
|
|
570
|
|
|
571
|
// dialogHeadFn2("/ajax/consult/qacon","consultId",consultId,thanksStatus);
|
|
572
|
// dialogContentDataHandle2(consultId);
|
588
|
573
|
|
589
|
574
|
}
|
590
|
575
|
|
|
@ -631,9 +616,6 @@ function sendDialogContentFn2(sendId,consultId){
|
631
|
616
|
};
|
632
|
617
|
|
633
|
618
|
|
634
|
|
|
635
|
|
|
636
|
|
|
637
|
619
|
//评价字数限制
|
638
|
620
|
//字数限制函数
|
639
|
621
|
function limitTextCountFn(){
|
|
@ -798,6 +780,19 @@ function clickConsultBtn(){
|
798
|
780
|
"success":function(responseHtml){
|
799
|
781
|
$(".workcon").html(responseHtml);
|
800
|
782
|
|
|
783
|
//On Click Event 收到咨询和收到回复tab效果
|
|
784
|
$(".worksamlltit3").bind("click",tab);
|
|
785
|
function tab(){
|
|
786
|
$(".worksamlltit3").removeClass("worksamlltitnow");
|
|
787
|
$(this).addClass("worksamlltitnow");
|
|
788
|
$(".workmysrc3").hide();
|
|
789
|
var activeTab = $(this).attr("href");
|
|
790
|
$(activeTab).fadeIn();
|
|
791
|
|
|
792
|
return false;
|
|
793
|
};
|
|
794
|
|
|
795
|
|
801
|
796
|
//收到咨询
|
802
|
797
|
getConsultData("/ajax/consult/pqpro","5",1,true,0,0,0);
|
803
|
798
|
//点击下拉菜单
|
|
@ -826,53 +821,117 @@ function clickConsultBtn(){
|
826
|
821
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
827
|
822
|
});
|
828
|
823
|
|
829
|
|
//
|
830
|
|
getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
|
831
|
|
//点击下拉菜单
|
832
|
|
$(".replyOption ul").find("li").click(function(){
|
833
|
|
|
834
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
835
|
|
});
|
836
|
|
$(".timeOption2 ul").find("li").click(function(){
|
837
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$(this).attr("tim"),$("#timeSortId2").val());
|
|
824
|
//无咨询
|
|
825
|
if($("#workContainer").find(".workselectitem").length == 0 ){
|
|
826
|
|
|
827
|
$(".workcontit .worksamlltit3").eq(0).css("display","none");
|
|
828
|
$(".worksubcon .workmysrc3 ").eq(0).css("display","none");
|
|
829
|
$(".workcontit .worksamlltit3").eq(0).removeClass("worksamlltitnow");
|
|
830
|
|
|
831
|
$(".worksubcon .workmysrc3 ").eq(1).css("display","block");
|
|
832
|
$(".workcontit .worksamlltit3").eq(1).addClass("worksamlltitnow");
|
|
833
|
|
|
834
|
//回复
|
|
835
|
getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
|
|
836
|
//点击下拉菜单
|
|
837
|
$(".replyOption ul").find("li").click(function(){
|
|
838
|
|
|
839
|
getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
|
840
|
});
|
|
841
|
$(".timeOption2 ul").find("li").click(function(){
|
|
842
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$(this).attr("tim"),$("#timeSortId2").val());
|
|
843
|
});
|
|
844
|
var sortFlag2 = true;
|
|
845
|
$("#replyArrow").click(function(){
|
|
846
|
|
|
847
|
if(sortFlag2 == true){
|
|
848
|
$(this).find("div").css("background-position","-20px 1px");
|
|
849
|
$("#timeSortId2").val("1");
|
|
850
|
sortFlag2 =false;
|
|
851
|
|
|
852
|
}else{
|
|
853
|
$(this).find("div").css("background-position","0px 1px");
|
|
854
|
$("#timeSortId2").val("0");
|
|
855
|
|
|
856
|
sortFlag2=true;
|
|
857
|
}
|
|
858
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
838
|
859
|
});
|
839
|
|
var sortFlag2 = true;
|
840
|
|
$("#replyArrow").click(function(){
|
|
860
|
}
|
|
861
|
|
841
|
862
|
|
842
|
|
if(sortFlag2 == true){
|
843
|
|
$(this).find("div").css("background-position","-20px 1px");
|
844
|
|
$("#timeSortId2").val("1");
|
845
|
|
sortFlag2 =false;
|
846
|
|
|
847
|
|
}else{
|
848
|
|
$(this).find("div").css("background-position","0px 1px");
|
849
|
|
$("#timeSortId2").val("0");
|
850
|
|
|
851
|
|
sortFlag2=true;
|
852
|
|
}
|
853
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
854
|
|
});
|
855
|
|
|
856
|
|
|
857
|
|
//On Click Event 收到咨询和收到回复tab效果
|
858
|
|
$(".worksamlltit3").bind("click",tab);
|
859
|
|
function tab(){
|
860
|
|
$(".worksamlltit3").removeClass("worksamlltitnow");
|
861
|
|
$(this).addClass("worksamlltitnow");
|
862
|
|
$(".workmysrc3").hide();
|
863
|
|
var activeTab = $(this).attr("href");
|
864
|
|
$(activeTab).fadeIn();
|
865
|
|
|
866
|
|
return false;
|
867
|
|
};
|
868
|
|
|
869
|
|
|
|
863
|
|
|
864
|
|
|
865
|
|
|
866
|
$(".workcontit .worksamlltit3").eq(0).click(function(){
|
|
867
|
|
|
868
|
//收到咨询
|
|
869
|
getConsultData("/ajax/consult/pqpro","5",1,true,0,0,0);
|
|
870
|
//点击下拉菜单
|
|
871
|
$(".consultOption ul").find("li").click(function(){
|
|
872
|
|
|
873
|
getConsultData("/ajax/consult/pqpro","5",1,true,$(this).attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
|
874
|
});
|
|
875
|
$(".timeOption ul").find("li").click(function(){
|
|
876
|
|
|
877
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$(this).attr("tim"),$("#timeSortId").val());
|
|
878
|
});
|
|
879
|
var sortFlag = true;
|
|
880
|
$("#consultArrow").click(function(){
|
|
881
|
|
|
882
|
if(sortFlag == true){
|
|
883
|
$(this).find("div").css("background-position","-20px 1px");
|
|
884
|
$("#timeSortId").val("1");
|
|
885
|
sortFlag = false;
|
|
886
|
}else{
|
|
887
|
$(this).find("div").css("background-position","0px 1px");
|
|
888
|
$("#timeSortId").val("0");
|
|
889
|
sortFlag=true;
|
|
890
|
}
|
|
891
|
|
|
892
|
|
|
893
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
|
894
|
});
|
|
895
|
|
|
896
|
});
|
|
897
|
|
|
898
|
|
|
899
|
$(".workcontit .worksamlltit3").eq(1).click(function(){
|
|
900
|
|
|
901
|
//回复
|
|
902
|
getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
|
|
903
|
//点击下拉菜单
|
|
904
|
$(".replyOption ul").find("li").click(function(){
|
|
905
|
|
|
906
|
getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
|
907
|
});
|
|
908
|
$(".timeOption2 ul").find("li").click(function(){
|
|
909
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$(this).attr("tim"),$("#timeSortId2").val());
|
|
910
|
});
|
|
911
|
var sortFlag2 = true;
|
|
912
|
$("#replyArrow").click(function(){
|
|
913
|
|
|
914
|
if(sortFlag2 == true){
|
|
915
|
$(this).find("div").css("background-position","-20px 1px");
|
|
916
|
$("#timeSortId2").val("1");
|
|
917
|
sortFlag2 =false;
|
|
918
|
|
|
919
|
}else{
|
|
920
|
$(this).find("div").css("background-position","0px 1px");
|
|
921
|
$("#timeSortId2").val("0");
|
|
922
|
|
|
923
|
sortFlag2=true;
|
|
924
|
}
|
|
925
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
|
926
|
});
|
|
927
|
|
|
928
|
});
|
|
929
|
|
870
|
930
|
},
|
871
|
931
|
})
|
872
|
932
|
|
873
|
933
|
|
874
|
934
|
|
875
|
|
|
876
|
935
|
|
877
|
936
|
}else{
|
878
|
937
|
$.MsgBox.Alert('提醒',"您尚未登录");
|