|
@ -46,6 +46,10 @@ function handleData(data,attrParams,btnCls){
|
46
|
46
|
if(data[i]["professor"]["adress"] == undefined){
|
47
|
47
|
data[i]["professor"]["adress"] = '';
|
48
|
48
|
};
|
|
49
|
if(data[i]["professor"]["office"] == undefined){
|
|
50
|
data[i]["professor"]["office"] = '';
|
|
51
|
}
|
|
52
|
|
49
|
53
|
|
50
|
54
|
//未读信息接口
|
51
|
55
|
var unreadConsultFn = function (senderId,consultId){
|
|
@ -85,7 +89,7 @@ function handleData(data,attrParams,btnCls){
|
85
|
89
|
"<td style='position:relative;' width='86%'>" +
|
86
|
90
|
"<div class='workinfor worksitcon'>" +
|
87
|
91
|
"<h4><a class='named' id='nameS'> " + data[i]["professor"]["name"] +" </a><img class='modifyicon' src='images/rz.png' width='30'><input type='text' class='assessStar' value='"+data[i]["assessStar"] +"' style='display: none;'></h4>" +
|
88
|
|
"<h6><span>职称 " + data[i]["professor"]["title"] +" </span>,<span>职位 </span>,<span> " + data[i]["professor"]["orgName"] +" </span>,<span> " + data[i]["professor"]["department"] +" </span> | <span> " + data[i]["professor"]["adress"] +" </span></h6>" +
|
|
92
|
"<h6><span>职称 " + data[i]["professor"]["title"] +" </span>,<span>职位"+data[i]["professor"]["office"]+"</span>,<span> " + data[i]["professor"]["orgName"] +" </span>,<span> " + data[i]["professor"]["department"] +" </span> | <span> " + data[i]["professor"]["adress"] +" </span></h6>" +
|
89
|
93
|
"<h6>"+
|
90
|
94
|
"<span>咨询主题:<em> " + data[i]["consultTitle"] +" </em></span>" +
|
91
|
95
|
" " +
|
|
@ -95,9 +99,9 @@ function handleData(data,attrParams,btnCls){
|
95
|
99
|
data[i]["createTime"].substr(0,4) + "-" + data[i]["createTime"].substr(4,2) + "-" + data[i]["createTime"].substr(6,2) + " " + data[i]["createTime"].substr(8,2)+ ":" +data[i]["createTime"].substr(10,2)+
|
96
|
100
|
"</em>" +
|
97
|
101
|
"</span></h6>" +
|
98
|
|
"<p>最后回复<span class='lasttime'> ( " +
|
|
102
|
"<p><span class='lasttime'> " +
|
99
|
103
|
lastReplyFn(userid,data[i]["consultId"])["lastReplyTime"]+
|
100
|
|
") </span>" +
|
|
104
|
" </span>" +
|
101
|
105
|
"</p>" +
|
102
|
106
|
"<p class='rebackcon lastReplyCon' >"+lastReplyFn(userid,data[i]["consultId"])["lastReplyCon"]+"</p>" +
|
103
|
107
|
"</div>" +
|
|
@ -146,7 +150,7 @@ function lastReplyFn(sendId,consultId){
|
146
|
150
|
}
|
147
|
151
|
else{
|
148
|
152
|
lastReplyTimeData = response["data"]["createTime"];
|
149
|
|
lastReplyTime = lastReplyTimeData.substr(0,4) + "-" + lastReplyTimeData.substr(4,2) + "-" + lastReplyTimeData.substr(6,2) + " " + lastReplyTimeData.substr(8,2)+ ":" +lastReplyTimeData.substr(10,2)
|
|
153
|
lastReplyTime ="最后回复(" + lastReplyTimeData.substr(0,4) + "-" + lastReplyTimeData.substr(4,2) + "-" + lastReplyTimeData.substr(6,2) + " " + lastReplyTimeData.substr(8,2)+ ":" +lastReplyTimeData.substr(10,2) + ")"
|
150
|
154
|
lastReplyCon = response["data"]["tidingsContant"];
|
151
|
155
|
}
|
152
|
156
|
|
|
@ -224,6 +228,8 @@ var getMyData = function (url,pageSize,pageNo,isbind,status,timeType,sortType){
|
224
|
228
|
"pageSize":pageSize, //每页记录数 默认为5
|
225
|
229
|
"pageNo":pageNo //当前页码 默认为1
|
226
|
230
|
};
|
|
231
|
console.log("回复参数");
|
|
232
|
console.log(params)
|
227
|
233
|
$.ajax({
|
228
|
234
|
url:url,//收到回复接口,//收到回复接口
|
229
|
235
|
type:"get",
|
|
@ -232,7 +238,8 @@ var getMyData = function (url,pageSize,pageNo,isbind,status,timeType,sortType){
|
232
|
238
|
dataType: "json",
|
233
|
239
|
contentType: "application/x-www-form-urlencoded",
|
234
|
240
|
"success":function(response){
|
235
|
|
// console.log(response);
|
|
241
|
console.log("收到回复数据");
|
|
242
|
console.log(response);
|
236
|
243
|
/*if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
|
237
|
244
|
$.MsgBox.Alert('提示',"没有收到回复");
|
238
|
245
|
return false;
|
|
@ -283,7 +290,8 @@ var getConsultData = function (url,pageSize,pageNo,isbind,status,timeType,sortTy
|
283
|
290
|
"pageSize":pageSize, //每页记录数 默认为5
|
284
|
291
|
"pageNo":pageNo //当前页码 默认为1
|
285
|
292
|
};
|
286
|
|
console.log(params);
|
|
293
|
console.log("咨询参数");
|
|
294
|
console.log(params)
|
287
|
295
|
$.ajax({
|
288
|
296
|
url:url,//收到回复接口,//收到回复接口
|
289
|
297
|
type:"get",
|
|
@ -293,6 +301,8 @@ var getConsultData = function (url,pageSize,pageNo,isbind,status,timeType,sortTy
|
293
|
301
|
dataType: "json",
|
294
|
302
|
contentType: "application/x-www-form-urlencoded",
|
295
|
303
|
success:function(response){
|
|
304
|
console.log("收到咨询数据");
|
|
305
|
console.log(response);
|
296
|
306
|
//拿到收到回复数据
|
297
|
307
|
// if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == ""){
|
298
|
308
|
// $.MsgBox.Alert('提示',"没有此项数据");
|
|
@ -765,890 +775,89 @@ function noAssessFn2(consultId,attrParams,thanksStatus){
|
765
|
775
|
};
|
766
|
776
|
|
767
|
777
|
|
768
|
|
|
769
|
|
|
770
|
|
|
771
|
|
|
772
|
|
|
773
|
|
|
774
|
|
|
775
|
|
|
776
|
|
function clickLookBtn(){
|
777
|
|
// var consultId = $.trim($(this).attr("id"));//咨询id
|
778
|
|
// var assessStatus = $.trim($(this).attr("assess"));//评价状态 0-未评价,1-已评价
|
779
|
|
//var consultStatus = $(this).find(".coultState").text();//咨询状态 0-进行中,1-已完成
|
780
|
|
//var thanksStatus = $(this).find(".thanksStatus").text();//感谢状态 0-未感谢,1-已感谢
|
781
|
|
//var assessStar = $(this).find(".assessStar").val();//星级,几颗星 用隐藏域做
|
782
|
|
// localStorage.setItem("consultId", consultId);
|
783
|
|
// alert(assessStatus);
|
784
|
|
|
785
|
|
var consultIdParams = {"consultId":$.trim($(this).attr("id"))};//咨询id
|
786
|
|
var clickConfirmFinishParams = {
|
787
|
|
"consultId":$.trim($(this).attr("id")),//咨询id
|
788
|
|
"consultStatus":$(this).find(".coultState").text()//咨询状态 0-进行中,1-已完成
|
789
|
|
};
|
790
|
|
console.log($.trim($(this).attr("assess")));
|
791
|
|
|
792
|
|
if($.trim($(this).attr("assess")) == "未评价/" && $.trim($(this).attr("consultStatus")) == "完成/" && $(this).attr("attrP") == "consultId"){
|
793
|
|
assessFn();
|
794
|
|
//点击稍后评价
|
795
|
|
$("#noAssessBtn").bind("click",noAssess);
|
796
|
|
|
797
|
|
//ajax加载对话页面
|
798
|
|
|
799
|
|
}else{
|
800
|
|
$(".dialogfoot").css("display","none");
|
801
|
|
$.ajax({
|
802
|
|
"url":"diloags.html",
|
803
|
|
"dataType":"html",
|
804
|
|
"success":function(result){
|
805
|
|
//console.log(data);
|
806
|
|
$(this).attr("id");
|
807
|
|
$(".workcon").html(result);
|
808
|
|
|
809
|
|
lookDialogHeadDataHandleFn();
|
810
|
|
dialogContentDataHandle();
|
811
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
812
|
|
},
|
813
|
|
"error":function(error){
|
814
|
|
//console.log(data);
|
815
|
|
//加载对话页面失败
|
816
|
|
console.log(error);
|
817
|
|
}
|
818
|
|
});
|
819
|
|
|
820
|
|
}
|
821
|
|
|
822
|
|
//===========================================dialog数据==================
|
823
|
|
//=========对话头部
|
824
|
|
//对话头部数据渲染
|
825
|
|
function lookDialogHeadDataHandleFn(){
|
826
|
|
//星星评级
|
827
|
|
var starStart;
|
828
|
|
function clickStar(){
|
829
|
|
$(".evastar2").removeClass('addStar');
|
830
|
|
starStart=$(this).index()+1;
|
831
|
|
for(var i=0;i<starStart;i++){
|
832
|
|
if(i<starStart){
|
833
|
|
$(".evastar2").eq(i).addClass("addStar");
|
834
|
|
}
|
835
|
|
else{
|
836
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
837
|
|
}
|
838
|
|
}
|
839
|
|
$("#startCount").val($(".addStar").length);
|
840
|
|
};
|
841
|
|
|
842
|
|
$.ajax({
|
843
|
|
"url":"/ajax/consult/qacon",//从收到回复点击查看接口
|
844
|
|
"type":"get",
|
845
|
|
"data":consultIdParams,
|
846
|
|
"success":function(response){
|
847
|
|
// console.log("点击查看返回数据");
|
848
|
|
// console.log(response)
|
849
|
|
var consultantData = response["data"];
|
850
|
|
//对话框标题信息
|
851
|
|
//进行中,
|
852
|
|
if(consultantData["consultStatus"] == 0){
|
853
|
|
consultantData["consultStatus"] = "进行中";
|
854
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
855
|
|
$("#confirmBtn").removeClass("displayNone");//确认完成按钮显示
|
856
|
|
$("#showAllAssess").css("display","none");//总体评价
|
857
|
|
$(".dialogfoot").css("display","block");//显示发送对话部分
|
858
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
859
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
860
|
|
|
861
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
862
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
863
|
|
|
864
|
|
}
|
865
|
|
//已完成
|
866
|
|
if(consultantData["consultStatus"] == 1 || consultantData["consultStatus"] == 2 ||consultantData["consultStatus"] == 3 || consultantData["consultStatus"] == 4){
|
867
|
|
consultantData["consultStatus"] = "已完成";
|
868
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
869
|
|
//已完成,未感谢:
|
870
|
|
if(consultantData["thanksStatus"] == 0){
|
871
|
|
$("#dialog_thanksBtn").css("display","block");//显示感谢按钮
|
872
|
|
//未感谢,未评价
|
873
|
|
if(consultantData["assessStatus"] == 0){
|
874
|
|
$("#dialog_assessBtn").css("display","block");//显示评价按钮
|
875
|
|
|
876
|
|
$("#showAllAssess").css("display","none");//隐藏总体评价
|
877
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
878
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
879
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
880
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
881
|
|
}
|
882
|
|
//未感谢,已评价
|
883
|
|
else{
|
884
|
|
|
885
|
|
// $("#dialog_thanksBtn").css("display","block");//显示感谢按钮
|
886
|
|
|
887
|
|
var starCount = consultantData["assessStar"];
|
888
|
|
for(var i=0;i<starCount;i++){
|
889
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
890
|
|
}
|
891
|
|
$("#showAllAssess").css("display","block");//显示星级
|
892
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
893
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
894
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
895
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
896
|
|
}
|
897
|
|
|
898
|
|
}
|
899
|
|
//已完成,已感谢:评价星级,感谢金额
|
900
|
|
if(consultantData["thanksStatus"] == 1){
|
901
|
|
$(".dialogfoot").css("display","none");//隐藏发送对话部分
|
902
|
|
var starCount = consultantData["assessStar"];
|
903
|
|
for(var i=0;i<starCount;i++){
|
904
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
905
|
|
};
|
906
|
|
$("#showAllAssess").css("display","block");//显示星级
|
907
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
908
|
|
|
909
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
910
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
911
|
|
$("#dialog_thanksMoney").text(consultantData["thanksMoney"]);
|
912
|
|
}
|
913
|
|
|
914
|
|
}
|
915
|
|
|
916
|
|
},
|
917
|
|
"error":function(error){
|
918
|
|
//对话框头部信息请求失败
|
919
|
|
}
|
920
|
|
});
|
921
|
|
|
922
|
|
};
|
|
778
|
function clickConsultBtn(){
|
|
779
|
if(userid != "" && userid != null){
|
923
|
780
|
|
924
|
|
|
925
|
|
|
926
|
|
//============对话内容数据处理函数
|
927
|
|
function dialogContentDataHandle(){
|
928
|
|
$.ajax({
|
929
|
|
"url":"/ajax/tidings/qacon",//对话内容显示接口
|
930
|
|
"type":"get",
|
931
|
|
"data":consultIdParams,
|
932
|
|
"beforeSend":function(response){
|
933
|
|
//对话发送消息失败
|
934
|
|
//console.log(response);
|
935
|
|
},
|
936
|
|
"success":function(response){
|
937
|
|
console.log()
|
938
|
|
var dialogConData = response["data"];
|
939
|
|
// console.log(dialogConData);
|
940
|
|
var dialogStr;
|
941
|
|
dialogStr = dialogContentStrFn(dialogConData);
|
942
|
|
$("#dialogContent").prepend(dialogStr);
|
943
|
|
//
|
944
|
|
},
|
945
|
|
"error":function(error){
|
946
|
|
//对话框内容信息请求失败
|
947
|
|
}
|
948
|
|
});
|
949
|
|
|
950
|
|
|
951
|
|
};
|
952
|
|
|
953
|
|
|
954
|
|
//=============================对话页面底部发送
|
955
|
|
//发送按钮处理函数
|
956
|
|
function sendDialogContentFn(){
|
957
|
|
var tidingsContant = $("#dialog_sendContent").val();
|
958
|
|
var tidingStr = {
|
959
|
|
"tidingsContant":tidingsContant,
|
960
|
|
"senderId":userid,
|
961
|
|
"consultId":consultId
|
962
|
|
};
|
963
|
|
//console.log(tidingStr);
|
964
|
|
$.ajax({
|
965
|
|
"url":"/ajax/tidings",
|
966
|
|
"type":"post",
|
967
|
|
"data":tidingStr,
|
968
|
|
"beforeSend":function(response){
|
969
|
|
//对话发送消息失败
|
970
|
|
console.log(response);
|
971
|
|
},
|
972
|
|
"success":function(response){
|
973
|
|
console.log(response);//返回对话内容的id
|
974
|
|
$("#dialogContent").empty();
|
975
|
|
dialogContentDataHandle();
|
976
|
|
},
|
977
|
|
"error":function(error){
|
978
|
|
//对话发送消息失败
|
979
|
|
console.log(error);
|
980
|
|
}
|
981
|
|
});
|
982
|
|
$("#dialog_sendContent").val("");
|
983
|
|
};
|
984
|
|
|
985
|
|
|
986
|
|
|
987
|
|
//==============发表评价页
|
988
|
|
function assessFn(){
|
989
|
|
ConsultComment();
|
990
|
|
|
991
|
|
if($.trim($(this).attr("thanks")) == "未感谢"){
|
992
|
|
$(".addcomment2").css("display","none");//
|
993
|
|
|
994
|
|
}else{
|
|
781
|
$.ajax({
|
|
782
|
"url":"consult.html",
|
|
783
|
"dataType" : "html",
|
|
784
|
"success":function(responseHtml){
|
|
785
|
$(".workcon").html(responseHtml);
|
995
|
786
|
|
996
|
|
$(".overcomment").css("display","none");
|
997
|
|
}
|
998
|
|
//评价星星样式
|
999
|
|
var start;
|
1000
|
|
function clickStar(){
|
1001
|
|
$(".evastar2").removeClass('addStar');
|
1002
|
|
start=$(this).index()+1;
|
1003
|
|
for(var i=0;i<start;i++){
|
1004
|
|
if(i<start){
|
1005
|
|
$(".evastar2").eq(i).addClass("addStar");
|
1006
|
|
}
|
1007
|
|
else{
|
1008
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
1009
|
|
}
|
1010
|
|
}
|
1011
|
|
$("#startCount").val($(".addStar").length);
|
1012
|
|
};
|
1013
|
|
$(".evastar2").bind("click",clickStar);
|
1014
|
|
//发表评论
|
1015
|
|
$("#sendAssessBtn").bind("click",clickSendAssessBtn);
|
1016
|
|
|
1017
|
|
};
|
1018
|
|
|
1019
|
|
//绑定对话页面确认完成咨询
|
1020
|
|
// $("#confirmBtn").bind("click",assessFn);
|
1021
|
|
|
1022
|
|
// $("#dialog_assessBtn").bind("click",assessFn);
|
1023
|
|
|
1024
|
|
|
1025
|
|
//点击发表评论:保存发表内容和星级
|
1026
|
|
function clickSendAssessBtn(){
|
1027
|
|
var consultId = localStorage.getItem("consultId");//
|
1028
|
|
var assessStar = $("#startCount").val();
|
1029
|
|
var assessContant = $(".resouinforcon").find("textarea").val();
|
1030
|
|
//评价状态 0-未评价,1-已评价
|
1031
|
|
|
1032
|
|
//确认完成后,发表评论传值
|
1033
|
|
var assessContentStr ={
|
1034
|
|
"consultId":consultId, //咨询ID
|
1035
|
|
"assessStatus":"1", //评价状态 0-未评价,1-已评价
|
1036
|
|
"assessStar":assessStar, //评价星级
|
1037
|
|
"assessContant":assessContant //评价内容
|
1038
|
|
};
|
1039
|
|
|
1040
|
|
// console.log(assessContentStr);
|
1041
|
|
//如果未评论,提示未评论
|
1042
|
|
/*if(assessStar == "" || assessStar == null || assessStar == undefined){
|
1043
|
|
if(assessContant == "" || assessContant == null || assessContant == undefined){
|
1044
|
|
$.MsgBox.Alert('提示',"未评论,是否退出评论");
|
1045
|
|
}
|
1046
|
|
$.MsgBox.Alert('提示',"未选择星级");
|
1047
|
|
};*/
|
1048
|
|
//保存
|
1049
|
|
$.ajax({
|
1050
|
|
"url":"/ajax/consult/assess",//点击发表评论接口
|
1051
|
|
"type":"post",
|
1052
|
|
"data":assessContentStr,
|
1053
|
|
"success":function(response){
|
1054
|
|
// console.log(response);
|
1055
|
|
$(".blackcover").remove();
|
1056
|
|
$("body").css("position","static");
|
1057
|
|
$.MsgBox.Alert('提示',"评论成功");
|
1058
|
|
//评价状态改变,所以头部信息改变
|
1059
|
|
lookDialogHeadDataHandleFn();
|
1060
|
|
},
|
1061
|
|
"error":function(error){
|
1062
|
|
//发表评论失败
|
1063
|
|
console.log(error);
|
1064
|
|
}
|
|
787
|
//收到咨询
|
|
788
|
getConsultData("/ajax/consult/pqpro","5",1,true,0,0,0);
|
|
789
|
//点击下拉菜单
|
|
790
|
$(".consultOption ul").find("li").click(function(){
|
|
791
|
|
|
792
|
getConsultData("/ajax/consult/pqpro","5",1,true,$(this).attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
|
793
|
});
|
|
794
|
$(".timeOption ul").find("li").click(function(){
|
|
795
|
|
|
796
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$(this).attr("tim"),$("#timeSortId").val());
|
|
797
|
});
|
|
798
|
var sortFlag = true;
|
|
799
|
$("#consultArrow").click(function(){
|
1065
|
800
|
|
1066
|
|
});
|
1067
|
|
//发表评论
|
1068
|
|
$.ajax({
|
1069
|
|
"url":"diloags.html",
|
1070
|
|
"dataType":"html",
|
1071
|
|
"success":function(result){
|
1072
|
|
//console.log(data);
|
1073
|
|
$(this).attr("id");
|
1074
|
|
$(".workcon").html(result);
|
|
801
|
if(sortFlag == true){
|
|
802
|
$(this).find("div").css("background-position","-20px 1px");
|
|
803
|
$("#timeSortId").val("1");
|
|
804
|
sortFlag = false;
|
|
805
|
}else{
|
|
806
|
$(this).find("div").css("background-position","0px 1px");
|
|
807
|
$("#timeSortId").val("0");
|
|
808
|
sortFlag=true;
|
|
809
|
}
|
1075
|
810
|
|
1076
|
|
$(".blackcover").remove();
|
1077
|
|
$("body").css("position","static");
|
1078
|
|
lookDialogHeadDataHandleFn();
|
1079
|
|
dialogContentDataHandle();
|
1080
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
1081
|
811
|
|
|
812
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
|
813
|
});
|
|
814
|
|
|
815
|
//
|
|
816
|
getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
|
|
817
|
//点击下拉菜单
|
|
818
|
$(".replyOption ul").find("li").click(function(){
|
|
819
|
console.log($("#showTimeSort2"));
|
|
820
|
getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
|
821
|
});
|
|
822
|
$(".timeOption2 ul").find("li").click(function(){
|
|
823
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$(this).attr("tim"),$("#timeSortId2").val());
|
|
824
|
});
|
|
825
|
var sortFlag2 = true;
|
|
826
|
$("#replyArrow").click(function(){
|
1082
|
827
|
|
1083
|
|
},
|
1084
|
|
"error":function(error){
|
1085
|
|
//console.log(data);
|
1086
|
|
//加载对话页面失败
|
1087
|
|
console.log(error);
|
1088
|
|
}
|
1089
|
|
});
|
1090
|
|
|
1091
|
|
|
1092
|
|
|
1093
|
|
};
|
1094
|
|
|
1095
|
|
|
1096
|
|
//稍后评价、
|
1097
|
|
function noAssess(){
|
1098
|
|
$.ajax({
|
1099
|
|
"url":"diloags.html",
|
1100
|
|
"dataType":"html",
|
1101
|
|
"success":function(result){
|
1102
|
|
//console.log(data);
|
1103
|
|
$(this).attr("id");
|
1104
|
|
$(".workcon").html(result);
|
1105
|
|
$(".blackcover").remove();
|
1106
|
|
$("body").css("position","static");
|
1107
|
|
lookDialogHeadDataHandleFn();
|
1108
|
|
dialogContentDataHandle();
|
1109
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
1110
|
|
|
1111
|
|
},
|
1112
|
|
"error":function(error){
|
1113
|
|
//加载对话页面失败
|
1114
|
|
$.MsgBox.Alert('提醒',"对话请求错误");
|
1115
|
|
}
|
1116
|
|
});
|
1117
|
|
};
|
1118
|
|
|
|
828
|
if(sortFlag2 == true){
|
|
829
|
$(this).find("div").css("background-position","-20px 1px");
|
|
830
|
$("#timeSortId2").val("1");
|
|
831
|
sortFlag2 =false;
|
|
832
|
|
|
833
|
}else{
|
|
834
|
$(this).find("div").css("background-position","0px 1px");
|
|
835
|
$("#timeSortId2").val("0");
|
|
836
|
|
|
837
|
sortFlag2=true;
|
|
838
|
}
|
|
839
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
|
840
|
});
|
|
841
|
|
1119
|
842
|
|
1120
|
|
};//收到回复点击查看函数结束
|
1121
|
|
|
1122
|
|
|
1123
|
|
|
1124
|
|
|
|
843
|
//On Click Event 收到咨询和收到回复tab效果
|
|
844
|
$(".worksamlltit3").bind("click",tab);
|
|
845
|
function tab(){
|
|
846
|
$(".worksamlltit3").removeClass("worksamlltitnow");
|
|
847
|
$(this).addClass("worksamlltitnow");
|
|
848
|
$(".workmysrc3").hide();
|
|
849
|
var activeTab = $(this).attr("href");
|
|
850
|
$(activeTab).fadeIn();
|
|
851
|
|
|
852
|
return false;
|
|
853
|
};
|
|
854
|
|
|
855
|
|
|
856
|
},
|
|
857
|
})
|
|
858
|
|
1125
|
859
|
|
1126
|
860
|
|
1127
|
|
function clickConsultBtn(){
|
1128
|
|
if(userid != "" && userid != null){
|
1129
|
|
$.ajax({
|
1130
|
|
"url":"/ajax/consult/pqpro",//判断是否有无咨询
|
1131
|
|
"type" : "get",
|
1132
|
|
"async":false,
|
1133
|
|
"data" :{"professorId":userid},
|
1134
|
|
"contentType" : "application/x-www-form-urlencoded",
|
1135
|
|
"success":function(consultResponse){
|
1136
|
|
// console.log(consultResponse);
|
1137
|
|
if(consultResponse["data"]["data"] == null || consultResponse["data"]["data"] == undefined || consultResponse["data"]["data"] == ""){
|
1138
|
|
$.MsgBox.Alert('提醒',"您目前没有咨询信息");
|
1139
|
|
return false;
|
1140
|
|
}
|
1141
|
|
else {
|
1142
|
|
//如果没有咨询数据 隐藏收到咨询
|
1143
|
|
if(consultResponse["data"]["total"] == 0){
|
1144
|
|
$.ajax({
|
1145
|
|
"url":"consult.html",
|
1146
|
|
"dataType" : "html",
|
1147
|
|
"success":function(responseHtml){
|
1148
|
|
$(".workcon").html(responseHtml);
|
1149
|
|
$(".worksamlltit3:first").hide();
|
1150
|
|
$(".workmysrc3:first").hide();
|
1151
|
|
$(".workmysrc3:last").fadeIn();
|
1152
|
|
|
1153
|
|
//=无咨询 ajax请求收到回复=
|
1154
|
|
//收到回复
|
1155
|
|
getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
|
1156
|
|
//点击下拉菜单
|
1157
|
|
$(".replyOption ul").find("li").click(function(){
|
1158
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
1159
|
|
});
|
1160
|
|
$(".timeOption2 ul").find("li").click(function(){
|
1161
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$(this).attr("tim"),$("#timeSortId2").val());
|
1162
|
|
});
|
1163
|
|
var sortFlag = true;
|
1164
|
|
$("#replyArrow").click(function(){
|
1165
|
|
|
1166
|
|
if(sortFlag == true){
|
1167
|
|
$(this).find("div").css("background-position","-20px 1px");
|
1168
|
|
$("#timeSortId2").val("1");
|
1169
|
|
sortFlag = false;
|
1170
|
|
}else{
|
1171
|
|
$(this).find("div").css("background-position","0px 1px");
|
1172
|
|
$("#timeSortId2").val("0");
|
1173
|
|
sortFlag=true;
|
1174
|
|
}
|
1175
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
1176
|
|
});
|
1177
|
|
},
|
1178
|
|
"error":function(response){
|
1179
|
|
//请求页面失败
|
1180
|
|
// console.log(response)
|
1181
|
|
},
|
1182
|
|
|
1183
|
|
})
|
1184
|
|
|
1185
|
|
|
1186
|
|
}else{
|
1187
|
|
//ajax页面
|
1188
|
|
$.ajax({
|
1189
|
|
"url":"consult.html",
|
1190
|
|
"dataType" : "html",
|
1191
|
|
"success":function(responseHtml){
|
1192
|
|
$(".workcon").html(responseHtml);
|
1193
|
|
|
1194
|
|
//ajax 收到咨询数据和收到回复数据
|
1195
|
|
//ajax收到咨询 consultResponse 收到咨询返回值
|
1196
|
|
/*var consultTrHtml;
|
1197
|
|
var allData = consultResponse.data;
|
1198
|
|
var consultData = allData["data"];
|
1199
|
|
consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
|
1200
|
|
$("#workContainer").prepend(consultTrHtml);*/
|
1201
|
|
|
1202
|
|
//收到咨询
|
1203
|
|
getConsultData("/ajax/consult/pqpro","5",1,true,0,0,0);
|
1204
|
|
//点击下拉菜单
|
1205
|
|
$(".consultOption ul").find("li").click(function(){
|
1206
|
|
console.log($(this).attr("tip")+$("#showTimeSort").attr("tim")+$("#timeSortId").val());
|
1207
|
|
getConsultData("/ajax/consult/pqpro","5",1,true,$(this).attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
1208
|
|
});
|
1209
|
|
$(".timeOption2 ul").find("li").click(function(){
|
1210
|
|
console.log($(this).attr("tip")+$("#showTimeSort").attr("tim")+$("#timeSortId").val());
|
1211
|
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$(this).attr("tim"),$("#timeSortId").val());
|
1212
|
|
});
|
1213
|
|
var sortFlag = true;
|
1214
|
|
$("#replyArrow").click(function(){
|
1215
|
|
|
1216
|
|
if(sortFlag == true){
|
1217
|
|
$(this).find("div").css("background-position","-20px 1px");
|
1218
|
|
$("#timeSortId2").val("1");
|
1219
|
|
sortFlag = false;
|
1220
|
|
}else{
|
1221
|
|
$(this).find("div").css("background-position","0px 1px");
|
1222
|
|
$("#timeSortId2").val("0");
|
1223
|
|
sortFlag=true;
|
1224
|
|
}
|
1225
|
|
|
1226
|
|
console.log($(this).attr("tip")+$("#showTimeSort").attr("tim")+$("#timeSortId").val());
|
1227
|
|
|
1228
|
|
getConsultData("/ajax/consult/pqpro","5",1,true,$("#showStatus").attr("tip"),$("#showTimeSort").attr("tim"),$("#timeSortId").val());
|
1229
|
|
});
|
1230
|
|
|
1231
|
|
//
|
1232
|
|
getMyData("/ajax/consult/pqcon","5",1,true,0,0,0);
|
1233
|
|
//点击下拉菜单
|
1234
|
|
$(".replyOption ul").find("li").click(function(){
|
1235
|
|
console.log($("#showTimeSort2"));
|
1236
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$(this).attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
1237
|
|
});
|
1238
|
|
$(".timeOption2 ul").find("li").click(function(){
|
1239
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$(this).attr("tim"),$("#timeSortId2").val());
|
1240
|
|
});
|
1241
|
|
$("#replyArrow").click(function(){
|
1242
|
|
var sortFlag = true;
|
1243
|
|
if(sortFlag == true){
|
1244
|
|
$(this).find("div").css("background-position","-20px 1px");
|
1245
|
|
$("#timeSortId2").val("1");
|
1246
|
|
sortFlag =false;
|
1247
|
|
|
1248
|
|
}else{
|
1249
|
|
$(this).find("div").css("background-position","0px 1px");
|
1250
|
|
$("#timeSortId2").val("0");
|
1251
|
|
|
1252
|
|
sortFlag=true;
|
1253
|
|
}
|
1254
|
|
getMyData("/ajax/consult/pqcon","5",1,true,$("#showStatus2").attr("tip"),$("#showTimeSort2").attr("tim"),$("#timeSortId2").val());
|
1255
|
|
});
|
1256
|
|
|
1257
|
|
|
1258
|
|
|
1259
|
|
|
1260
|
|
//================================================有咨询时,下拉菜单改===变 ajax==========================
|
1261
|
|
// 排列顺序(正序、倒序)
|
1262
|
|
/*var sortFlag = true;//正倒排序标记
|
1263
|
|
$(".orderedbtn").click(function(){
|
1264
|
|
if(sortFlag == true){
|
1265
|
|
$(this).find("div").css("background-position","-20px 1px");
|
1266
|
|
$("#timeSortId").val("1");
|
1267
|
|
|
1268
|
|
sortFlag =false;
|
1269
|
|
|
1270
|
|
}else{
|
1271
|
|
$(this).find("div").css("background-position","0px 1px");
|
1272
|
|
$("#timeSortId").val("0");
|
1273
|
|
|
1274
|
|
sortFlag=true;
|
1275
|
|
}
|
1276
|
|
|
1277
|
|
});
|
1278
|
|
|
1279
|
|
var timeType,sortType,consultStatus,consultId;
|
1280
|
|
|
1281
|
|
consultStatus = $("#consultSelectId").val();//咨询状态值
|
1282
|
|
timeType = $("#timeTypeId").val();//时间类型值
|
1283
|
|
sortType = $("#timeSortId").val();//排序值;
|
1284
|
|
|
1285
|
|
//默认传值:
|
1286
|
|
var consultInfo = {
|
1287
|
|
"professorId":userid,
|
1288
|
|
"status":consultStatus,
|
1289
|
|
"timeType":timeType,
|
1290
|
|
"sortType":sortType
|
1291
|
|
};
|
1292
|
|
// console.log("默认值:"+consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.professorId);
|
1293
|
|
|
1294
|
|
//收到咨询信息改变下拉菜单
|
1295
|
|
function consultStatusFn(){
|
1296
|
|
//改变后,要传的值
|
1297
|
|
consultStatus = $("#consultSelectId").val();//咨询状态值
|
1298
|
|
timeType = $("#timeTypeId").val();//时间类型值
|
1299
|
|
sortType = $("#timeSortId").val();//排序值;
|
1300
|
|
|
1301
|
|
//要传的值:
|
1302
|
|
consultInfo = {
|
1303
|
|
"professorId":userid,
|
1304
|
|
"status":consultStatus,
|
1305
|
|
"timeType":timeType,
|
1306
|
|
"sortType":sortType
|
1307
|
|
|
1308
|
|
};
|
1309
|
|
|
1310
|
|
// console.log("ajax中的值:"+ consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.consultantId);
|
1311
|
|
|
1312
|
|
//更新下拉菜单
|
1313
|
|
$.ajax({
|
1314
|
|
"url":"/ajax/consult/pqpro",//更新下拉菜单接口
|
1315
|
|
"data":consultInfo,
|
1316
|
|
"type":"get",
|
1317
|
|
"success":function(response){
|
1318
|
|
$("#workContainer .workselectitem").remove();
|
1319
|
|
// $(".tcdPageCode:first").before().empty();
|
1320
|
|
var allData = response.data;
|
1321
|
|
var consultData = allData["data"];
|
1322
|
|
consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
|
1323
|
|
$("#workContainer").prepend(consultTrHtml);
|
1324
|
|
|
1325
|
|
//给咨询回复绑定回复和查看事件
|
1326
|
|
$("#workContainer .workselectitem").find(".replyBtn").bind("click",clickReplyFn);
|
1327
|
|
|
1328
|
|
},
|
1329
|
|
"error":function(response){
|
1330
|
|
// console.log(response)
|
1331
|
|
//更新下拉菜单失败
|
1332
|
|
}
|
1333
|
|
|
1334
|
|
});
|
1335
|
|
|
1336
|
|
|
1337
|
|
};//更新咨询下拉菜单处理函数结束
|
1338
|
|
|
1339
|
|
//绑定咨询状态事件
|
1340
|
|
$(".consultOption ul").bind("click", "li",consultStatusFn);
|
1341
|
|
|
1342
|
|
//绑定咨询状态事件
|
1343
|
|
$(".timeOption ul").bind("click", "li",consultStatusFn);
|
1344
|
|
|
1345
|
|
$(".orderedbtn").bind("click",consultStatusFn);*/
|
1346
|
|
|
1347
|
|
|
1348
|
|
|
1349
|
|
//============================================点击咨询页面中回复按钮=====================
|
1350
|
|
function clickReplyFn(){
|
1351
|
|
var consultId = $.trim($(this).attr("id"));//咨询id
|
1352
|
|
var assessStatus = $.trim($(this).find(".assessStatus").text());//评价状态 0-未评价,1-已评价
|
1353
|
|
var consultStatus = $.trim($(this).find(".coultState").text());//咨询状态 0-进行中,1-已完成
|
1354
|
|
var thanksStatus = $.trim($(this).find(".thanksStatus").text());//感谢状态 0-未感谢,1-已感谢
|
1355
|
|
var assessStar = $.trim($(this).find(".assessStar").val());//星级,几颗星 用隐藏域做
|
1356
|
|
|
1357
|
|
|
1358
|
|
//ajax加载对话页面
|
1359
|
|
$.ajax({
|
1360
|
|
"url":"diloags.html",
|
1361
|
|
"dataType":"html",
|
1362
|
|
"success":function(result){
|
1363
|
|
//console.log(data);
|
1364
|
|
$(this).attr("id");
|
1365
|
|
$(".workcon").html(result);
|
1366
|
|
|
1367
|
|
//===========================================dialog数据==================
|
1368
|
|
//=========对话头部
|
1369
|
|
//对话头部数据渲染
|
1370
|
|
function dialogHeadDataHandleFn(){
|
1371
|
|
//星星评级
|
1372
|
|
var starStart;
|
1373
|
|
function clickStar(){
|
1374
|
|
$(".evastar2").removeClass('addStar');
|
1375
|
|
starStart=$(this).index()+1;
|
1376
|
|
for(var i=0;i<starStart;i++){
|
1377
|
|
if(i<starStart){
|
1378
|
|
$(".evastar2").eq(i).addClass("addStar");
|
1379
|
|
}
|
1380
|
|
else{
|
1381
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
1382
|
|
}
|
1383
|
|
}
|
1384
|
|
$("#startCount").val($(".addStar").length);
|
1385
|
|
};
|
1386
|
|
|
1387
|
|
$.ajax({
|
1388
|
|
"url":"/ajax/consult/qapro",//从收到咨询点击回复接口
|
1389
|
|
"type":"get",
|
1390
|
|
"data":consultIdStr,
|
1391
|
|
"success":function(response){
|
1392
|
|
var consultantData = response["data"];
|
1393
|
|
//对话框标题信息
|
1394
|
|
//进行中,
|
1395
|
|
if(consultantData["consultStatus"] == 0){
|
1396
|
|
consultantData["consultStatus"] = "进行中";
|
1397
|
|
|
1398
|
|
$("#dialog_thanksBtn").css("display","none");
|
1399
|
|
$("#dialog_assessBtn").css("display","none");
|
1400
|
|
$("#showAllAssess").css("display","none");//总体评价
|
1401
|
|
$(".dialogfoot").css("display","block");//显示发送对话部分
|
1402
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
1403
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
1404
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
1405
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
1406
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
1407
|
|
|
1408
|
|
}
|
1409
|
|
//已完成
|
1410
|
|
if(consultantData["consultStatus"] == 1 || consultantData["consultStatus"] == 2 ||consultantData["consultStatus"] == 3 || consultantData["consultStatus"] == 4){
|
1411
|
|
consultantData["consultStatus"] = "已完成";
|
1412
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
1413
|
|
//已完成,未感谢:
|
1414
|
|
if(consultantData["thanksStatus"] == 0){
|
1415
|
|
//未感谢,未评价
|
1416
|
|
if(consultantData["assessStatus"] == 0){
|
1417
|
|
|
1418
|
|
$("#dialog_thanksBtn").css("display","none");
|
1419
|
|
$("#dialog_assessBtn").css("display","none");
|
1420
|
|
$("#showAllAssess").css("display","none");//隐藏评价
|
1421
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
1422
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
1423
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
1424
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
1425
|
|
}
|
1426
|
|
//未感谢,已评价
|
1427
|
|
else{
|
1428
|
|
|
1429
|
|
|
1430
|
|
$("#dialog_thanksBtn").css("display","none");
|
1431
|
|
$("#dialog_assessBtn").css("display","none");
|
1432
|
|
$("#showAllAssess").css("display","block");
|
1433
|
|
var starCount = consultantData["assessStar"];
|
1434
|
|
for(var i=0;i<starCount;i++){
|
1435
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
1436
|
|
}
|
1437
|
|
$("#showAllAssess").css("display","block");//显示星级
|
1438
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
1439
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
1440
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
1441
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
1442
|
|
}
|
1443
|
|
|
1444
|
|
}
|
1445
|
|
//已完成,已感谢:评价星级,感谢金额
|
1446
|
|
if(consultantData["thanksStatus"] == 1){
|
1447
|
|
|
1448
|
|
$("#dialog_thanksBtn").css("display","none");
|
1449
|
|
$("#dialog_assessBtn").css("display","none");
|
1450
|
|
$(".dialogfoot").css("display","none");//隐藏发送对话部分
|
1451
|
|
$("#showAllAssess").css("display","block");
|
1452
|
|
var starCount = consultantData["assessStar"];
|
1453
|
|
for(var i=0;i<starCount;i++){
|
1454
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
1455
|
|
};
|
1456
|
|
$("#dialog_thanks").css("display","block");//显示感谢
|
1457
|
|
$("#showAllAssess").css("display","block");//显示星级
|
1458
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
1459
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
1460
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
1461
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
1462
|
|
}
|
1463
|
|
|
1464
|
|
}
|
1465
|
|
|
1466
|
|
},
|
1467
|
|
"error":function(error){
|
1468
|
|
//对话框头部信息请求失败
|
1469
|
|
}
|
1470
|
|
});
|
1471
|
|
|
1472
|
|
};
|
1473
|
|
|
1474
|
|
dialogHeadDataHandleFn();
|
1475
|
|
|
1476
|
|
//============对话内容数据处理函数
|
1477
|
|
function dialogContentDataHandle(){
|
1478
|
|
$.ajax({
|
1479
|
|
"url":"/ajax/tidings/qacon",//对话内容显示接口
|
1480
|
|
"type":"get",
|
1481
|
|
"data":consultIdStr,
|
1482
|
|
"success":function(response){
|
1483
|
|
var dialogConData = response["data"];
|
1484
|
|
var dialogStr;
|
1485
|
|
dialogStr = dialogContentStrFn(dialogConData);
|
1486
|
|
$("#dialogContent").prepend(dialogStr);
|
1487
|
|
//
|
1488
|
|
},
|
1489
|
|
"error":function(error){
|
1490
|
|
//对话框内容信息请求失败
|
1491
|
|
}
|
1492
|
|
});
|
1493
|
|
|
1494
|
|
|
1495
|
|
};
|
1496
|
|
dialogContentDataHandle();
|
1497
|
|
|
1498
|
|
//=============================对话页面底部发送
|
1499
|
|
//发送按钮处理函数
|
1500
|
|
function sendDialogContentFn(){
|
1501
|
|
var tidingsContant = $("#dialog_sendContent").val();
|
1502
|
|
var tidingStr = {
|
1503
|
|
"tidingsContant":tidingsContant,
|
1504
|
|
"senderId":userid,
|
1505
|
|
"consultId":consultId
|
1506
|
|
};
|
1507
|
|
//console.log(tidingStr);
|
1508
|
|
$.ajax({
|
1509
|
|
"url":"/ajax/tidings",
|
1510
|
|
"type":"post",
|
1511
|
|
"data":tidingStr,
|
1512
|
|
"success":function(response){
|
1513
|
|
$("#dialogContent").empty();
|
1514
|
|
dialogContentDataHandle();
|
1515
|
|
},
|
1516
|
|
"error":function(error){
|
1517
|
|
//对话发送消息失败
|
1518
|
|
console.log(error);
|
1519
|
|
}
|
1520
|
|
});
|
1521
|
|
$("#dialog_sendContent").val("");
|
1522
|
|
};
|
1523
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
1524
|
|
|
1525
|
|
|
1526
|
|
//==============发表评价
|
1527
|
|
function assessFn(){
|
1528
|
|
ConsultComment();
|
1529
|
|
if($(this).attr("id") == "dialog_thanksBtn"){
|
1530
|
|
$(".overcomment").css("display","block");//显示感谢
|
1531
|
|
}
|
1532
|
|
if($(this).attr("id") == "dialog_assessBtn"){
|
1533
|
|
// $(".addcomment2").css("display","block");//显示评价
|
1534
|
|
$("#showAllAssess").css("display","block");
|
1535
|
|
}
|
1536
|
|
//评价星星样式
|
1537
|
|
var start;
|
1538
|
|
function clickStar(){
|
1539
|
|
$(".evastar2").removeClass('addStar');
|
1540
|
|
start=$(this).index()+1;
|
1541
|
|
for(var i=0;i<start;i++){
|
1542
|
|
if(i<start){
|
1543
|
|
$(".evastar2").eq(i).addClass("addStar");
|
1544
|
|
}
|
1545
|
|
else{
|
1546
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
1547
|
|
}
|
1548
|
|
}
|
1549
|
|
$("#startCount").val($(".addStar").length);
|
1550
|
|
};
|
1551
|
|
$(".evastar2").bind("click",clickStar);
|
1552
|
|
//发表评论
|
1553
|
|
$("#sendAssessBtn").bind("click",clickSendAssessBtn);
|
1554
|
|
|
1555
|
|
};
|
1556
|
|
/*//绑定对话页面确认完成咨询
|
1557
|
|
$("#confirmBtn").bind("click",assessFn);*/
|
1558
|
|
|
1559
|
|
|
1560
|
|
|
1561
|
|
//点击发表评论:保存发表内容和星级
|
1562
|
|
function clickSendAssessBtn(){
|
1563
|
|
var assessStar = $("#startCount").val();
|
1564
|
|
var assessContant = $(".resouinforcon").find("textarea").val();
|
1565
|
|
//评价状态 0-未评价,1-已评价
|
1566
|
|
|
1567
|
|
//确认完成后,发表评论传值
|
1568
|
|
var assessContentStr ={
|
1569
|
|
"consultId":consultId, //咨询ID
|
1570
|
|
"assessStatus":"1", //评价状态 0-未评价,1-已评价
|
1571
|
|
"assessStar":assessStar, //评价星级
|
1572
|
|
"assessContant":assessContant //评价内容
|
1573
|
|
};
|
1574
|
|
// console.log(assessContentStr);
|
1575
|
|
//如果未评论,提示未评论
|
1576
|
|
/*if(assessStar == "" || assessStar == null || assessStar == undefined){
|
1577
|
|
if(assessContant == "" || assessContant == null || assessContant == undefined){
|
1578
|
|
$.MsgBox.Alert('提示',"未评论,是否退出评论");
|
1579
|
|
}
|
1580
|
|
$.MsgBox.Alert('提示',"未选择星级");
|
1581
|
|
};*/
|
1582
|
|
$.ajax({
|
1583
|
|
"url":"/ajax/consult/assess",//点击发表评论接口
|
1584
|
|
"type":"post",
|
1585
|
|
"data":assessContentStr,
|
1586
|
|
"success":function(response){
|
1587
|
|
// console.log(response);
|
1588
|
|
$(".blackcover").remove();
|
1589
|
|
$("body").css("position","static");
|
1590
|
|
$.MsgBox.Alert('提示',"评论成功");
|
1591
|
|
|
1592
|
|
//评价状态改变,所以头部信息改变
|
1593
|
|
dialogHeadDataHandleFn();
|
1594
|
|
//点击确认完成
|
1595
|
|
//绑定对话页面确认完成咨询
|
1596
|
|
// $("#confirmBtn").bind("click",assessFn);
|
1597
|
|
},
|
1598
|
|
"error":function(error){
|
1599
|
|
//发表评论失败
|
1600
|
|
console.log(error);
|
1601
|
|
}
|
1602
|
|
|
1603
|
|
});
|
1604
|
|
};
|
1605
|
|
|
1606
|
|
|
1607
|
|
|
1608
|
|
},
|
1609
|
|
"error":function(error){
|
1610
|
|
//console.log(data);
|
1611
|
|
//加载对话页面失败
|
1612
|
|
console.log(error);
|
1613
|
|
}
|
1614
|
|
})
|
1615
|
|
|
1616
|
|
|
1617
|
|
};
|
1618
|
|
//给咨询页回复绑定事件
|
1619
|
|
$("#workContainer .workselectitem").find(".replyBtn").bind("click",clickReplyFn);
|
1620
|
|
|
1621
|
|
|
1622
|
|
//收到咨询和收到回复切换
|
1623
|
|
// $(".worksamlltit3:first").addClass("active").show();
|
1624
|
|
// $(".workmysrc3:first").show();
|
1625
|
|
|
1626
|
|
//On Click Event 收到咨询和收到回复tab效果
|
1627
|
|
$(".worksamlltit3").bind("click",tab);
|
1628
|
|
function tab(){
|
1629
|
|
$(".worksamlltit3").removeClass("worksamlltitnow");
|
1630
|
|
$(this).addClass("worksamlltitnow");
|
1631
|
|
$(".workmysrc3").hide();
|
1632
|
|
var activeTab = $(this).attr("href");
|
1633
|
|
$(activeTab).fadeIn();
|
1634
|
|
|
1635
|
|
return false;
|
1636
|
|
};
|
1637
|
|
|
1638
|
|
|
1639
|
|
},
|
1640
|
|
})
|
1641
|
|
|
1642
|
|
}
|
1643
|
|
}
|
1644
|
|
},
|
1645
|
|
"error":function(response){
|
1646
|
|
//收到咨询页面失败
|
1647
|
|
$.MsgBox.Alert('提醒',"咨询页面请求错误");
|
1648
|
|
},
|
1649
|
|
|
1650
|
|
|
1651
|
|
});
|
1652
|
861
|
|
1653
|
862
|
|
1654
|
863
|
}else{
|
|
@ -1657,1101 +866,3 @@ function clickConsultBtn(){
|
1657
|
866
|
|
1658
|
867
|
};
|
1659
|
868
|
|
1660
|
|
|
1661
|
|
|
1662
|
|
|
1663
|
|
/*$(document).ready(function(){
|
1664
|
|
|
1665
|
|
// console.log(localStorage.getItem("professorId"));
|
1666
|
|
$(".workmenu").on("click","#consultbtn",function(){
|
1667
|
|
|
1668
|
|
//1.先ajax请求,判断是否有收到咨询消息,然后ajax-html,然后渲染数据
|
1669
|
|
// console.log(professorIdStrByconsult);
|
1670
|
|
//检查用户是否登录
|
1671
|
|
if(userid != "" && userid != null){
|
1672
|
|
$.ajax({
|
1673
|
|
"url":"/ajax/consult/pqpro",//判断是否有无咨询
|
1674
|
|
"type" : "get",
|
1675
|
|
//传值:登陆人id:专家id
|
1676
|
|
"data" :{"professorId":userid},
|
1677
|
|
"contentType" : "application/x-www-form-urlencoded",
|
1678
|
|
"beforeSend":function(response){
|
1679
|
|
// console.log(response)
|
1680
|
|
},
|
1681
|
|
"success":function(consultResponse){
|
1682
|
|
// console.log(consultResponse);
|
1683
|
|
//如果没有咨询数据 隐藏收到咨询
|
1684
|
|
if(consultResponse["data"]["total"] == 0){
|
1685
|
|
// alert("未收到咨询");
|
1686
|
|
|
1687
|
|
//ajax页面
|
1688
|
|
$.ajax({
|
1689
|
|
"url":"consult.html",
|
1690
|
|
"dataType" : "html",
|
1691
|
|
"success":function(responseHtml){
|
1692
|
|
$(".workcon").html(responseHtml);
|
1693
|
|
|
1694
|
|
$(".worksamlltit3:first").hide();
|
1695
|
|
$(".workmysrc3:first").hide();
|
1696
|
|
$(".workmysrc3:last").fadeIn();
|
1697
|
|
var replyTrHtml;
|
1698
|
|
|
1699
|
|
var pageNo;
|
1700
|
|
|
1701
|
|
//======================================没有咨询情况下 ajax请求收到回复======================
|
1702
|
|
$.ajax({
|
1703
|
|
"url":"/ajax/consult/pqcon",//收到回复接口
|
1704
|
|
"type":"get",
|
1705
|
|
"data":{"consultantId":userid},
|
1706
|
|
"dataType" : "json",
|
1707
|
|
"success":function(replyResponse){
|
1708
|
|
console.log(replyResponse)
|
1709
|
|
|
1710
|
|
var allData = replyResponse.data;
|
1711
|
|
var replyData = allData["data"];
|
1712
|
|
|
1713
|
|
if(replyData.length != 0 && replyData.length != null){
|
1714
|
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
|
1715
|
|
$("#workContainer2").prepend(replyTrHtml);
|
1716
|
|
|
1717
|
|
}else{
|
1718
|
|
return false;
|
1719
|
|
}
|
1720
|
|
|
1721
|
|
|
1722
|
|
},
|
1723
|
|
"error":function(response){
|
1724
|
|
//收到回复失败
|
1725
|
|
// console.log(response)
|
1726
|
|
},
|
1727
|
|
|
1728
|
|
});
|
1729
|
|
|
1730
|
|
//==========================================只有收到回复时,下拉菜单改变 ajax开始==================
|
1731
|
|
|
1732
|
|
//点击正序倒序
|
1733
|
|
var sortFlag2 = true;
|
1734
|
|
$("#replyArrow").click(function(){
|
1735
|
|
if(sortFlag2 == true){
|
1736
|
|
$(this).find("div").css("background-position","-20px 1px");
|
1737
|
|
$("#timeSortId2").val("1");
|
1738
|
|
|
1739
|
|
sortFlag2 =false;
|
1740
|
|
|
1741
|
|
}else{
|
1742
|
|
$(this).find("div").css("background-position","0px 1px");
|
1743
|
|
$("#timeSortId2").val("0");
|
1744
|
|
|
1745
|
|
sortFlag2=true;
|
1746
|
|
}
|
1747
|
|
|
1748
|
|
});
|
1749
|
|
|
1750
|
|
// $("#replyArrow").on("clcik",clickSortFn);
|
1751
|
|
|
1752
|
|
var timeType2,sortType2,replyStatus,consultId;
|
1753
|
|
|
1754
|
|
replyStatus = $("#replySelectId").val();//回复状态值
|
1755
|
|
timeType2 = $("#timeTypeId2").val();//时间类型值
|
1756
|
|
sortType2 = $("#timeSortId2").val();//排序值;
|
1757
|
|
|
1758
|
|
//console.log(consultStatus,timeType,sortType+"res333");
|
1759
|
|
|
1760
|
|
//默认传值:
|
1761
|
|
var replyInfo = {
|
1762
|
|
"consultantId":userid,
|
1763
|
|
"status":replyStatus,
|
1764
|
|
"timeType":timeType2,
|
1765
|
|
"sortType":sortType2
|
1766
|
|
};
|
1767
|
|
function replyStatusFn(){
|
1768
|
|
//改变后,要传的值
|
1769
|
|
replyStatus = $("#replySelectId").val();//咨询状态值
|
1770
|
|
timeType2 = $("#timeTypeId2").val();//时间类型值
|
1771
|
|
sortType2 = $("#timeSortId2").val();//排序值;
|
1772
|
|
|
1773
|
|
replyInfo = {
|
1774
|
|
"consultantId":userid,
|
1775
|
|
"status":replyStatus,
|
1776
|
|
"timeType":timeType2,
|
1777
|
|
"sortType":sortType2
|
1778
|
|
};
|
1779
|
|
// console.log("ajax中的值:"+ replyInfo.replyStatus + replyInfo.timeType + replyInfo.sortType +replyInfo.consultantId);
|
1780
|
|
|
1781
|
|
//=====================================只有收到回复时 更新下拉菜单==============
|
1782
|
|
$.ajax({
|
1783
|
|
"url":"/ajax/consult/pqcon",//更新下拉菜单接口
|
1784
|
|
"type":"get",
|
1785
|
|
"data":replyInfo,
|
1786
|
|
"beforeSend":function(response){
|
1787
|
|
console.log(response);
|
1788
|
|
},
|
1789
|
|
"success":function(response){
|
1790
|
|
$("#workContainer2 .workselectitem").remove();
|
1791
|
|
var allData = response.data;
|
1792
|
|
var replyData = allData["data"];
|
1793
|
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
|
1794
|
|
console.log(replyTrHtml);
|
1795
|
|
// $(".tcdPageCode:last").before(replyTrHtml);
|
1796
|
|
$("#workContainer2").prepend(replyTrHtml);
|
1797
|
|
|
1798
|
|
},
|
1799
|
|
"error":function(response){
|
1800
|
|
// console.log(response)
|
1801
|
|
//更新下拉菜单失败
|
1802
|
|
}
|
1803
|
|
|
1804
|
|
});
|
1805
|
|
};//更新下拉菜单处理函数结束
|
1806
|
|
|
1807
|
|
//绑定回复状态事件
|
1808
|
|
$(".replyOption ul").bind("click", "li",replyStatusFn);
|
1809
|
|
|
1810
|
|
//绑定回复状态事件
|
1811
|
|
$(".timeOption2 ul").bind("click", "li",replyStatusFn);
|
1812
|
|
|
1813
|
|
$("#replyArrow").bind("click",replyStatusFn);
|
1814
|
|
|
1815
|
|
|
1816
|
|
},
|
1817
|
|
"error":function(response){
|
1818
|
|
//请求页面失败
|
1819
|
|
// console.log(response)
|
1820
|
|
},
|
1821
|
|
|
1822
|
|
})
|
1823
|
|
|
1824
|
|
|
1825
|
|
}else{
|
1826
|
|
// alert("收到咨询");
|
1827
|
|
//ajax页面
|
1828
|
|
$.ajax({
|
1829
|
|
"url":"consult.html",
|
1830
|
|
"dataType" : "html",
|
1831
|
|
"success":function(responseHtml){
|
1832
|
|
$(".workcon").html(responseHtml);
|
1833
|
|
|
1834
|
|
//ajax 收到咨询数据和收到回复数据
|
1835
|
|
//ajax收到咨询 consultResponse 收到咨询返回值
|
1836
|
|
var consultTrHtml;
|
1837
|
|
var allData = consultResponse.data;
|
1838
|
|
var consultData = allData["data"];
|
1839
|
|
consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
|
1840
|
|
$("#workContainer").prepend(consultTrHtml);
|
1841
|
|
|
1842
|
|
|
1843
|
|
//================================================有咨询时,下拉菜单改===变 ajax==========================
|
1844
|
|
// 排列顺序(正序、倒序)
|
1845
|
|
var sortFlag = true;//正倒排序标记
|
1846
|
|
$(".orderedbtn").click(function(){
|
1847
|
|
if(sortFlag == true){
|
1848
|
|
$(this).find("div").css("background-position","-20px 1px");
|
1849
|
|
$("#timeSortId").val("1");
|
1850
|
|
|
1851
|
|
sortFlag =false;
|
1852
|
|
|
1853
|
|
}else{
|
1854
|
|
$(this).find("div").css("background-position","0px 1px");
|
1855
|
|
$("#timeSortId").val("0");
|
1856
|
|
|
1857
|
|
sortFlag=true;
|
1858
|
|
}
|
1859
|
|
|
1860
|
|
});
|
1861
|
|
|
1862
|
|
var timeType,sortType,consultStatus,consultId;
|
1863
|
|
|
1864
|
|
consultStatus = $("#consultSelectId").val();//咨询状态值
|
1865
|
|
timeType = $("#timeTypeId").val();//时间类型值
|
1866
|
|
sortType = $("#timeSortId").val();//排序值;
|
1867
|
|
// console.log(consultStatus,timeType,sortType+"res333");
|
1868
|
|
|
1869
|
|
//默认传值:
|
1870
|
|
var consultInfo = {
|
1871
|
|
"professorId":userid,
|
1872
|
|
"status":consultStatus,
|
1873
|
|
"timeType":timeType,
|
1874
|
|
"sortType":sortType
|
1875
|
|
};
|
1876
|
|
// console.log("默认值:"+consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.professorId);
|
1877
|
|
|
1878
|
|
//收到咨询信息改变下拉菜单
|
1879
|
|
function consultStatusFn(){
|
1880
|
|
//改变后,要传的值
|
1881
|
|
consultStatus = $("#consultSelectId").val();//咨询状态值
|
1882
|
|
timeType = $("#timeTypeId").val();//时间类型值
|
1883
|
|
sortType = $("#timeSortId").val();//排序值;
|
1884
|
|
|
1885
|
|
//要传的值:
|
1886
|
|
consultInfo = {
|
1887
|
|
"professorId":userid,
|
1888
|
|
"status":consultStatus,
|
1889
|
|
"timeType":timeType,
|
1890
|
|
"sortType":sortType
|
1891
|
|
|
1892
|
|
};
|
1893
|
|
|
1894
|
|
// console.log("ajax中的值:"+ consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.consultantId);
|
1895
|
|
|
1896
|
|
//更新下拉菜单
|
1897
|
|
$.ajax({
|
1898
|
|
"url":"/ajax/consult/pqpro",//更新下拉菜单接口
|
1899
|
|
"data":consultInfo,
|
1900
|
|
"type":"get",
|
1901
|
|
"beforeSend":function(response){
|
1902
|
|
// console.log(response);
|
1903
|
|
},
|
1904
|
|
"success":function(response){
|
1905
|
|
$("#workContainer .workselectitem").remove();
|
1906
|
|
// $(".tcdPageCode:first").before().empty();
|
1907
|
|
var allData = response.data;
|
1908
|
|
var consultData = allData["data"];
|
1909
|
|
console.log(consultData.length);
|
1910
|
|
consultTrHtml = handleData(consultData,consultTrHtml,"professorId","replyBtn");
|
1911
|
|
// $(".tcdPageCode:first").before(consultTrHtml);
|
1912
|
|
$("#workContainer").prepend(consultTrHtml);
|
1913
|
|
//给咨询页回复绑定事件
|
1914
|
|
$("#workContainer .workselectitem").find(".replyBtn").bind("click",clickReplyFn);
|
1915
|
|
|
1916
|
|
},
|
1917
|
|
"error":function(response){
|
1918
|
|
// console.log(response)
|
1919
|
|
//更新下拉菜单失败
|
1920
|
|
}
|
1921
|
|
|
1922
|
|
});
|
1923
|
|
|
1924
|
|
|
1925
|
|
};//更新咨询下拉菜单处理函数结束
|
1926
|
|
|
1927
|
|
//绑定咨询状态事件
|
1928
|
|
$(".consultOption ul").bind("click", "li",consultStatusFn);
|
1929
|
|
|
1930
|
|
//绑定咨询状态事件
|
1931
|
|
$(".timeOption ul").bind("click", "li",consultStatusFn);
|
1932
|
|
|
1933
|
|
$(".orderedbtn").bind("click",consultStatusFn);
|
1934
|
|
|
1935
|
|
|
1936
|
|
|
1937
|
|
//============================================点击咨询页面中回复按钮=====================
|
1938
|
|
function clickReplyFn(){
|
1939
|
|
var consultId = $.trim($(this).attr("id"));//咨询id
|
1940
|
|
var assessStatus = $.trim($(this).find(".assessStatus").text());//评价状态 0-未评价,1-已评价
|
1941
|
|
var consultStatus = $.trim($(this).find(".coultState").text());//咨询状态 0-进行中,1-已完成
|
1942
|
|
var thanksStatus = $.trim($(this).find(".thanksStatus").text());//感谢状态 0-未感谢,1-已感谢
|
1943
|
|
var assessStar = $.trim($(this).find(".assessStar").val());//星级,几颗星 用隐藏域做
|
1944
|
|
|
1945
|
|
//点击确认完成的传值:consultId,咨询状态
|
1946
|
|
var confirmFinishStr = {
|
1947
|
|
"consultId":consultId,
|
1948
|
|
"consultStatus":consultStatus
|
1949
|
|
};
|
1950
|
|
//对话标题 传值,
|
1951
|
|
var consultIdStr = {
|
1952
|
|
"consultId":consultId
|
1953
|
|
}
|
1954
|
|
|
1955
|
|
//ajax加载对话页面
|
1956
|
|
$.ajax({
|
1957
|
|
"url":"diloags.html",
|
1958
|
|
"dataType":"html",
|
1959
|
|
"success":function(result){
|
1960
|
|
//console.log(data);
|
1961
|
|
$(this).attr("id");
|
1962
|
|
$(".workcon").html(result);
|
1963
|
|
|
1964
|
|
//===========================================dialog数据==================
|
1965
|
|
//=========对话头部
|
1966
|
|
//对话头部数据渲染
|
1967
|
|
function dialogHeadDataHandleFn(){
|
1968
|
|
//星星评级
|
1969
|
|
var starStart;
|
1970
|
|
function clickStar(){
|
1971
|
|
$(".evastar2").removeClass('addStar');
|
1972
|
|
starStart=$(this).index()+1;
|
1973
|
|
for(var i=0;i<starStart;i++){
|
1974
|
|
if(i<starStart){
|
1975
|
|
$(".evastar2").eq(i).addClass("addStar");
|
1976
|
|
}
|
1977
|
|
else{
|
1978
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
1979
|
|
}
|
1980
|
|
}
|
1981
|
|
$("#startCount").val($(".addStar").length);
|
1982
|
|
};
|
1983
|
|
|
1984
|
|
$.ajax({
|
1985
|
|
"url":"/ajax/consult/qapro",//从收到咨询点击回复接口
|
1986
|
|
"type":"get",
|
1987
|
|
"data":consultIdStr,
|
1988
|
|
"success":function(response){
|
1989
|
|
console.log("点击回复返回数据");
|
1990
|
|
console.log(response)
|
1991
|
|
var consultantData = response["data"];
|
1992
|
|
//对话框标题信息
|
1993
|
|
//进行中,
|
1994
|
|
if(consultantData["consultStatus"] == 0){
|
1995
|
|
consultantData["consultStatus"] = "进行中";
|
1996
|
|
|
1997
|
|
$("#dialog_thanksBtn").css("display","none");
|
1998
|
|
$("#dialog_assessBtn").css("display","none");
|
1999
|
|
$("#showAllAssess").css("display","none");//总体评价
|
2000
|
|
$(".dialogfoot").css("display","block");//显示发送对话部分
|
2001
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
2002
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2003
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
2004
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2005
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2006
|
|
|
2007
|
|
}
|
2008
|
|
//已完成
|
2009
|
|
if(consultantData["consultStatus"] == 1 || consultantData["consultStatus"] == 2 ||consultantData["consultStatus"] == 3 || consultantData["consultStatus"] == 4){
|
2010
|
|
consultantData["consultStatus"] = "已完成";
|
2011
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
2012
|
|
//已完成,未感谢:
|
2013
|
|
if(consultantData["thanksStatus"] == 0){
|
2014
|
|
//未感谢,未评价
|
2015
|
|
if(consultantData["assessStatus"] == 0){
|
2016
|
|
|
2017
|
|
$("#dialog_thanksBtn").css("display","none");
|
2018
|
|
$("#dialog_assessBtn").css("display","none");
|
2019
|
|
$("#showAllAssess").css("display","none");//隐藏评价
|
2020
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
2021
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2022
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2023
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2024
|
|
}
|
2025
|
|
//未感谢,已评价
|
2026
|
|
else{
|
2027
|
|
|
2028
|
|
$("#dialog_thanksBtn").css("display","none");
|
2029
|
|
$("#dialog_assessBtn").css("display","none");
|
2030
|
|
$("#showAllAssess").css("display","block");
|
2031
|
|
var starCount = consultantData["assessStar"];
|
2032
|
|
for(var i=0;i<starCount;i++){
|
2033
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
2034
|
|
}
|
2035
|
|
$("#showAllAssess").css("display","block");//显示星级
|
2036
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
2037
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2038
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2039
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2040
|
|
}
|
2041
|
|
|
2042
|
|
}
|
2043
|
|
//已完成,已感谢:评价星级,感谢金额
|
2044
|
|
if(consultantData["thanksStatus"] == 1){
|
2045
|
|
|
2046
|
|
$("#dialog_thanksBtn").css("display","none");
|
2047
|
|
$("#dialog_assessBtn").css("display","none");
|
2048
|
|
$(".dialogfoot").css("display","none");//隐藏发送对话部分
|
2049
|
|
$("#showAllAssess").css("display","block");
|
2050
|
|
var starCount = consultantData["assessStar"];
|
2051
|
|
for(var i=0;i<starCount;i++){
|
2052
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
2053
|
|
};
|
2054
|
|
$("#dialog_thanks").css("display","block");//显示感谢
|
2055
|
|
$("#showAllAssess").css("display","block");//显示星级
|
2056
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2057
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
2058
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2059
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2060
|
|
}
|
2061
|
|
|
2062
|
|
}
|
2063
|
|
|
2064
|
|
},
|
2065
|
|
"error":function(error){
|
2066
|
|
//对话框头部信息请求失败
|
2067
|
|
}
|
2068
|
|
});
|
2069
|
|
|
2070
|
|
};
|
2071
|
|
|
2072
|
|
dialogHeadDataHandleFn();
|
2073
|
|
|
2074
|
|
//============对话内容数据处理函数
|
2075
|
|
function dialogContentDataHandle(){
|
2076
|
|
$.ajax({
|
2077
|
|
"url":"/ajax/tidings/qacon",//对话内容显示接口
|
2078
|
|
"type":"get",
|
2079
|
|
"data":consultIdStr,
|
2080
|
|
"beforeSend":function(response){
|
2081
|
|
//对话发送消息失败
|
2082
|
|
//console.log(response);
|
2083
|
|
},
|
2084
|
|
"success":function(response){
|
2085
|
|
console.log()
|
2086
|
|
var dialogConData = response["data"];
|
2087
|
|
console.log(dialogConData);
|
2088
|
|
var dialogStr;
|
2089
|
|
dialogStr = dialogContentStrFn(dialogConData);
|
2090
|
|
$("#dialogContent").prepend(dialogStr);
|
2091
|
|
//
|
2092
|
|
},
|
2093
|
|
"error":function(error){
|
2094
|
|
//对话框内容信息请求失败
|
2095
|
|
}
|
2096
|
|
});
|
2097
|
|
|
2098
|
|
|
2099
|
|
};
|
2100
|
|
dialogContentDataHandle();
|
2101
|
|
|
2102
|
|
//=============================对话页面底部发送
|
2103
|
|
//发送按钮处理函数
|
2104
|
|
function sendDialogContentFn(){
|
2105
|
|
var tidingsContant = $("#dialog_sendContent").val();
|
2106
|
|
var tidingStr = {
|
2107
|
|
"tidingsContant":tidingsContant,
|
2108
|
|
"senderId":userid,
|
2109
|
|
"consultId":consultId
|
2110
|
|
};
|
2111
|
|
//console.log(tidingStr);
|
2112
|
|
$.ajax({
|
2113
|
|
"url":"/ajax/tidings",
|
2114
|
|
"type":"post",
|
2115
|
|
"data":tidingStr,
|
2116
|
|
"beforeSend":function(response){
|
2117
|
|
//对话发送消息失败
|
2118
|
|
console.log(response);
|
2119
|
|
},
|
2120
|
|
"success":function(response){
|
2121
|
|
console.log(response);//返回对话内容的id
|
2122
|
|
$("#dialogContent").empty();
|
2123
|
|
dialogContentDataHandle();
|
2124
|
|
},
|
2125
|
|
"error":function(error){
|
2126
|
|
//对话发送消息失败
|
2127
|
|
console.log(error);
|
2128
|
|
}
|
2129
|
|
});
|
2130
|
|
$("#dialog_sendContent").val("");
|
2131
|
|
};
|
2132
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
2133
|
|
|
2134
|
|
|
2135
|
|
//==============点击确认完成
|
2136
|
|
function assessFn(){
|
2137
|
|
ConsultComment();
|
2138
|
|
if($(this).attr("id") == "dialog_thanksBtn"){
|
2139
|
|
$(".overcomment").css("display","block");//显示感谢
|
2140
|
|
}
|
2141
|
|
if($(this).attr("id") == "dialog_assessBtn"){
|
2142
|
|
$(".addcomment2").css("display","block");//显示评价
|
2143
|
|
}
|
2144
|
|
//评价星星样式
|
2145
|
|
var start;
|
2146
|
|
function clickStar(){
|
2147
|
|
$(".evastar2").removeClass('addStar');
|
2148
|
|
start=$(this).index()+1;
|
2149
|
|
for(var i=0;i<start;i++){
|
2150
|
|
if(i<start){
|
2151
|
|
$(".evastar2").eq(i).addClass("addStar");
|
2152
|
|
}
|
2153
|
|
else{
|
2154
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
2155
|
|
}
|
2156
|
|
}
|
2157
|
|
$("#startCount").val($(".addStar").length);
|
2158
|
|
};
|
2159
|
|
$(".evastar2").bind("click",clickStar);
|
2160
|
|
//发表评论
|
2161
|
|
$("#sendAssessBtn").bind("click",clickSendAssessBtn);
|
2162
|
|
|
2163
|
|
};
|
2164
|
|
//绑定对话页面确认完成咨询
|
2165
|
|
$("#confirmBtn").bind("click",assessFn);
|
2166
|
|
|
2167
|
|
|
2168
|
|
//点击发表评论:保存发表内容和星级
|
2169
|
|
function clickSendAssessBtn(){
|
2170
|
|
var assessStar = $("#startCount").val();
|
2171
|
|
var assessContant = $(".resouinforcon").find("textarea").val();
|
2172
|
|
//评价状态 0-未评价,1-已评价
|
2173
|
|
|
2174
|
|
//确认完成后,发表评论传值
|
2175
|
|
var assessContentStr ={
|
2176
|
|
"consultId":consultId, //咨询ID
|
2177
|
|
"assessStatus":"1", //评价状态 0-未评价,1-已评价
|
2178
|
|
"assessStar":assessStar, //评价星级
|
2179
|
|
"assessContant":assessContant //评价内容
|
2180
|
|
};
|
2181
|
|
console.log(assessContentStr);
|
2182
|
|
//如果未评论,提示未评论
|
2183
|
|
if(assessStar == "" || assessStar == null || assessStar == undefined){
|
2184
|
|
if(assessContant == "" || assessContant == null || assessContant == undefined){
|
2185
|
|
$.MsgBox.Alert('提示',"未评论,是否退出评论");
|
2186
|
|
}
|
2187
|
|
$.MsgBox.Alert('提示',"未选择星级");
|
2188
|
|
};
|
2189
|
|
$.ajax({
|
2190
|
|
"url":"/ajax/consult/assess",//点击发表评论接口
|
2191
|
|
"type":"post",
|
2192
|
|
"data":assessContentStr,
|
2193
|
|
"success":function(response){
|
2194
|
|
console.log(response);
|
2195
|
|
$(".blackcover").remove();
|
2196
|
|
$("body").css("position","static");
|
2197
|
|
$.MsgBox.Alert('提示',"评论成功");
|
2198
|
|
|
2199
|
|
//评价状态改变,所以头部信息改变
|
2200
|
|
dialogHeadDataHandleFn();
|
2201
|
|
},
|
2202
|
|
"error":function(error){
|
2203
|
|
//发表评论失败
|
2204
|
|
console.log(error);
|
2205
|
|
}
|
2206
|
|
|
2207
|
|
});
|
2208
|
|
};
|
2209
|
|
|
2210
|
|
|
2211
|
|
|
2212
|
|
},
|
2213
|
|
"error":function(error){
|
2214
|
|
//console.log(data);
|
2215
|
|
//加载对话页面失败
|
2216
|
|
console.log(error);
|
2217
|
|
}
|
2218
|
|
})
|
2219
|
|
|
2220
|
|
|
2221
|
|
};
|
2222
|
|
//给咨询页回复绑定事件
|
2223
|
|
$("#workContainer .workselectitem").find(".replyBtn").bind("click",clickReplyFn);
|
2224
|
|
|
2225
|
|
|
2226
|
|
//收到咨询和收到回复切换
|
2227
|
|
$(".worksamlltit3:first").addClass("active").show();
|
2228
|
|
$(".workmysrc3:first").show();
|
2229
|
|
|
2230
|
|
//On Click Event 收到咨询和收到回复tab效果
|
2231
|
|
$(".worksamlltit3").click(function() {
|
2232
|
|
$(".worksamlltit3").removeClass("worksamlltitnow");
|
2233
|
|
$(this).addClass("worksamlltitnow");
|
2234
|
|
|
2235
|
|
$(".workmysrc3").hide();
|
2236
|
|
|
2237
|
|
var activeTab = $(this).attr("href");
|
2238
|
|
$(activeTab).fadeIn();
|
2239
|
|
return false;
|
2240
|
|
});
|
2241
|
|
|
2242
|
|
//=============================有咨询和回复时:ajax收到回复数据=============================
|
2243
|
|
$.ajax({
|
2244
|
|
"url" : "/ajax/consult/pqcon",//收到回复接口
|
2245
|
|
"type" : "get",
|
2246
|
|
//传值:登陆人id:咨询id
|
2247
|
|
"data" :consultIdStrByReply,
|
2248
|
|
"dataType" : "json",
|
2249
|
|
"contentType" : "application/x-www-form-urlencoded",
|
2250
|
|
"beforeSend":function(response){
|
2251
|
|
// console.log(response)
|
2252
|
|
},
|
2253
|
|
"success":function(replyResponse){
|
2254
|
|
//拿到收到回复数据
|
2255
|
|
// console.log(replyResponse);
|
2256
|
|
var replyTrHtml;
|
2257
|
|
var allData = replyResponse.data;
|
2258
|
|
var replyData = allData["data"];
|
2259
|
|
// console.log(replyData.length);
|
2260
|
|
if(replyData.length != 0 && replyData.length != null){
|
2261
|
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
|
2262
|
|
// $(".tcdPageCode:last").before(replyTrHtml);
|
2263
|
|
$("#workContainer2").prepend(replyTrHtml);
|
2264
|
|
|
2265
|
|
|
2266
|
|
$("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
|
2267
|
|
|
2268
|
|
}else{
|
2269
|
|
return false;
|
2270
|
|
}
|
2271
|
|
|
2272
|
|
|
2273
|
|
},
|
2274
|
|
"error":function(response){
|
2275
|
|
//收到回复错误返回
|
2276
|
|
// console.log(response)
|
2277
|
|
},
|
2278
|
|
|
2279
|
|
});
|
2280
|
|
|
2281
|
|
//==========================================咨询和收到回复,下拉菜单改变 ajax开始==================
|
2282
|
|
|
2283
|
|
//收到咨询和收到回复下拉菜单点击函数
|
2284
|
|
//排列顺序(正序、倒序)
|
2285
|
|
var sortFlag1 = true;//正倒排序标记
|
2286
|
|
$("#replyArrow").click(function(){
|
2287
|
|
if(sortFlag1 == true){
|
2288
|
|
$(this).find("div").css("background-position","-20px 1px");
|
2289
|
|
$("#timeSortId2").val("1");
|
2290
|
|
|
2291
|
|
sortFlag1 =false;
|
2292
|
|
|
2293
|
|
}else{
|
2294
|
|
$(this).find("div").css("background-position","0px 1px");
|
2295
|
|
$("#timeSortId2").val("0");
|
2296
|
|
|
2297
|
|
sortFlag1=true;
|
2298
|
|
}
|
2299
|
|
|
2300
|
|
});
|
2301
|
|
|
2302
|
|
var timeType2,sortType2,replyStatus,consultId;
|
2303
|
|
|
2304
|
|
replyStatus = $("#replySelectId").val();//回复状态值
|
2305
|
|
timeType2 = $("#timeTypeId2").val();//时间类型值
|
2306
|
|
sortType2 = $("#timeSortId2").val();//排序值;
|
2307
|
|
|
2308
|
|
//console.log(consultStatus,timeType,sortType+"res333");
|
2309
|
|
|
2310
|
|
//默认传值:
|
2311
|
|
var replyInfo = {
|
2312
|
|
"consultantId":userid,
|
2313
|
|
"status":replyStatus,
|
2314
|
|
"timeType":timeType2,
|
2315
|
|
"sortType":sortType2
|
2316
|
|
};
|
2317
|
|
//回复下拉菜单改变
|
2318
|
|
function replyStatusFn(){
|
2319
|
|
//改变后,要传的值
|
2320
|
|
replyStatus = $("#replySelectId").val();//咨询状态值
|
2321
|
|
timeType2 = $("#timeTypeId2").val();//时间类型值
|
2322
|
|
sortType2 = $("#timeSortId2").val();//排序值;
|
2323
|
|
|
2324
|
|
//要传的值:
|
2325
|
|
replyInfo = {
|
2326
|
|
"consultantId":userid,
|
2327
|
|
"status":replyStatus,
|
2328
|
|
"timeType":timeType2,
|
2329
|
|
"sortType":sortType2
|
2330
|
|
};
|
2331
|
|
// console.log("ajax中的值:"+ replyInfo.replyStatus + replyInfo.timeType + replyInfo.sortType +replyInfo.consultantId);
|
2332
|
|
|
2333
|
|
|
2334
|
|
$.ajax({
|
2335
|
|
"url":"/ajax/consult/pqcon",//更新下拉菜单接口
|
2336
|
|
"type":"get",
|
2337
|
|
"data":replyInfo,
|
2338
|
|
"beforeSend":function(response){
|
2339
|
|
console.log(response);
|
2340
|
|
},
|
2341
|
|
"success":function(response){
|
2342
|
|
$("#workContainer2 .workselectitem").remove();
|
2343
|
|
// $(".tcdPageCode:first").before().empty();
|
2344
|
|
var allData = response.data;
|
2345
|
|
var replyData = allData["data"];
|
2346
|
|
var replyTrHtml;
|
2347
|
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","lookBtn");
|
2348
|
|
// $(".tcdPageCode:last").before(replyTrHtml);
|
2349
|
|
$("#workContainer2").prepend(replyTrHtml);
|
2350
|
|
|
2351
|
|
$("#workContainer2 .workselectitem").find(".lookBtn").bind("click",clickLookBtn);
|
2352
|
|
},
|
2353
|
|
"error":function(response){
|
2354
|
|
// console.log(response)
|
2355
|
|
//更新下拉菜单失败
|
2356
|
|
}
|
2357
|
|
|
2358
|
|
});
|
2359
|
|
|
2360
|
|
|
2361
|
|
};//更新下拉菜单处理函数结束
|
2362
|
|
|
2363
|
|
//绑定回复状态事件
|
2364
|
|
$(".replyOption ul").bind("click", "li",replyStatusFn);
|
2365
|
|
|
2366
|
|
//绑定回复状态事件
|
2367
|
|
$(".timeOption2 ul").bind("click", "li",replyStatusFn);
|
2368
|
|
|
2369
|
|
$("#replyArrow").bind("click",replyStatusFn);
|
2370
|
|
|
2371
|
|
|
2372
|
|
|
2373
|
|
//=======================================================点击回复中查看
|
2374
|
|
function clickLookBtn(){
|
2375
|
|
var consultId = $.trim($(this).attr("id"));//咨询id
|
2376
|
|
var assessStatus = $.trim($(this).attr("assess"));//评价状态 0-未评价,1-已评价
|
2377
|
|
var consultStatus = $(this).find(".coultState").text();//咨询状态 0-进行中,1-已完成
|
2378
|
|
var thanksStatus = $(this).find(".thanksStatus").text();//感谢状态 0-未感谢,1-已感谢
|
2379
|
|
var assessStar = $(this).find(".assessStar").val();//星级,几颗星 用隐藏域做
|
2380
|
|
localStorage.setItem("consultId", consultId);
|
2381
|
|
//点击确认完成的传值:consultId,咨询状态
|
2382
|
|
var confirmFinishStr = {
|
2383
|
|
"consultId":consultId,
|
2384
|
|
"consultStatus":consultStatus
|
2385
|
|
};
|
2386
|
|
//对话标题 传值,
|
2387
|
|
var consultIdStr = {
|
2388
|
|
"consultId":consultId
|
2389
|
|
}
|
2390
|
|
if(assessStatus == "已评价"){
|
2391
|
|
//ajax加载对话页面
|
2392
|
|
$.ajax({
|
2393
|
|
"url":"diloags.html",
|
2394
|
|
"dataType":"html",
|
2395
|
|
"success":function(result){
|
2396
|
|
//console.log(data);
|
2397
|
|
$(this).attr("id");
|
2398
|
|
$(".workcon").html(result);
|
2399
|
|
|
2400
|
|
lookDialogHeadDataHandleFn();
|
2401
|
|
dialogContentDataHandle();
|
2402
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
2403
|
|
|
2404
|
|
|
2405
|
|
},
|
2406
|
|
"error":function(error){
|
2407
|
|
//console.log(data);
|
2408
|
|
//加载对话页面失败
|
2409
|
|
console.log(error);
|
2410
|
|
}
|
2411
|
|
});
|
2412
|
|
}else{
|
2413
|
|
assessFn();
|
2414
|
|
//点击稍后评价
|
2415
|
|
$("#noAssessBtn").bind("click",noAssess);
|
2416
|
|
|
2417
|
|
}
|
2418
|
|
|
2419
|
|
//===========================================dialog数据==================
|
2420
|
|
//=========对话头部
|
2421
|
|
//对话头部数据渲染
|
2422
|
|
function lookDialogHeadDataHandleFn(){
|
2423
|
|
//星星评级
|
2424
|
|
var starStart;
|
2425
|
|
function clickStar(){
|
2426
|
|
$(".evastar2").removeClass('addStar');
|
2427
|
|
starStart=$(this).index()+1;
|
2428
|
|
for(var i=0;i<starStart;i++){
|
2429
|
|
if(i<starStart){
|
2430
|
|
$(".evastar2").eq(i).addClass("addStar");
|
2431
|
|
}
|
2432
|
|
else{
|
2433
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
2434
|
|
}
|
2435
|
|
}
|
2436
|
|
$("#startCount").val($(".addStar").length);
|
2437
|
|
};
|
2438
|
|
|
2439
|
|
$.ajax({
|
2440
|
|
"url":"/ajax/consult/qacon",//从收到回复点击查看接口
|
2441
|
|
"type":"get",
|
2442
|
|
"data":consultIdStr,
|
2443
|
|
"success":function(response){
|
2444
|
|
// console.log("点击查看返回数据");
|
2445
|
|
// console.log(response)
|
2446
|
|
var consultantData = response["data"];
|
2447
|
|
//对话框标题信息
|
2448
|
|
//进行中,
|
2449
|
|
if(consultantData["consultStatus"] == 0){
|
2450
|
|
consultantData["consultStatus"] = "进行中";
|
2451
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
2452
|
|
$("#confirmBtn").removeClass("displayNone");//确认完成按钮显示
|
2453
|
|
$("#showAllAssess").css("display","none");//总体评价
|
2454
|
|
$(".dialogfoot").css("display","block");//显示发送对话部分
|
2455
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
2456
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2457
|
|
|
2458
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2459
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2460
|
|
|
2461
|
|
}
|
2462
|
|
//已完成
|
2463
|
|
if(consultantData["consultStatus"] == 1 || consultantData["consultStatus"] == 2 ||consultantData["consultStatus"] == 3 || consultantData["consultStatus"] == 4){
|
2464
|
|
consultantData["consultStatus"] = "已完成";
|
2465
|
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
2466
|
|
//已完成,未感谢:
|
2467
|
|
if(consultantData["thanksStatus"] == 0){
|
2468
|
|
$("#dialog_thanksBtn").css("display","block");//显示感谢按钮
|
2469
|
|
//未感谢,未评价
|
2470
|
|
if(consultantData["assessStatus"] == 0){
|
2471
|
|
$("#dialog_assessBtn").css("display","block");//显示评价按钮
|
2472
|
|
|
2473
|
|
$("#showAllAssess").css("display","none");//隐藏总体评价
|
2474
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
2475
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2476
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2477
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2478
|
|
}
|
2479
|
|
//未感谢,已评价
|
2480
|
|
else{
|
2481
|
|
|
2482
|
|
// $("#dialog_thanksBtn").css("display","block");//显示感谢按钮
|
2483
|
|
|
2484
|
|
var starCount = consultantData["assessStar"];
|
2485
|
|
for(var i=0;i<starCount;i++){
|
2486
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
2487
|
|
}
|
2488
|
|
$("#showAllAssess").css("display","block");//显示星级
|
2489
|
|
$("#dialog_thanks").css("display","none");//隐藏感谢
|
2490
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2491
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2492
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2493
|
|
}
|
2494
|
|
|
2495
|
|
}
|
2496
|
|
//已完成,已感谢:评价星级,感谢金额
|
2497
|
|
if(consultantData["thanksStatus"] == 1){
|
2498
|
|
$(".dialogfoot").css("display","none");//隐藏发送对话部分
|
2499
|
|
var starCount = consultantData["assessStar"];
|
2500
|
|
for(var i=0;i<starCount;i++){
|
2501
|
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
2502
|
|
};
|
2503
|
|
$("#showAllAssess").css("display","block");//显示星级
|
2504
|
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
2505
|
|
|
2506
|
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
2507
|
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
2508
|
|
$("#dialog_thanksMoney").text(consultantData["thanksMoney"]);
|
2509
|
|
}
|
2510
|
|
|
2511
|
|
}
|
2512
|
|
|
2513
|
|
},
|
2514
|
|
"error":function(error){
|
2515
|
|
//对话框头部信息请求失败
|
2516
|
|
}
|
2517
|
|
});
|
2518
|
|
|
2519
|
|
};
|
2520
|
|
|
2521
|
|
|
2522
|
|
|
2523
|
|
//============对话内容数据处理函数
|
2524
|
|
function dialogContentDataHandle(){
|
2525
|
|
$.ajax({
|
2526
|
|
"url":"/ajax/tidings/qacon",//对话内容显示接口
|
2527
|
|
"type":"get",
|
2528
|
|
"data":consultIdStr,
|
2529
|
|
"beforeSend":function(response){
|
2530
|
|
//对话发送消息失败
|
2531
|
|
//console.log(response);
|
2532
|
|
},
|
2533
|
|
"success":function(response){
|
2534
|
|
console.log()
|
2535
|
|
var dialogConData = response["data"];
|
2536
|
|
// console.log(dialogConData);
|
2537
|
|
var dialogStr;
|
2538
|
|
dialogStr = dialogContentStrFn(dialogConData);
|
2539
|
|
$("#dialogContent").prepend(dialogStr);
|
2540
|
|
//
|
2541
|
|
},
|
2542
|
|
"error":function(error){
|
2543
|
|
//对话框内容信息请求失败
|
2544
|
|
}
|
2545
|
|
});
|
2546
|
|
|
2547
|
|
|
2548
|
|
};
|
2549
|
|
|
2550
|
|
|
2551
|
|
//=============================对话页面底部发送
|
2552
|
|
//发送按钮处理函数
|
2553
|
|
function sendDialogContentFn(){
|
2554
|
|
var tidingsContant = $("#dialog_sendContent").val();
|
2555
|
|
var tidingStr = {
|
2556
|
|
"tidingsContant":tidingsContant,
|
2557
|
|
"senderId":userid,
|
2558
|
|
"consultId":consultId
|
2559
|
|
};
|
2560
|
|
//console.log(tidingStr);
|
2561
|
|
$.ajax({
|
2562
|
|
"url":"/ajax/tidings",
|
2563
|
|
"type":"post",
|
2564
|
|
"data":tidingStr,
|
2565
|
|
"beforeSend":function(response){
|
2566
|
|
//对话发送消息失败
|
2567
|
|
console.log(response);
|
2568
|
|
},
|
2569
|
|
"success":function(response){
|
2570
|
|
console.log(response);//返回对话内容的id
|
2571
|
|
$("#dialogContent").empty();
|
2572
|
|
dialogContentDataHandle();
|
2573
|
|
},
|
2574
|
|
"error":function(error){
|
2575
|
|
//对话发送消息失败
|
2576
|
|
console.log(error);
|
2577
|
|
}
|
2578
|
|
});
|
2579
|
|
$("#dialog_sendContent").val("");
|
2580
|
|
};
|
2581
|
|
|
2582
|
|
|
2583
|
|
|
2584
|
|
//==============发表评价页
|
2585
|
|
function assessFn(){
|
2586
|
|
ConsultComment();
|
2587
|
|
|
2588
|
|
if($.trim($(this).attr("thanks")) == "未感谢"){
|
2589
|
|
$(".addcomment2").css("display","none");//
|
2590
|
|
|
2591
|
|
}else{
|
2592
|
|
|
2593
|
|
$(".overcomment").css("display","none");
|
2594
|
|
}
|
2595
|
|
//评价星星样式
|
2596
|
|
var start;
|
2597
|
|
function clickStar(){
|
2598
|
|
$(".evastar2").removeClass('addStar');
|
2599
|
|
start=$(this).index()+1;
|
2600
|
|
for(var i=0;i<start;i++){
|
2601
|
|
if(i<start){
|
2602
|
|
$(".evastar2").eq(i).addClass("addStar");
|
2603
|
|
}
|
2604
|
|
else{
|
2605
|
|
$(".evastar2").eq(i).removeClass('addStar');
|
2606
|
|
}
|
2607
|
|
}
|
2608
|
|
$("#startCount").val($(".addStar").length);
|
2609
|
|
};
|
2610
|
|
$(".evastar2").bind("click",clickStar);
|
2611
|
|
//发表评论
|
2612
|
|
$("#sendAssessBtn").bind("click",clickSendAssessBtn);
|
2613
|
|
|
2614
|
|
};
|
2615
|
|
|
2616
|
|
//绑定对话页面确认完成咨询
|
2617
|
|
$("#confirmBtn").bind("click",assessFn);
|
2618
|
|
|
2619
|
|
$("#dialog_assessBtn").bind("click",assessFn);
|
2620
|
|
|
2621
|
|
|
2622
|
|
//点击发表评论:保存发表内容和星级
|
2623
|
|
function clickSendAssessBtn(){
|
2624
|
|
var consultId = localStorage.getItem("consultId");//
|
2625
|
|
var assessStar = $("#startCount").val();
|
2626
|
|
var assessContant = $(".resouinforcon").find("textarea").val();
|
2627
|
|
//评价状态 0-未评价,1-已评价
|
2628
|
|
|
2629
|
|
//确认完成后,发表评论传值
|
2630
|
|
var assessContentStr ={
|
2631
|
|
"consultId":consultId, //咨询ID
|
2632
|
|
"assessStatus":"1", //评价状态 0-未评价,1-已评价
|
2633
|
|
"assessStar":assessStar, //评价星级
|
2634
|
|
"assessContant":assessContant //评价内容
|
2635
|
|
};
|
2636
|
|
// console.log(assessContentStr);
|
2637
|
|
//如果未评论,提示未评论
|
2638
|
|
if(assessStar == "" || assessStar == null || assessStar == undefined){
|
2639
|
|
if(assessContant == "" || assessContant == null || assessContant == undefined){
|
2640
|
|
$.MsgBox.Alert('提示',"未评论,是否退出评论");
|
2641
|
|
}
|
2642
|
|
$.MsgBox.Alert('提示',"未选择星级");
|
2643
|
|
};
|
2644
|
|
//保存
|
2645
|
|
$.ajax({
|
2646
|
|
"url":"/ajax/consult/assess",//点击发表评论接口
|
2647
|
|
"type":"post",
|
2648
|
|
"data":assessContentStr,
|
2649
|
|
"success":function(response){
|
2650
|
|
// console.log(response);
|
2651
|
|
$(".blackcover").remove();
|
2652
|
|
$("body").css("position","static");
|
2653
|
|
$.MsgBox.Alert('提示',"评论成功");
|
2654
|
|
//评价状态改变,所以头部信息改变
|
2655
|
|
lookDialogHeadDataHandleFn();
|
2656
|
|
},
|
2657
|
|
"error":function(error){
|
2658
|
|
//发表评论失败
|
2659
|
|
console.log(error);
|
2660
|
|
}
|
2661
|
|
|
2662
|
|
});
|
2663
|
|
//发表评论
|
2664
|
|
$.ajax({
|
2665
|
|
"url":"diloags.html",
|
2666
|
|
"dataType":"html",
|
2667
|
|
"success":function(result){
|
2668
|
|
//console.log(data);
|
2669
|
|
$(this).attr("id");
|
2670
|
|
$(".workcon").html(result);
|
2671
|
|
|
2672
|
|
$(".blackcover").remove();
|
2673
|
|
$("body").css("position","static");
|
2674
|
|
lookDialogHeadDataHandleFn();
|
2675
|
|
dialogContentDataHandle();
|
2676
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
2677
|
|
|
2678
|
|
|
2679
|
|
},
|
2680
|
|
"error":function(error){
|
2681
|
|
//console.log(data);
|
2682
|
|
//加载对话页面失败
|
2683
|
|
console.log(error);
|
2684
|
|
}
|
2685
|
|
});
|
2686
|
|
|
2687
|
|
|
2688
|
|
|
2689
|
|
};
|
2690
|
|
|
2691
|
|
|
2692
|
|
//稍后评价、
|
2693
|
|
function noAssess(){
|
2694
|
|
// $(".blackcover").remove();
|
2695
|
|
// $("body").css("position","static");
|
2696
|
|
$.ajax({
|
2697
|
|
"url":"diloags.html",
|
2698
|
|
"dataType":"html",
|
2699
|
|
"success":function(result){
|
2700
|
|
//console.log(data);
|
2701
|
|
$(this).attr("id");
|
2702
|
|
$(".workcon").html(result);
|
2703
|
|
|
2704
|
|
$(".blackcover").remove();
|
2705
|
|
$("body").css("position","static");
|
2706
|
|
lookDialogHeadDataHandleFn();
|
2707
|
|
dialogContentDataHandle();
|
2708
|
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
2709
|
|
|
2710
|
|
|
2711
|
|
},
|
2712
|
|
"error":function(error){
|
2713
|
|
//console.log(data);
|
2714
|
|
//加载对话页面失败
|
2715
|
|
console.log(error);
|
2716
|
|
}
|
2717
|
|
});
|
2718
|
|
};
|
2719
|
|
|
2720
|
|
|
2721
|
|
|
2722
|
|
|
2723
|
|
|
2724
|
|
|
2725
|
|
|
2726
|
|
};//收到回复点击查看函数结束
|
2727
|
|
|
2728
|
|
|
2729
|
|
|
2730
|
|
|
2731
|
|
|
2732
|
|
},
|
2733
|
|
})
|
2734
|
|
|
2735
|
|
}
|
2736
|
|
},
|
2737
|
|
"complete":function(response){
|
2738
|
|
// console.log(response)
|
2739
|
|
},
|
2740
|
|
"error":function(response){
|
2741
|
|
//收到咨询页面失败
|
2742
|
|
// console.log(response)
|
2743
|
|
},
|
2744
|
|
|
2745
|
|
|
2746
|
|
});
|
2747
|
|
|
2748
|
|
|
2749
|
|
}else{
|
2750
|
|
$.MsgBox.Alert('提醒',"您尚未登录");
|
2751
|
|
}
|
2752
|
|
|
2753
|
|
|
2754
|
|
})
|
2755
|
|
|
2756
|
|
})*/
|
2757
|
|
|