|
@ -2,6 +2,8 @@
|
2
|
2
|
*
|
3
|
3
|
*/
|
4
|
4
|
|
|
5
|
|
|
6
|
|
5
|
7
|
//ajax封装函数
|
6
|
8
|
|
7
|
9
|
//创建构造函数类
|
|
@ -56,19 +58,156 @@ Conuslt.prototype = {
|
56
|
58
|
},
|
57
|
59
|
}
|
58
|
60
|
|
59
|
|
|
|
61
|
//登陆人id
|
|
62
|
var userid = $.cookie("userid");
|
60
|
63
|
//收到咨询数据成功函数
|
61
|
64
|
function successRelyFn(response){
|
62
|
65
|
|
63
|
66
|
};
|
64
|
67
|
|
|
68
|
//data:需要处理的数据,htmlStr:页面中需要的html字符串拼接,
|
|
69
|
//attrParams:数据中不同的参数比如:收到咨询是professorId,收到答复:consultantId
|
|
70
|
function handleData(data,htmlStr,attrParams,text){
|
|
71
|
htmlStr = '';
|
|
72
|
for(var i = 0; i < data.length;i++){
|
|
73
|
htmlStr +=
|
|
74
|
"<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
|
|
75
|
"<table width='100%'>" +
|
|
76
|
"<tbody><tr>" +
|
|
77
|
"<td width='14%' class='messagebox'>" +
|
|
78
|
"<a class='workhead workitimg' href='information.html'>" +
|
|
79
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
|
80
|
"</a>" +
|
|
81
|
"<span class='msgprompt'>1</span>" +
|
|
82
|
"</td>" +
|
|
83
|
"<td style='position:relative;' width='86%'>" +
|
|
84
|
"<div class='workinfor worksitcon'>" +
|
|
85
|
"<h4><a href='' 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>" +
|
|
86
|
"<h6><span>职称 " + data[i]["professor"]["title"] +" </span>,<span>职位 " + data[i]["consultId"] +" </span>,<span> " + data[i]["professor"]["orgName"] +" </span>,<span> " + data[i]["professor"]["department"] +" </span> | <span> " + data[i]["professor"]["adress"] +" </span></h6>" +
|
|
87
|
"<h6>"+
|
|
88
|
"<span>咨询主题:<em> " + data[i]["consultTitle"] +" </em></span>" +
|
|
89
|
" " +
|
|
90
|
"<span>咨询类型:<em> " + data[i]["consultType"] +" </em></span>" +
|
|
91
|
" <span>" +
|
|
92
|
"咨询发起时间:<em> " +
|
|
93
|
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)+
|
|
94
|
"</em>" +
|
|
95
|
"</span></h6>" +
|
|
96
|
"<p>最后回复<span class='lasttime'> ( " +
|
|
97
|
data[i]["revoveryTime"].substr(0,4) + "-" + data[i]["revoveryTime"].substr(4,2) + "-" + data[i]["revoveryTime"].substr(6,2) + " " + data[i]["revoveryTime"].substr(8,2)+ ":" +data[i]["revoveryTime"].substr(10,2) +
|
|
98
|
") </span>" +
|
|
99
|
"</p>" +
|
|
100
|
"<p class='rebackcon'> " + data[i]["consultContant"] +" </p>" +
|
|
101
|
"</div>" +
|
|
102
|
"<div class='workhandle'>" +
|
|
103
|
"<div class='rightopert floatR'>" +
|
|
104
|
"<span class='replybtn' id='"+ data[i]["consultId"]+ "'>" +text +"</span>" +
|
|
105
|
"<span class='moreopert'>...</span>" +
|
|
106
|
"<ul class='moreopertbtn'>" +
|
|
107
|
"<li>投诉</li>" +
|
|
108
|
"</ul>" +
|
|
109
|
"</div>" +
|
|
110
|
"<div class='leftstate floatR'>" +
|
|
111
|
"<span class='coultstate'>咨询状态:<i class='coultState'>" +data[i]["consultStatus"]+" </i>评价状态:<i class='assessStatus'> "+data[i]["assessStatus"]+" </i>感谢状态<i class='thanksStatus' >:"+data[i]["thanksStatus"]+"</i></span>" +
|
|
112
|
"</div>" +
|
|
113
|
"</div>" +
|
|
114
|
"</td>" +
|
|
115
|
"</tr></tbody></table>" +
|
|
116
|
"</div>";
|
|
117
|
|
|
118
|
};
|
65
|
119
|
|
|
120
|
return htmlStr
|
|
121
|
};
|
66
|
122
|
|
|
123
|
//咨询点击回复,对话页字符串拼接函数
|
|
124
|
//data:要处理的数据,htmlStr:需要拼接到页面的元素,position
|
|
125
|
function dialogContentStrFn(data){
|
|
126
|
var htmlStr ="";
|
|
127
|
var dialogitem,float,dilinfobox,dilarrow,dilarrow_bor;
|
|
128
|
for(var i = 0; i < data.length;i++){
|
|
129
|
if(data[i]["professor"]["id"] == userid){
|
|
130
|
dialogitem = "dialogrightitem";
|
|
131
|
float = "floatR";
|
|
132
|
dilinfobox = "dilinfobox_r";
|
|
133
|
dilarrow = "dilarrow_r";
|
|
134
|
dilarrow_bor="dilarrow_r_bor";
|
|
135
|
}
|
|
136
|
else{
|
|
137
|
dialogitem = "dialogleftitem";
|
|
138
|
float = "floatL";
|
|
139
|
dilarrow = "dilarrow_l";
|
|
140
|
dilinfobox = "dilinfobox_l";
|
|
141
|
dilarrow_bor="dilarrow_l_bor";
|
|
142
|
}
|
|
143
|
htmlStr +=
|
|
144
|
"<div class='"+dialogitem+"'>" +
|
|
145
|
"<div class='dilmod'>" +
|
|
146
|
"<div class='diluser "+float+"'>" +
|
|
147
|
"<a href='' target='_blank' class='userface'>" +
|
|
148
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
|
149
|
"</a>" +
|
|
150
|
"</div>" +
|
|
151
|
"<div class='dilinfobox "+ dilinfobox+" "+ float +"'>" +
|
|
152
|
"<div class='delinfocon clearfix'>" +
|
|
153
|
"<div class='dilarrow "+ dilarrow+"'></div>" +
|
|
154
|
"<div class='dilarrow "+dilarrow_bor+"'></div>" +
|
|
155
|
"<div class='delinfomain "+float+"'>" +
|
|
156
|
"<div class='cont'>" +
|
|
157
|
"<p>"+data[i]["tidingsContant"]+"</p>" +
|
|
158
|
"</div>" +
|
|
159
|
"</div>" +
|
|
160
|
"</div>" + //dilinfobox
|
|
161
|
"</div>" + //dilinfobox
|
|
162
|
"</div>" + //dilmod
|
|
163
|
"</div>" + //dialogrightitem
|
|
164
|
"</div> "
|
|
165
|
};
|
|
166
|
|
|
167
|
return htmlStr;
|
|
168
|
};
|
67
|
169
|
|
68
|
|
$(document).ready(function(){
|
|
170
|
//点击星星函数
|
|
171
|
/*var starStart;
|
|
172
|
function clickStar(selector){
|
|
173
|
$(selector+" .evastar2").removeClass('addStar');
|
|
174
|
starStart=$(this).index()+1;
|
|
175
|
for(var i=0;i<starStart;i++){
|
|
176
|
if(i<starStart){
|
|
177
|
$(".evastar2").eq(i).addClass("addStar");
|
|
178
|
}
|
|
179
|
else{
|
|
180
|
$(".evastar2").eq(i).removeClass('addStar');
|
|
181
|
}
|
|
182
|
}
|
|
183
|
$("#startCount").val($(".addStar").length);
|
|
184
|
};*/
|
|
185
|
|
|
186
|
|
|
187
|
|
|
188
|
|
|
189
|
//点击:正序倒叙函数:只改变了样式
|
|
190
|
var sortFlag2 = true;
|
|
191
|
function clickSortFn(){alert("sort");
|
69
|
192
|
|
70
|
|
//登陆人id
|
71
|
|
var userid = $.cookie("userid");
|
|
193
|
if(sortFlag2 == true){
|
|
194
|
$(this).find("div").css("background-position","-20px 1px");
|
|
195
|
$("#timeSortId2").val("1");
|
|
196
|
|
|
197
|
sortFlag2 =false;
|
|
198
|
|
|
199
|
}else{
|
|
200
|
$(this).find("div").css("background-position","0px 1px");
|
|
201
|
$("#timeSortId2").val("0");
|
|
202
|
|
|
203
|
sortFlag2=true;
|
|
204
|
};
|
|
205
|
};
|
|
206
|
|
|
207
|
|
|
208
|
|
|
209
|
|
|
210
|
$(document).ready(function(){
|
72
|
211
|
|
73
|
212
|
|
74
|
213
|
//用于收到咨询传值
|
|
@ -96,14 +235,11 @@ $(document).ready(function(){
|
96
|
235
|
// console.log(response)
|
97
|
236
|
},
|
98
|
237
|
"success":function(consultResponse){
|
99
|
|
console.log(consultResponse);
|
100
|
|
|
|
238
|
// console.log(consultResponse);
|
101
|
239
|
//如果没有咨询数据 隐藏收到咨询
|
102
|
240
|
if(consultResponse["data"]["total"] == 0){
|
103
|
241
|
// alert("未收到咨询");
|
104
|
|
/*$(".worksamlltit3:first").hide();
|
105
|
|
$(".workmysrc3:first").hide();
|
106
|
|
$(".workmysrc3:last").fadeIn();*/
|
|
242
|
|
107
|
243
|
//ajax页面
|
108
|
244
|
$.ajax({
|
109
|
245
|
"url":"consult.html",
|
|
@ -117,10 +253,12 @@ $(document).ready(function(){
|
117
|
253
|
$(".worksamlltit3:first").hide();
|
118
|
254
|
$(".workmysrc3:first").hide();
|
119
|
255
|
$(".workmysrc3:last").fadeIn();
|
|
256
|
var replyTrHtml;
|
120
|
257
|
|
121
|
258
|
//======================================没有咨询情况下 ajax请求收到回复======================
|
122
|
259
|
$.ajax({
|
123
|
260
|
"url":"/ajax/consult/pqcon",//收到回复接口
|
|
261
|
"type":"get",
|
124
|
262
|
"data":consultIdStrByReply,
|
125
|
263
|
"dataType" : "json",
|
126
|
264
|
"beforeSend":function(response){
|
|
@ -131,55 +269,10 @@ $(document).ready(function(){
|
131
|
269
|
|
132
|
270
|
var allData = replyResponse.data;
|
133
|
271
|
var replyData = allData["data"];
|
134
|
|
var replyTrHtml = '';
|
|
272
|
|
135
|
273
|
if(replyData.length != 0 && replyData.length != null){
|
136
|
|
|
137
|
|
for(var i = 0; i < replyData.length;i++){
|
138
|
|
replyTrHtml +=
|
139
|
|
"<div class='workselectitem' id=' " + replyData[i]["consultId"] +" ' >" +
|
140
|
|
"<table width='100%'>" +
|
141
|
|
"<tbody><tr>" +
|
142
|
|
"<td width='14%' class='messagebox'>" +
|
143
|
|
"<a class='workhead workitimg' href='information.html'>" +
|
144
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
145
|
|
"</a>" +
|
146
|
|
"<span class='msgprompt'>1</span>" +
|
147
|
|
"</td>" +
|
148
|
|
"<td style='position:relative;' width='86%'>" +
|
149
|
|
"<div class='workinfor worksitcon'>" +
|
150
|
|
"<h4><a href='' class='named' id='nameS'> " + replyData[i]["consultId"] +" </a><img class='modifyicon' src='images/rz.png' width='30'></h4>" +
|
151
|
|
"<h6><span>职称 " + replyData[i]["consultId"] +" </span>,<span>职位 " + replyData[i]["consultId"] +" </span>,<span> " + replyData["consultId"] +" </span>,<span> " + replyData["consultId"] +" </span> | <span> " + replyData["consultId"] +" </span></h6>" +
|
152
|
|
"<h6>"+
|
153
|
|
"<span>咨询主题:<em> " + replyData[i]["consultTitle"] +" </em></span>" +
|
154
|
|
" " +
|
155
|
|
"<span>咨询类型:<em> " + replyData[i]["consultType"] +" </em></span>" +
|
156
|
|
" <span>" +
|
157
|
|
"咨询发起时间:<em> " + replyData[i]["createTime"] +" </em>" +
|
158
|
|
"</span></h6>" +
|
159
|
|
"<p>最后回复<span class='lasttime'> ( " + replyData[i]["revoveryTime"] +" ) </span>:" +
|
160
|
|
"</p>" +
|
161
|
|
"<p class='rebackcon'> " + replyData[i]["consultContant"] +" </p>" +
|
162
|
|
"</div>" +
|
163
|
|
"<div class='workhandle'>" +
|
164
|
|
"<div class='rightopert floatR'>" +
|
165
|
|
"<span class='replybtn' id=' "+ replyData[i]["professorId"]+ " '> " + replyData[i]["consultStatus"] +" </span>" +
|
166
|
|
"<span class='moreopert'>...</span>" +
|
167
|
|
"<ul class='moreopertbtn'>" +
|
168
|
|
"<li>投诉</li>" +
|
169
|
|
"</ul>" +
|
170
|
|
"</div>" +
|
171
|
|
"<div class='leftstate floatR'>" +
|
172
|
|
"<span class='coultstate'><i> " + replyData[i]["consultStatus"] +" </i><em></em></span>" +
|
173
|
|
"</div>" +
|
174
|
|
"</div>" +
|
175
|
|
"</td>" +
|
176
|
|
"</tr></tbody></table>" +
|
177
|
|
"</div>";
|
178
|
|
|
179
|
|
};
|
180
|
|
// console.log(replyTrHtml);
|
|
274
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看");
|
181
|
275
|
$(".tcdPageCode:last").before(replyTrHtml);
|
182
|
|
// $("#workContainer2").append(replyTrHtml);
|
183
|
276
|
}else{
|
184
|
277
|
return false;
|
185
|
278
|
}
|
|
@ -195,9 +288,8 @@ $(document).ready(function(){
|
195
|
288
|
|
196
|
289
|
//==========================================只有收到回复时,下拉菜单改变 ajax开始==================
|
197
|
290
|
|
198
|
|
//
|
199
|
|
//排列顺序(正序、倒序)
|
200
|
|
var sortFlag2 = true;//正倒排序标记
|
|
291
|
//点击正序倒序
|
|
292
|
var sortFlag2 = true;
|
201
|
293
|
$("#replyArrow").click(function(){
|
202
|
294
|
if(sortFlag2 == true){
|
203
|
295
|
$(this).find("div").css("background-position","-20px 1px");
|
|
@ -213,6 +305,8 @@ $(document).ready(function(){
|
213
|
305
|
}
|
214
|
306
|
|
215
|
307
|
});
|
|
308
|
|
|
309
|
// $("#replyArrow").on("clcik",clickSortFn);
|
216
|
310
|
|
217
|
311
|
var timeType2,sortType2,replyStatus,consultId;
|
218
|
312
|
|
|
@ -233,9 +327,8 @@ $(document).ready(function(){
|
233
|
327
|
//改变后,要传的值
|
234
|
328
|
replyStatus = $("#replySelectId").val();//咨询状态值
|
235
|
329
|
timeType2 = $("#timeTypeId2").val();//时间类型值
|
236
|
|
sortType2 = $("#timeSortId2").val();//排序值;
|
237
|
|
|
238
|
|
//要传的值:
|
|
330
|
sortType2 = $("#timeSortId2").val();//排序值;
|
|
331
|
|
239
|
332
|
replyInfo = {
|
240
|
333
|
"consultantId":userid,
|
241
|
334
|
"status":replyStatus,
|
|
@ -247,62 +340,18 @@ $(document).ready(function(){
|
247
|
340
|
//=====================================只有收到回复时 更新下拉菜单==============
|
248
|
341
|
$.ajax({
|
249
|
342
|
"url":"/ajax/consult/pqcon",//更新下拉菜单接口
|
|
343
|
"type":"get",
|
250
|
344
|
"data":replyInfo,
|
251
|
345
|
"beforeSend":function(response){
|
252
|
346
|
console.log(response);
|
253
|
347
|
},
|
254
|
348
|
"success":function(response){
|
255
|
349
|
$("#workContainer2 .workselectitem").remove();
|
256
|
|
// $(".tcdPageCode:first").before().empty();
|
257
|
|
replyTrHtml = '';
|
258
|
|
console.log(response);
|
259
|
350
|
var allData = response.data;
|
260
|
351
|
var replyData = allData["data"];
|
261
|
|
|
262
|
|
for(var i = 0 ; i < replyData.length;i++){
|
263
|
|
replyTrHtml +=
|
264
|
|
"<div class='workselectitem' id=' " + replyData[i]["consultId"] +" ' >" +
|
265
|
|
"<table width='100%'>" +
|
266
|
|
"<tbody><tr>" +
|
267
|
|
"<td width='14%' class='messagebox'>" +
|
268
|
|
"<a class='workhead workitimg' href='information.html'>" +
|
269
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
270
|
|
"</a>" +
|
271
|
|
"<span class='msgprompt'>1</span>" +
|
272
|
|
"</td>" +
|
273
|
|
"<td style='position:relative;' width='86%'>" +
|
274
|
|
"<div class='workinfor worksitcon'>" +
|
275
|
|
"<h4><a href='' class='named' id='nameS'> " + replyData[i]["consultId"] +" </a><img class='modifyicon' src='images/rz.png' width='30'></h4>" +
|
276
|
|
"<h6><span>职称 " + replyData[i]["professor"]["title"] +" </span>,<span>职位 " + replyData[i]["professor"] +" </span>,<span> " + replyData["consultId"] +" </span>,<span> " + replyData["consultId"] +" </span> | <span> " + replyData["consultId"] +" </span></h6>" +
|
277
|
|
"<h6>"+
|
278
|
|
"<span>咨询主题:<em> " + replyData[i]["consultTitle"] +" </em></span>" +
|
279
|
|
" " +
|
280
|
|
"<span>咨询类型:<em> " + replyData[i]["consultType"] +" </em></span>" +
|
281
|
|
" <span>" +
|
282
|
|
"咨询发起时间:<em> " + replyData[i]["createTime"] +" </em>" +
|
283
|
|
"</span></h6>" +
|
284
|
|
"<p>最后回复<span class='lasttime'> ( " + replyData[i]["revoveryTime"] +" ) </span>:" +
|
285
|
|
"</p>" +
|
286
|
|
"<p class='rebackcon'> " + replyData[i]["consultContant"] +" </p>" +
|
287
|
|
"</div>" +
|
288
|
|
"<div class='workhandle'>" +
|
289
|
|
"<div class='rightopert floatR'>" +
|
290
|
|
"<span class='replybtn' id=' " + replyData[i]['consultId'] + " '> " + replyData[i]["consultStatus"] +" </span>" +
|
291
|
|
"<span class='moreopert'>...</span>" +
|
292
|
|
"<ul class='moreopertbtn'>" +
|
293
|
|
"<li>投诉</li>" +
|
294
|
|
"</ul>" +
|
295
|
|
"</div>" +
|
296
|
|
"<div class='leftstate floatR'>" +
|
297
|
|
"<span class='coultstate'><i> " + replyData[i]["consultStatus"] +" </i><em></em></span>" +
|
298
|
|
"</div>" +
|
299
|
|
"</div>" +
|
300
|
|
"</td>" +
|
301
|
|
"</tr></tbody></table>" +
|
302
|
|
"</div>";
|
303
|
|
};
|
304
|
|
// console.log(replyTrHtml);
|
305
|
|
$(".tcdPageCode:last").before(replyTrHtml);
|
|
352
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看");
|
|
353
|
console.log(replyTrHtml);
|
|
354
|
$(".tcdPageCode:last").before(replyTrHtml);
|
306
|
355
|
|
307
|
356
|
},
|
308
|
357
|
"error":function(response){
|
|
@ -310,9 +359,7 @@ $(document).ready(function(){
|
310
|
359
|
//更新下拉菜单失败
|
311
|
360
|
}
|
312
|
361
|
|
313
|
|
});
|
314
|
|
|
315
|
|
|
|
362
|
});
|
316
|
363
|
};//更新下拉菜单处理函数结束
|
317
|
364
|
|
318
|
365
|
//绑定回复状态事件
|
|
@ -344,69 +391,11 @@ $(document).ready(function(){
|
344
|
391
|
|
345
|
392
|
//ajax 收到咨询数据和收到回复数据
|
346
|
393
|
//ajax收到咨询 consultResponse 收到咨询返回值
|
|
394
|
var consultTrHtml;
|
347
|
395
|
var allData = consultResponse.data;
|
348
|
396
|
var consultData = allData["data"];
|
349
|
|
var consultTrHtml = '';
|
350
|
|
|
351
|
|
for(var i = 0; i < consultData.length;i++){
|
352
|
|
|
353
|
|
|
354
|
|
/*if(consultData[i]["assessStatus"] == 1){
|
355
|
|
consultData[i]["assessStatus"] = "进行中";
|
356
|
|
}else{
|
357
|
|
consultData[i]["assessStatus"] = "待付款/待评价/已完成";
|
358
|
|
}*/
|
359
|
|
|
360
|
|
|
361
|
|
//咨询信息页面渲染
|
362
|
|
consultTrHtml +=
|
363
|
|
"<div class='workselectitem' id=' " + consultData[i]["consultId"] +" ' >" +
|
364
|
|
"<table width='100%'>" +
|
365
|
|
"<tbody><tr>" +
|
366
|
|
"<td width='14%' class='messagebox'>" +
|
367
|
|
"<a class='workhead workitimg' href='information.html'>" +
|
368
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
369
|
|
"</a>" +
|
370
|
|
"<span class='msgprompt'>1</span>" +
|
371
|
|
"</td>" +
|
372
|
|
"<td style='position:relative;' width='86%'>" +
|
373
|
|
"<div class='workinfor worksitcon'>" +
|
374
|
|
"<h4><a href='' class='named' id='nameS'> " + consultData[i]["consultId"] +" </a><img class='modifyicon' src='images/rz.png' width='30'></h4>" +
|
375
|
|
"<h6><span>职称 " + consultData[i]["consultId"] +" </span>,<span>职位 " + consultData[i]["consultId"] +" </span>,<span> " + consultData["consultId"] +" </span>,<span> " + consultData["consultId"] +" </span> | <span> " + consultData["consultId"] +" </span></h6>" +
|
376
|
|
"<h6>"+
|
377
|
|
"<span>咨询主题:<em> " + consultData[i]["consultTitle"] +" </em></span>" +
|
378
|
|
" " +
|
379
|
|
"<span>咨询类型:<em> " + consultData[i]["consultType"] +" </em></span>" +
|
380
|
|
" <span>" +
|
381
|
|
"咨询发起时间:<em> " +
|
382
|
|
consultData[i]["createTime"].substr(0,4) + "-" + consultData[i]["createTime"].substr(4,2) + "-" + consultData[i]["createTime"].substr(6,2) + " " + consultData[i]["createTime"].substr(8,2)+ ":" +consultData[i]["createTime"].substr(10,2)+
|
383
|
|
"</em>" +
|
384
|
|
"</span></h6>" +
|
385
|
|
"<p>最后回复<span class='lasttime'> ( " +
|
386
|
|
consultData[i]["revoveryTime"].substr(0,4) + "-" + consultData[i]["revoveryTime"].substr(4,2) + "-" + consultData[i]["revoveryTime"].substr(6,2) + " " + consultData[i]["revoveryTime"].substr(8,2)+ ":" +consultData[i]["revoveryTime"].substr(10,2) +
|
387
|
|
") </span>:" +
|
388
|
|
"</p>" +
|
389
|
|
"<p class='rebackcon'> " + consultData[i]["consultContant"] +" </p>" +
|
390
|
|
"</div>" +
|
391
|
|
"<div class='workhandle'>" +
|
392
|
|
"<div class='rightopert floatR'>" +
|
393
|
|
"<span class='replybtn' id='" + consultData[i]["consultId"] + " '> " + consultData[i]["consultStatus"] +" </span>" +
|
394
|
|
"<span class='moreopert'>...</span>" +
|
395
|
|
"<ul class='moreopertbtn'>" +
|
396
|
|
"<li>投诉</li>" +
|
397
|
|
"</ul>" +
|
398
|
|
"</div>" +
|
399
|
|
"<div class='leftstate floatR'>" +
|
400
|
|
"<span class='coultstate'><i> " + consultData[i]["consultStatus"] +" </i><em></em></span>" +
|
401
|
|
"</div>" +
|
402
|
|
"</div>" +
|
403
|
|
"</td>" +
|
404
|
|
"</tr></tbody></table>" +
|
405
|
|
"</div>";
|
406
|
|
|
407
|
|
|
408
|
|
};
|
409
|
|
|
|
397
|
// console.log(consultData.length);
|
|
398
|
consultTrHtml = handleData(consultData,consultTrHtml,"professorId","回复");
|
410
|
399
|
$(".tcdPageCode:first").before(consultTrHtml);
|
411
|
400
|
|
412
|
401
|
|
|
@ -443,17 +432,15 @@ $(document).ready(function(){
|
443
|
432
|
"timeType":timeType,
|
444
|
433
|
"sortType":sortType
|
445
|
434
|
};
|
446
|
|
console.log("默认值:"+consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.professorId);
|
|
435
|
// console.log("默认值:"+consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.professorId);
|
447
|
436
|
|
448
|
|
//收到咨询信息接口
|
|
437
|
//收到咨询信息改变下拉菜单
|
449
|
438
|
function consultStatusFn(){
|
450
|
439
|
//改变后,要传的值
|
451
|
440
|
consultStatus = $("#consultSelectId").val();//咨询状态值
|
452
|
441
|
timeType = $("#timeTypeId").val();//时间类型值
|
453
|
442
|
sortType = $("#timeSortId").val();//排序值;
|
454
|
443
|
|
455
|
|
// consultTrHtml = '';
|
456
|
|
|
457
|
444
|
//要传的值:
|
458
|
445
|
consultInfo = {
|
459
|
446
|
"professorId":userid,
|
|
@ -463,73 +450,25 @@ $(document).ready(function(){
|
463
|
450
|
|
464
|
451
|
};
|
465
|
452
|
|
466
|
|
console.log("ajax中的值:"+ consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.consultantId);
|
|
453
|
// console.log("ajax中的值:"+ consultInfo.status + consultInfo.timeType + consultInfo.sortType + consultInfo.consultantId);
|
467
|
454
|
|
468
|
455
|
//更新下拉菜单
|
469
|
456
|
$.ajax({
|
470
|
457
|
"url":"/ajax/consult/pqpro",//更新下拉菜单接口
|
471
|
|
// /ajax/consult/pqpro
|
472
|
458
|
"data":consultInfo,
|
473
|
|
|
|
459
|
"type":"get",
|
474
|
460
|
"beforeSend":function(response){
|
475
|
|
console.log(response);
|
|
461
|
// console.log(response);
|
476
|
462
|
},
|
477
|
463
|
"success":function(response){
|
478
|
464
|
$("#workContainer .workselectitem").remove();
|
479
|
465
|
// $(".tcdPageCode:first").before().empty();
|
480
|
|
consultTrHtml = '';
|
481
|
|
console.log(response);
|
482
|
466
|
var allData = response.data;
|
483
|
467
|
var consultData = allData["data"];
|
|
468
|
console.log(consultData.length);
|
|
469
|
consultTrHtml = handleData(consultData,consultTrHtml,"professorId","回复");
|
|
470
|
$(".tcdPageCode:first").before(consultTrHtml);
|
484
|
471
|
|
485
|
|
for(var i = 0 ; i < consultData.length;i++){
|
486
|
|
consultTrHtml +=
|
487
|
|
"<div class='workselectitem' id=' " + consultData[i]["consultId"] +" ' >" +
|
488
|
|
"<table width='100%'>" +
|
489
|
|
"<tbody><tr>" +
|
490
|
|
"<td width='14%' class='messagebox'>" +
|
491
|
|
"<a class='workhead workitimg' href='information.html'>" +
|
492
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
493
|
|
"</a>" +
|
494
|
|
"<span class='msgprompt'>1</span>" +
|
495
|
|
"</td>" +
|
496
|
|
"<td style='position:relative;' width='86%'>" +
|
497
|
|
"<div class='workinfor worksitcon'>" +
|
498
|
|
"<h4><a href='' class='named' id='nameS'> " + consultData[i]["consultId"] +" </a><img class='modifyicon' src='images/rz.png' width='30'></h4>" +
|
499
|
|
"<h6><span>职称 " + consultData[i]["professor"]["title"] +" </span>,<span>职位 " + consultData[i]["professor"] +" </span>,<span> " + consultData["consultId"] +" </span>,<span> " + consultData["consultId"] +" </span> | <span> " + consultData["consultId"] +" </span></h6>" +
|
500
|
|
"<h6>"+
|
501
|
|
"<span>咨询主题:<em> " + consultData[i]["consultTitle"] +" </em></span>" +
|
502
|
|
" " +
|
503
|
|
"<span>咨询类型:<em> " + consultData[i]["consultType"] +" </em></span>" +
|
504
|
|
" <span>" +
|
505
|
|
"咨询发起时间:<em> " + consultData[i]["createTime"] +" </em>" +
|
506
|
|
"</span></h6>" +
|
507
|
|
"<p>最后回复<span class='lasttime'> ( " + consultData[i]["revoveryTime"] +" ) </span>:" +
|
508
|
|
"</p>" +
|
509
|
|
"<p class='rebackcon'> " + consultData[i]["consultContant"] +" </p>" +
|
510
|
|
"</div>" +
|
511
|
|
"<div class='workhandle'>" +
|
512
|
|
"<div class='rightopert floatR'>" +
|
513
|
|
"<span class='replybtn' id=' " + consultData[i]['consultId'] + " '> " + consultData[i]["consultStatus"] +" </span>" +
|
514
|
|
"<span class='moreopert'>...</span>" +
|
515
|
|
"<ul class='moreopertbtn'>" +
|
516
|
|
"<li>投诉</li>" +
|
517
|
|
"</ul>" +
|
518
|
|
"</div>" +
|
519
|
|
"<div class='leftstate floatR'>" +
|
520
|
|
"<span class='coultstate'><i> " + consultData[i]["consultStatus"] +" </i><em></em></span>" +
|
521
|
|
"</div>" +
|
522
|
|
"</div>" +
|
523
|
|
"</td>" +
|
524
|
|
"</tr></tbody></table>" +
|
525
|
|
"</div>";
|
526
|
|
};
|
527
|
|
// console.log(consultTrHtml);
|
528
|
|
$(".tcdPageCode:first").before(consultTrHtml);
|
529
|
|
// $("#workContainer").append(consultTrHtml);
|
530
|
|
|
531
|
|
//
|
532
|
|
|
533
|
472
|
},
|
534
|
473
|
"error":function(response){
|
535
|
474
|
// console.log(response)
|
|
@ -549,128 +488,26 @@ $(document).ready(function(){
|
549
|
488
|
|
550
|
489
|
$(".orderedbtn").bind("click",consultStatusFn);
|
551
|
490
|
|
552
|
|
//点击收到咨询中回复
|
553
|
|
/*function ClickReplyBtn(id){
|
554
|
|
this.id = id;
|
555
|
|
};
|
556
|
491
|
|
557
|
|
ClickReplyBtn.prototype = {
|
558
|
|
init:function(){
|
559
|
|
|
560
|
|
},
|
561
|
|
getDialogData:function(url,type,params,successGetDialogFn,errorMsg){
|
562
|
|
$.ajax({
|
563
|
|
"url":url,
|
564
|
|
"type" : type,
|
565
|
|
"data" :params,
|
566
|
|
"success":successGetDialogFn,
|
567
|
|
"error":function(){
|
568
|
|
$.MsgBox.Alert(errorMsg);
|
569
|
|
}
|
570
|
|
});
|
571
|
|
},
|
572
|
|
|
573
|
|
};*/
|
574
|
492
|
|
575
|
|
var dialog = '';
|
576
|
|
function successGetDialogFn(){
|
577
|
|
|
578
|
|
dialog +=
|
579
|
|
"<div class='consultdialogbox'>" +
|
580
|
|
"<div class='consultdialog'>" +
|
581
|
|
"<div class='dialoghead'>" +
|
582
|
|
"<div class='backupbtn'></div>" +
|
583
|
|
"<div class='dheadtit'>" +
|
584
|
|
"与<span class='dialogpro' id='dial_consultName'>程学群</span>对话中" +
|
585
|
|
"</div>" +
|
586
|
|
"</div>" +
|
587
|
|
"<div class='dialogcontain'>" +
|
588
|
|
"<div class='dialoginfo'>" +
|
589
|
|
"<div>" +
|
590
|
|
"<span class='dialogtit'>咨询主题:</span><span id='dial_consultTitle'>XXXXXXXXXXXXXXXXXXXXXX</span>" +
|
591
|
|
"</div>" +
|
592
|
|
"<div><span class='dialogtit'>咨询类型:</span><span id='dial_consultType'>技术咨询</span></div>" +
|
593
|
|
"<div class='dialogsurebtn'><span id='dial_confirmFinishConsult'>点击确认完成咨询</span></div>" +
|
594
|
|
"</div>" +
|
595
|
|
"<div class='dialogstatus'><em></em><span id='dil_consultStatus'>进行中</span></div>" +
|
596
|
|
"</div>" +
|
597
|
|
"<div class='dialogbody clearfix'>" +
|
598
|
|
"<div class='dialogleftitem'>" +
|
599
|
|
"<div class='dilmod'>" +
|
600
|
|
"<div class='diluser floatL'>" +
|
601
|
|
"<a href='' target='_blank' class='userface'>" +
|
602
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
603
|
|
"</a>" +
|
604
|
|
"</div>" +
|
605
|
|
"<div class='dilinfobox dilinfobox_l floatL'>" +
|
606
|
|
"<div class='dilarrow dilarrow_l'></div>" +
|
607
|
|
"<div class='dilarrow dilarrow_l_bor'></div>" +
|
608
|
|
"<div class='delinfocon clearfix'>" +
|
609
|
|
"<div class='delinfomain floatL'>" +
|
610
|
|
"<div class='cont'>" +
|
611
|
|
"<p>800009jhujgkkkkkkkkkkkkkhhghhu</p>" +
|
612
|
|
"</div>" +
|
613
|
|
"</div>" +
|
614
|
|
"</div>" +
|
615
|
|
"</div>" +
|
616
|
|
"</div>" +
|
617
|
|
"</div>" +
|
618
|
|
"<div class='dialogrightitem'>" +
|
619
|
|
"<div class='dilmod'>" +
|
620
|
|
"<div class='diluser floatR'>" +
|
621
|
|
"<a href='' target='_blank' class='userface'>" +
|
622
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
623
|
|
"</a>" +
|
624
|
|
"</div>" +
|
625
|
|
"<div class='dilinfobox dilinfobox_r floatR'>" +
|
626
|
|
"<div class='delinfocon clearfix'>" +
|
627
|
|
"<div class='dilarrow dilarrow_r'></div>" +
|
628
|
|
"<div class='dilarrow dilarrow_r_bor'></div>" +
|
629
|
|
"<div class='delinfomain floatR'>" +
|
630
|
|
"<div class='cont'>" +
|
631
|
|
"<p>我们国内钾肥i哦警方i哦济公活佛极度恐慌赶快回家就看不见哦go客观艰苦地方购房抵of更何况vjklvkbn</p>" +
|
632
|
|
"</div>" +
|
633
|
|
"</div>" +
|
634
|
|
"</div>" + //dilinfobox
|
635
|
|
"</div>" + //dilinfobox
|
636
|
|
"</div>" + //dilmod
|
637
|
|
"</div>" + //dialogrightitem
|
638
|
|
"</div> " + //dialogbody
|
639
|
|
|
640
|
|
"<div class='dialogfoot'>" +
|
641
|
|
"<div class='sendbox_area'>" +
|
642
|
|
"<textarea name='' cols='' rows='' class='frmtype W_input' node-type='textEl' range='0&0'></textarea>" +
|
643
|
|
"</div>" +
|
644
|
|
"<div class='sendbox_bar'>" +
|
645
|
|
"<div class='sendtype floatL'>" +
|
646
|
|
"<a href='javascript:void(0);' class='mlink1'></a>" +
|
647
|
|
"<a href='javascript:void(0);' class='mlink2'></a>" +
|
648
|
|
"<a href='javascript:void(0);' class='mlink3'></a>" +
|
649
|
|
"</div>" +
|
650
|
|
"<div class='sendbtn floatR'>" +
|
651
|
|
"<a href='javascript:void(0);' class='W_btn' node-type='submit' action-type='submit' action-data=''>发送</a>" +
|
652
|
|
"</div>" + //sendbtn
|
653
|
|
"</div>" + //sendbox_bar
|
654
|
|
"</div>" + //dialogfoot
|
655
|
|
"</div>" + // consultdialog
|
656
|
|
"</div>"; //consultdialogbox
|
657
|
|
|
658
|
|
|
659
|
|
|
660
|
|
};
|
661
|
|
|
662
|
|
|
663
|
|
|
664
|
|
|
665
|
|
|
666
|
|
|
667
|
|
|
668
|
|
|
669
|
|
function clickReplyFn(){alert("di");
|
670
|
|
alert($(this).attr("id"));
|
|
493
|
//============================================点击咨询页面中回复按钮=====================
|
|
494
|
function clickReplyFn(){
|
|
495
|
var consultId = $.trim($(this).attr("id"));//咨询id
|
|
496
|
var assessStatus = $.trim($(this).find(".coultState").text());//评价状态 0-未评价,1-已评价
|
|
497
|
var consultStatus = $.trim($(this).find(".assessStatus").text());//咨询状态 0-进行中,1-已完成
|
|
498
|
var thanksStatus = $.trim($(this).find(".thanksStatus").text());//感谢状态 0-未感谢,1-已感谢
|
|
499
|
var assessStar = $.trim($(this).find(".assessStar").val());//星级,几颗星 用隐藏域做
|
|
500
|
//点击确认完成的传值:consultId,咨询状态
|
|
501
|
var confirmFinishStr = {
|
|
502
|
"consultId":consultId,
|
|
503
|
"consultStatus":consultStatus
|
|
504
|
};
|
|
505
|
//对话标题 传值,
|
671
|
506
|
var consultIdStr = {
|
672
|
|
"consultId":$(this).attr("id")
|
|
507
|
"consultId":consultId
|
673
|
508
|
}
|
|
509
|
|
|
510
|
|
674
|
511
|
//ajax加载对话页面
|
675
|
512
|
$.ajax({
|
676
|
513
|
"url":"diloags.html",
|
|
@ -680,33 +517,264 @@ $(document).ready(function(){
|
680
|
517
|
$(this).attr("id");
|
681
|
518
|
$(".workcon").html(result);
|
682
|
519
|
|
683
|
|
|
684
|
|
$.ajax({
|
685
|
|
"url":"/ajax/consult/qapro",
|
686
|
|
"data":consultIdStr,
|
687
|
|
"success":function(response){
|
688
|
|
console.log(response);
|
689
|
|
},
|
690
|
|
"error":function(error){
|
691
|
|
//点击咨询页回复获取数据失败
|
692
|
|
},
|
|
520
|
//===========================================dialog数据==================
|
|
521
|
//=========对话头部
|
|
522
|
//对话头部数据渲染
|
|
523
|
function dialogHeadDataHandleFn(){
|
|
524
|
//星星评级
|
|
525
|
var starStart;
|
|
526
|
function clickStar(){
|
|
527
|
$(".evastar2").removeClass('addStar');
|
|
528
|
starStart=$(this).index()+1;
|
|
529
|
for(var i=0;i<starStart;i++){
|
|
530
|
if(i<starStart){
|
|
531
|
$(".evastar2").eq(i).addClass("addStar");
|
|
532
|
}
|
|
533
|
else{
|
|
534
|
$(".evastar2").eq(i).removeClass('addStar');
|
|
535
|
}
|
|
536
|
}
|
|
537
|
$("#startCount").val($(".addStar").length);
|
|
538
|
};
|
|
539
|
|
|
540
|
// console.log(consultIdStr);
|
|
541
|
$.ajax({
|
|
542
|
"url":"/ajax/consult/qapro",//从收到咨询点击回复接口
|
|
543
|
"type":"get",
|
|
544
|
"data":consultIdStr,
|
|
545
|
"success":function(response){
|
|
546
|
console.log("点击回复返回数据");
|
|
547
|
console.log(response)
|
|
548
|
var consultantData = response["data"];
|
|
549
|
//对话框标题信息
|
|
550
|
//进行中,
|
|
551
|
if(consultantData["consultStatus"] == "0"){
|
|
552
|
consultantData["consultStatus"] = "进行中";
|
|
553
|
$(".dialogsurebtn").css("display","block");//确认完成按钮显示
|
|
554
|
$("#showAllAssess").css("display","none");//总体评价
|
|
555
|
$(".dialogfoot").css("display","block");//显示发送对话部分
|
|
556
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
|
557
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
|
558
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
|
559
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
|
560
|
|
|
561
|
}
|
|
562
|
//已完成
|
|
563
|
if(consultantData["consultStatus"] == "1" || consultantData["consultStatus"] == "2" ||consultantData["consultStatus"] == "3" || consultantData["consultStatus"] == "4"){
|
|
564
|
consultantData["consultStatus"] = "已完成";
|
|
565
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
|
566
|
//已完成,未感谢:
|
|
567
|
if(thanksStatus == "0"){
|
|
568
|
//未感谢,未评价
|
|
569
|
if(assessStatus == '0'){alert("未感谢,未评价");
|
|
570
|
$(".dialogsurebtn").css("display","none");//隐藏确认完成按钮
|
|
571
|
$("#showAllAssess").css("display","none");//隐藏评价
|
|
572
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
|
573
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
|
574
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
|
575
|
}
|
|
576
|
//未感谢,已评价
|
|
577
|
else{alert("未感谢,已评价");
|
|
578
|
$(".dialogsurebtn").css("display","none");//隐藏确认完成按钮
|
|
579
|
var starCount = $.trim($(this).find(".assessStar").val());
|
|
580
|
alert("aaa"+$.trim($(this).find(".assessStar").val()))
|
|
581
|
alert(starCount);
|
|
582
|
console.log("xing");
|
|
583
|
console.log(starCount);
|
|
584
|
for(var i=0;i<starCount;i++){
|
|
585
|
$("#showAllAssess .evastar2").eq(i).addClass("addStar");
|
|
586
|
}
|
|
587
|
// clickStar();
|
|
588
|
$("#showAllAssess").css("display","block");//显示星级
|
|
589
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
|
590
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
|
591
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
|
592
|
}
|
|
593
|
|
|
594
|
}
|
|
595
|
//已完成,已感谢:评价星级,感谢金额
|
|
596
|
else{alert("已完成,已感谢");
|
|
597
|
$(".dialogsurebtn").css("display","none");//隐藏确认完成按钮
|
|
598
|
$(".dialogfoot").css("display","none");//隐藏发送对话部分
|
|
599
|
$("#showAllAssess").css("display","block");//显示星级
|
|
600
|
|
|
601
|
// starStart = $.trim($(this).find(".assessStar").val());
|
|
602
|
// clickStar();
|
|
603
|
$("#dial_consultName").text(consultantData["professor"]["name"]);//与@@@对话
|
|
604
|
$("#dil_consultStatus").text(consultantData["consultStatus"]);//咨询状态
|
|
605
|
$("#dialog_consultTitle").text(consultantData["consultTitle"]);//咨询主题
|
|
606
|
$("#dialog_consultType").text(consultantData["consultType"]);//咨询类型
|
|
607
|
}
|
|
608
|
|
|
609
|
}
|
693
|
610
|
|
694
|
|
});
|
|
611
|
},
|
|
612
|
"error":function(error){
|
|
613
|
//对话框头部信息请求失败
|
|
614
|
}
|
|
615
|
});
|
|
616
|
|
|
617
|
};
|
|
618
|
|
|
619
|
dialogHeadDataHandleFn();
|
|
620
|
|
|
621
|
//============对话内容数据处理函数
|
|
622
|
function dialogContentDataHandle(){
|
|
623
|
$.ajax({
|
|
624
|
"url":"/ajax/tidings/qacon",//对话内容显示接口
|
|
625
|
"type":"get",
|
|
626
|
"data":consultIdStr,
|
|
627
|
"beforeSend":function(response){
|
|
628
|
//对话发送消息失败
|
|
629
|
//console.log(response);
|
|
630
|
},
|
|
631
|
"success":function(response){
|
|
632
|
console.log()
|
|
633
|
var dialogConData = response["data"];
|
|
634
|
console.log(dialogConData);
|
|
635
|
var dialogStr;
|
|
636
|
// dialogRightStr = dialogContentStrFn(dialogConData)["rightStr"];
|
|
637
|
// dialogLeftStr = dialogContentStrFn(dialogConData)["leftStr"];
|
|
638
|
// console.log(dialogRightStr);
|
|
639
|
dialogStr = dialogContentStrFn(dialogConData);
|
|
640
|
console.log(dialogStr);
|
|
641
|
$("#dialogContent").append(dialogStr);
|
|
642
|
// $("#dialogContent").append(dialogLeftStr);
|
|
643
|
},
|
|
644
|
"error":function(error){
|
|
645
|
//对话框内容信息请求失败
|
|
646
|
}
|
|
647
|
});
|
|
648
|
|
|
649
|
|
|
650
|
};
|
|
651
|
dialogContentDataHandle();
|
|
652
|
|
|
653
|
//=============================对话页面底部发送
|
|
654
|
//发送按钮处理函数
|
|
655
|
function sendDialogContentFn(){
|
|
656
|
var tidingsContant = $("#dialog_sendContent").val();
|
|
657
|
var tidingStr = {
|
|
658
|
"tidingsContant":tidingsContant,
|
|
659
|
"senderId":userid,
|
|
660
|
"consultId":consultId
|
|
661
|
};
|
|
662
|
//console.log(tidingStr);
|
|
663
|
$.ajax({
|
|
664
|
"url":"/ajax/tidings",
|
|
665
|
"type":"post",
|
|
666
|
"data":tidingStr,
|
|
667
|
"beforeSend":function(response){
|
|
668
|
//对话发送消息失败
|
|
669
|
console.log(response);
|
|
670
|
},
|
|
671
|
"success":function(response){
|
|
672
|
console.log(response);//返回对话内容的id
|
|
673
|
$("#dialogContent").empty();
|
|
674
|
dialogContentDataHandle();
|
|
675
|
},
|
|
676
|
"error":function(error){
|
|
677
|
//对话发送消息失败
|
|
678
|
console.log(error);
|
|
679
|
}
|
|
680
|
});
|
|
681
|
$("#dialog_sendContent").val("");
|
|
682
|
};
|
|
683
|
$("#dialog_sendBtn").bind("click",sendDialogContentFn);
|
|
684
|
|
695
|
685
|
|
|
686
|
//==============点击确认完成
|
|
687
|
function confirmFinish(){
|
|
688
|
ConsultComment();
|
|
689
|
//评价星星样式
|
|
690
|
var start;
|
|
691
|
function clickStar(){
|
|
692
|
$(".evastar2").removeClass('addStar');
|
|
693
|
start=$(this).index()+1;
|
|
694
|
for(var i=0;i<start;i++){
|
|
695
|
if(i<start){
|
|
696
|
$(".evastar2").eq(i).addClass("addStar");
|
|
697
|
}
|
|
698
|
else{
|
|
699
|
$(".evastar2").eq(i).removeClass('addStar');
|
|
700
|
}
|
|
701
|
}
|
|
702
|
$("#startCount").val($(".addStar").length);
|
|
703
|
};
|
|
704
|
$(".evastar2").bind("click",clickStar);
|
|
705
|
//发表评论
|
|
706
|
$("#sendAssessBtn").bind("click",clickSendAssessBtn);
|
|
707
|
|
|
708
|
};
|
|
709
|
//绑定对话页面确认完成咨询
|
|
710
|
$(".dialogsurebtn").bind("click",confirmFinish);
|
696
|
711
|
|
697
|
712
|
|
|
713
|
//点击发表评论:保存发表内容和星级
|
|
714
|
function clickSendAssessBtn(){
|
|
715
|
var assessStar = $("#startCount").val();
|
|
716
|
var assessContant = $(".resouinforcon").find("textarea").val();
|
|
717
|
//评价状态 0-未评价,1-已评价
|
|
718
|
|
|
719
|
//确认完成后,发表评论传值
|
|
720
|
var assessContentStr ={
|
|
721
|
"consultId":consultId, //咨询ID
|
|
722
|
"assessStatus":"1", //评价状态 0-未评价,1-已评价
|
|
723
|
"assessStar":assessStar, //评价星级
|
|
724
|
"assessContant":assessContant //评价内容
|
|
725
|
};
|
|
726
|
console.log(assessContentStr);
|
|
727
|
//如果未评论,提示未评论
|
|
728
|
if(assessStar == "" || assessStar == null || assessStar == undefined){
|
|
729
|
if(assessContant == "" || assessContant == null || assessContant == undefined){
|
|
730
|
$.MsgBox.Alert('提示',"未评论,是否退出评论");
|
|
731
|
}
|
|
732
|
$.MsgBox.Alert('提示',"未选择星级");
|
|
733
|
};
|
|
734
|
$.ajax({
|
|
735
|
"url":"/ajax/consult/assess",//点击发表评论接口
|
|
736
|
"type":"post",
|
|
737
|
"data":assessContentStr,
|
|
738
|
"success":function(response){
|
|
739
|
console.log(response);
|
|
740
|
$(".blackcover").remove();
|
|
741
|
$("body").css("overflow","auto");
|
|
742
|
$.MsgBox.Alert('提示',"评论成功");
|
|
743
|
|
|
744
|
//评价状态改变,所以头部信息改变
|
|
745
|
dialogHeadDataHandleFn();
|
|
746
|
},
|
|
747
|
"error":function(error){
|
|
748
|
//发表评论失败
|
|
749
|
console.log(error);
|
|
750
|
}
|
|
751
|
|
|
752
|
});
|
|
753
|
};
|
|
754
|
|
|
755
|
|
|
756
|
|
|
757
|
|
|
758
|
|
|
759
|
|
|
760
|
|
|
761
|
|
|
762
|
|
|
763
|
|
|
764
|
|
698
|
765
|
},
|
699
|
766
|
"error":function(error){
|
700
|
767
|
//console.log(data);
|
701
|
768
|
//加载对话页面失败
|
702
|
|
|
|
769
|
console.log(error);
|
703
|
770
|
}
|
704
|
771
|
})
|
705
|
772
|
|
706
|
773
|
|
707
|
774
|
};
|
|
775
|
//给咨询页回复绑定事件
|
708
|
776
|
$(".workselectitem").bind("click",".replybtn",clickReplyFn);
|
709
|
|
|
|
777
|
|
710
|
778
|
|
711
|
779
|
//收到咨询和收到回复切换
|
712
|
780
|
$(".worksamlltit3:first").addClass("active").show();
|
|
@ -737,58 +805,15 @@ $(document).ready(function(){
|
737
|
805
|
},
|
738
|
806
|
"success":function(replyResponse){
|
739
|
807
|
//拿到收到回复数据
|
740
|
|
console.log(replyResponse);
|
|
808
|
// console.log(replyResponse);
|
|
809
|
var replyTrHtml;
|
741
|
810
|
var allData = replyResponse.data;
|
742
|
811
|
var replyData = allData["data"];
|
743
|
|
var replyTrHtml = '';
|
|
812
|
// console.log(replyData.length);
|
744
|
813
|
if(replyData.length != 0 && replyData.length != null){
|
745
|
|
|
746
|
|
for(var i = 0; i < replyData.length;i++){
|
747
|
|
replyTrHtml +=
|
748
|
|
"<div class='workselectitem' id=' " + replyData[i]["consultId"] +" ' >" +
|
749
|
|
"<table width='100%'>" +
|
750
|
|
"<tbody><tr>" +
|
751
|
|
"<td width='14%' class='messagebox'>" +
|
752
|
|
"<a class='workhead workitimg' href='information.html'>" +
|
753
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
754
|
|
"</a>" +
|
755
|
|
"<span class='msgprompt'>1</span>" +
|
756
|
|
"</td>" +
|
757
|
|
"<td style='position:relative;' width='86%'>" +
|
758
|
|
"<div class='workinfor worksitcon'>" +
|
759
|
|
"<h4><a href='' class='named' id='nameS'> " + replyData[i]["consultId"] +" </a><img class='modifyicon' src='images/rz.png' width='30'></h4>" +
|
760
|
|
"<h6><span>职称 " + replyData[i]["consultId"] +" </span>,<span>职位 " + replyData[i]["consultId"] +" </span>,<span> " + replyData["consultId"] +" </span>,<span> " + replyData["consultId"] +" </span> | <span> " + replyData["consultId"] +" </span></h6>" +
|
761
|
|
"<h6>"+
|
762
|
|
"<span>咨询主题:<em> " + replyData[i]["consultTitle"] +" </em></span>" +
|
763
|
|
" " +
|
764
|
|
"<span>咨询类型:<em> " + replyData[i]["consultType"] +" </em></span>" +
|
765
|
|
" <span>" +
|
766
|
|
"咨询发起时间:<em> " + replyData[i]["createTime"] +" </em>" +
|
767
|
|
"</span></h6>" +
|
768
|
|
"<p>最后回复<span class='lasttime'> ( " + replyData[i]["revoveryTime"] +" ) </span>:" +
|
769
|
|
"</p>" +
|
770
|
|
"<p class='rebackcon'> " + replyData[i]["consultContant"] +" </p>" +
|
771
|
|
"</div>" +
|
772
|
|
"<div class='workhandle'>" +
|
773
|
|
"<div class='rightopert floatR'>" +
|
774
|
|
"<span class='replybtn'> " + replyData[i]["consultStatus"] +" </span>" +
|
775
|
|
"<span class='moreopert'>...</span>" +
|
776
|
|
"<ul class='moreopertbtn'>" +
|
777
|
|
"<li>投诉</li>" +
|
778
|
|
"</ul>" +
|
779
|
|
"</div>" +
|
780
|
|
"<div class='leftstate floatR'>" +
|
781
|
|
"<span class='coultstate'><i> " + replyData[i]["consultStatus"] +" </i><em></em></span>" +
|
782
|
|
"</div>" +
|
783
|
|
"</div>" +
|
784
|
|
"</td>" +
|
785
|
|
"</tr></tbody></table>" +
|
786
|
|
"</div>";
|
787
|
|
|
788
|
|
};
|
789
|
|
console.log(replyTrHtml);
|
|
814
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看");
|
790
|
815
|
$(".tcdPageCode:last").before(replyTrHtml);
|
791
|
|
// $("#workContainer2").html(replyTrHtml);
|
|
816
|
|
792
|
817
|
}else{
|
793
|
818
|
return false;
|
794
|
819
|
}
|
|
@ -856,6 +881,7 @@ $(document).ready(function(){
|
856
|
881
|
//只有收到回复时 更新下拉菜单
|
857
|
882
|
$.ajax({
|
858
|
883
|
"url":"/ajax/consult/pqcon",//更新下拉菜单接口
|
|
884
|
"type":"get",
|
859
|
885
|
"data":replyInfo,
|
860
|
886
|
"beforeSend":function(response){
|
861
|
887
|
console.log(response);
|
|
@ -863,56 +889,11 @@ $(document).ready(function(){
|
863
|
889
|
"success":function(response){
|
864
|
890
|
$("#workContainer2 .workselectitem").remove();
|
865
|
891
|
// $(".tcdPageCode:first").before().empty();
|
866
|
|
replyTrHtml = '';
|
867
|
|
console.log(response);
|
868
|
892
|
var allData = response.data;
|
869
|
893
|
var replyData = allData["data"];
|
|
894
|
replyTrHtml = handleData(replyData,replyTrHtml,"consultantId","查看");
|
|
895
|
$(".tcdPageCode:last").before(replyTrHtml);
|
870
|
896
|
|
871
|
|
for(var i = 0 ; i < replyData.length;i++){
|
872
|
|
replyTrHtml +=
|
873
|
|
"<div class='workselectitem' id=' " + replyData[i]["consultId"] +" ' >" +
|
874
|
|
"<table width='100%'>" +
|
875
|
|
"<tbody><tr>" +
|
876
|
|
"<td width='14%' class='messagebox'>" +
|
877
|
|
"<a class='workhead workitimg' href='information.html'>" +
|
878
|
|
"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
|
879
|
|
"</a>" +
|
880
|
|
"<span class='msgprompt'>1</span>" +
|
881
|
|
"</td>" +
|
882
|
|
"<td style='position:relative;' width='86%'>" +
|
883
|
|
"<div class='workinfor worksitcon'>" +
|
884
|
|
"<h4><a href='' class='named' id='nameS'> " + replyData[i]["consultId"] +" </a><img class='modifyicon' src='images/rz.png' width='30'></h4>" +
|
885
|
|
"<h6><span>职称 " + replyData[i]["professor"]["title"] +" </span>,<span>职位 " + replyData[i]["professor"] +" </span>,<span> " + replyData["consultId"] +" </span>,<span> " + replyData["consultId"] +" </span> | <span> " + replyData["consultId"] +" </span></h6>" +
|
886
|
|
"<h6>"+
|
887
|
|
"<span>咨询主题:<em> " + replyData[i]["consultTitle"] +" </em></span>" +
|
888
|
|
" " +
|
889
|
|
"<span>咨询类型:<em> " + replyData[i]["consultType"] +" </em></span>" +
|
890
|
|
" <span>" +
|
891
|
|
"咨询发起时间:<em> " + replyData[i]["createTime"] +" </em>" +
|
892
|
|
"</span></h6>" +
|
893
|
|
"<p>最后回复<span class='lasttime'> ( " + replyData[i]["revoveryTime"] +" ) </span>:" +
|
894
|
|
"</p>" +
|
895
|
|
"<p class='rebackcon'> " + replyData[i]["consultContant"] +" </p>" +
|
896
|
|
"</div>" +
|
897
|
|
"<div class='workhandle'>" +
|
898
|
|
"<div class='rightopert floatR'>" +
|
899
|
|
"<span class='replybtn' id=' " + replyData[i]['consultId'] + " '> " + replyData[i]["consultStatus"] +" </span>" +
|
900
|
|
"<span class='moreopert'>...</span>" +
|
901
|
|
"<ul class='moreopertbtn'>" +
|
902
|
|
"<li>投诉</li>" +
|
903
|
|
"</ul>" +
|
904
|
|
"</div>" +
|
905
|
|
"<div class='leftstate floatR'>" +
|
906
|
|
"<span class='coultstate'><i> " + replyData[i]["consultStatus"] +" </i><em></em></span>" +
|
907
|
|
"</div>" +
|
908
|
|
"</div>" +
|
909
|
|
"</td>" +
|
910
|
|
"</tr></tbody></table>" +
|
911
|
|
"</div>";
|
912
|
|
};
|
913
|
|
// console.log(replyTrHtml);
|
914
|
|
$(".tcdPageCode:last").before(replyTrHtml);
|
915
|
|
|
916
|
897
|
},
|
917
|
898
|
"error":function(response){
|
918
|
899
|
// console.log(response)
|
|
@ -949,10 +930,8 @@ $(document).ready(function(){
|
949
|
930
|
|
950
|
931
|
|
951
|
932
|
});
|
952
|
|
|
953
|
933
|
|
954
|
934
|
|
955
|
|
|
956
|
935
|
}else{
|
957
|
936
|
$.MsgBox.Alert('提醒',"您尚未登录");
|
958
|
937
|
}
|