portal html css js resource

dialogs.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. //用户id
  2. $(function(){
  3. $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
  4. $(".workmenu>ul>li").eq(1).addClass("nowLi");
  5. loginStatus();//判断个人是否登录
  6. valUser();
  7. })
  8. var userid = $.cookie("userid");
  9. var sendId = GetQueryString('sendId');
  10. var attrParams = GetQueryString('attrParams');
  11. var consultId = GetQueryString('consultId');
  12. var consultStatus = GetQueryString('consultStatus');
  13. var assessStatus = GetQueryString('assessStatus');
  14. var thanksStatus = GetQueryString('thanksStatus');
  15. clickLookBtn2(sendId, attrParams, consultId, consultStatus, assessStatus, thanksStatus)
  16. //getConsultData参数
  17. var pageSize = 5;
  18. var pageNo, isbind, status, timeType, sortType;
  19. //返回按钮
  20. $("#backBtn").on("click", function() {
  21. if(attrParams == 'consultId') {
  22. window.location.href = "myConsult.html";
  23. } else {
  24. window.location.href = "consult.html";
  25. }
  26. })
  27. //列表最后回复
  28. function lastReplyFn(sendId, consultId) {
  29. var lastReplyTimeData, lastReplyTime, lastReplyCon;
  30. $.ajax({
  31. url: "/ajax/tidings/qaLastRevovery",
  32. async: false,
  33. data: {
  34. "consultId": consultId, //咨询ID
  35. "senderId": sendId //登录者ID
  36. },
  37. success: function(response) {
  38. // console.log(response)
  39. if(response["data"] == null || response["data"] == "" || response["data"] == undefined) {
  40. lastReplyTimeData = '';
  41. lastReplyTime = '';
  42. lastReplyCon = '';
  43. } else {
  44. lastReplyTimeData = response["data"]["createTime"];
  45. lastReplyTime = lastReplyTimeData.substr(0, 4) + "-" + lastReplyTimeData.substr(4, 2) + "-" + lastReplyTimeData.substr(6, 2) + " " + lastReplyTimeData.substr(8, 2) + ":" + lastReplyTimeData.substr(10, 2)
  46. lastReplyCon = response["data"]["tidingsContant"];
  47. }
  48. },
  49. error: function(error) {
  50. $.MsgBox.Alert('提示', "最后回复数据失败");
  51. }
  52. });
  53. return {
  54. "lastReplyTime": lastReplyTime,
  55. "lastReplyCon": lastReplyCon
  56. };
  57. };
  58. //咨询点击回复,对话页字符串拼接函数
  59. //data:要处理的数据,htmlStr:需要拼接到页面的元素,position
  60. function dialogContentStrFn(data) {
  61. var htmlStr = "";
  62. var dialogitem, float, dilinfobox, dilarrow, dilarrow_bor, chatImg;
  63. for(var i = 0; i < data.length; i++) {
  64. if(data[i]["professor"]["id"] == userid) {
  65. dialogitem = "dialogrightitem";
  66. float = "floatR";
  67. dilinfobox = "dilinfobox_r";
  68. dilarrow = "dilarrow_r";
  69. dilarrow_bor = "dilarrow_r_bor";
  70. //判断自己 是否有头像
  71. if(data[i]["professor"]["hasHeadImage"] == 0) {
  72. chatImg = 'images/default-photo.jpg';
  73. } else {
  74. chatImg = "images/head/" + data[i]["professor"]["id"] + "_l.jpg";
  75. }
  76. } else {
  77. dialogitem = "dialogleftitem";
  78. float = "floatL";
  79. dilarrow = "dilarrow_l";
  80. dilinfobox = "dilinfobox_l";
  81. dilarrow_bor = "dilarrow_l_bor";
  82. //判断对方 是否有头像
  83. if(data[i]["professor"]["hasHeadImage"] == 0) {
  84. chatImg = 'images/default-photo.jpg';
  85. } else {
  86. chatImg = "images/head/" + data[i]["professor"]["id"] + "_l.jpg";
  87. }
  88. }
  89. htmlStr +=
  90. "<div class='" + dialogitem + "'>" +
  91. "<div class='dilmod'>" +
  92. "<div class='diluser " + float + "'>" +
  93. "<a target='_blank' class='userface userRadius'>" +
  94. "<img src='" + chatImg + "' width='100%' height='100%'>" +
  95. "</a>" +
  96. "</div>" +
  97. "<div class='dilinfobox " + dilinfobox + " " + float + "'>" +
  98. "<div class='delinfocon clearfix'>" +
  99. "<div class='dilarrow " + dilarrow + "'></div>" +
  100. "<div class='dilarrow " + dilarrow_bor + "'></div>" +
  101. "<div class='delinfomain " + float + "'>" +
  102. "<div class='cont'>" +
  103. "<p>" + data[i]["tidingsContant"] + "</p>" +
  104. "</div>" +
  105. "</div>" +
  106. "</div>" + //dilinfobox
  107. "</div>" + //dilinfobox
  108. "</div>" + //dilmod
  109. "</div>" + //dialogrightitem
  110. "</div> "
  111. };
  112. return htmlStr;
  113. };
  114. //咨询和回复中点击查看或者回复
  115. function clickLookBtn2(sendId, attrParams, consultId, consultStatus, assessStatus, thanksStatus) {
  116. //收到咨询
  117. if(attrParams == "professorId") {
  118. //调取页面
  119. dialogHeadFn2("/ajax/consult/qapro", attrParams, consultId, thanksStatus);
  120. dialogContentDataHandle2(consultId);
  121. $("#dialog_sendBtn").click(function() {
  122. sendDialogContentFn2(sendId, consultId)
  123. });
  124. }
  125. //收到回复
  126. else if(attrParams == "consultId") {
  127. if(consultStatus == 0) { //进行中
  128. dialogHeadFn2("/ajax/consult/qacon", attrParams, consultId, thanksStatus);
  129. dialogContentDataHandle2(consultId);
  130. $("#dialog_sendBtn").click(function() {
  131. sendDialogContentFn2(sendId, consultId)
  132. });
  133. } else if(consultStatus == 2) { //待回复
  134. dialogHeadFn2("/ajax/consult/qacon", attrParams, consultId, thanksStatus);
  135. dialogContentDataHandle2(consultId);
  136. } else if(consultStatus == 3) { //被感谢
  137. dialogHeadFn2("/ajax/consult/qacon", attrParams, consultId, thanksStatus);
  138. dialogContentDataHandle2(consultId);
  139. } else if(consultStatus == 1) { //完成
  140. if(assessStatus == 0) { //未评价
  141. assessFn2(consultId, attrParams, thanksStatus)
  142. } else if(assessStatus == 1) {
  143. dialogHeadFn2("/ajax/consult/qacon", attrParams, consultId, thanksStatus);
  144. dialogContentDataHandle2(consultId);
  145. $("#dialog_sendBtn").click(function() {
  146. sendDialogContentFn2(sendId, consultId)
  147. });
  148. }
  149. }
  150. }
  151. };
  152. //对话页咨询内容展开和收起
  153. var cur_status = "less";
  154. function showMore() {
  155. //alert("show_more_init!");
  156. var charNumbers = $("#dialog_consultContent").html().length; //总字数
  157. var limit = 20; //显示字数
  158. if(charNumbers > limit) {
  159. var orgText = $("#dialog_consultContent").html(); //原始文本
  160. var orgHeight = $("#dialog_consultContent").height(); //原始高度
  161. var showText = orgText.substring(0, limit); //最终显示的文本
  162. var showText = showText + "...";
  163. $("#dialog_consultContent").html(showText);
  164. var contentHeight = $("#dialog_consultContent").height(); //截取内容后的高度
  165. $("#dialog_switch").click(function() {
  166. if(cur_status == "less") {
  167. $("#dialog_consultContent").height(contentHeight).html(orgText).animate({
  168. height: orgHeight
  169. }, {
  170. duration: "slow"
  171. });
  172. $(this).html("收起");
  173. cur_status = "more";
  174. } else {
  175. $("#dialog_consultContent").height(orgHeight).html(showText).animate({
  176. height: contentHeight
  177. }, {
  178. duration: "fast"
  179. });
  180. $(this).html("展开");
  181. cur_status = "less";
  182. }
  183. });
  184. } else {
  185. $("#dialog_switch").hide();
  186. }
  187. };
  188. //对话标题处理函数
  189. function dialogHeadFn2(url, attrParams, consultId, thanksStatus) {
  190. $.ajax({
  191. url: url, //
  192. data: {
  193. "consultId": consultId
  194. },
  195. type: "get",
  196. aysnc: false,
  197. success: function(response) {
  198. var myData = response["data"];
  199. var startTime = myData["createTime"].substr(0, 4) + "年" + myData["createTime"].substr(4, 2) + "月" + myData["createTime"].substr(6, 2) + "日 " + myData["createTime"].substr(8, 2) + ":" + myData["createTime"].substr(10, 2);
  200. //咨询
  201. if(attrParams == 'professorId') {
  202. //进行中
  203. if(myData["consultStatus"] == 0) {
  204. $("#dil_consultStatus").text("进行中"); //咨询状态
  205. $(".dialogfoot").css("display", "block"); //显示发送对话部分
  206. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  207. $("#dialog_consultTime").text(startTime); //咨询发起时间
  208. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  209. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  210. $("#dialog_consultContentContainer").hide() //咨询内容
  211. } else if(myData["consultStatus"] == 3) { //已谢绝
  212. var finishTime = myData["finishTime"].substr(0, 4) + "年" + myData["finishTime"].substr(4, 2) + "月" + myData["finishTime"].substr(6, 2) + "日 " + myData["finishTime"].substr(8, 2) + ":" + myData["finishTime"].substr(10, 2)
  213. $("#dil_consultStatus").text("已谢绝"); //咨询状态
  214. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  215. $("#dialog_consultTime").text(startTime); //咨询发起时间
  216. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  217. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  218. $("#dialog_consultContent").html(myData["consultContant"]) //咨询内容
  219. $("#no_title").text(finishTime); //谢绝时间
  220. $(".rejectOver").show(); //显示谢绝内容和时间模块
  221. $(".dialogfoot").css("display", "none"); //隐藏发送对话部分
  222. noReason(consultId); //谢绝内容
  223. }
  224. //咨询已完成
  225. else {
  226. $("#dil_consultStatus").text("已完成"); //咨询状态
  227. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  228. $("#dialog_consultTime").text(startTime); //咨询发起时间
  229. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  230. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  231. $("#dialog_consultContent").html(myData["consultContant"]) //咨询内容
  232. $(".dialogfoot").css("display", "none"); //隐藏发送对话部分
  233. //如果评价
  234. if(myData["assessStatus"] == 1) {
  235. var startConut = myData["assessStar"];
  236. for(var i = 0; i < startConut; i++) {
  237. $("#showAllAssess .evastar2").eq(i).addClass("addStar");
  238. }
  239. $("#showAllAssess").removeClass("displayNone"); //总体评价
  240. $("#dialog_assessContent").removeClass("displayNone");
  241. $("#dialog_assessContentText").html(myData["assessContant"]);
  242. //如果感谢
  243. if(myData["thanksStatus"] == 1) {
  244. if(myData["thanksMoney"] != null && myData["thanksMoney"] != undefined && myData["thanksMoney"] != "" && myData["thanksMoney"] != 0) {
  245. $("#dialog_thanks").removeClass("displayNone"); //感谢
  246. $("#dialog_thanksMoney").text(myData["thanksMoney"]);
  247. }
  248. } else { //未感谢
  249. return false;
  250. }
  251. } else { //未评价
  252. return false;
  253. }
  254. }
  255. }
  256. //回复
  257. else if(attrParams == 'consultId') {
  258. //回复进行中
  259. if(myData["consultStatus"] == 0) {
  260. $("#dil_consultStatus").text("进行中"); //咨询状态
  261. $(".dialogfoot").css("display", "block"); //显示发送对话部分
  262. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  263. $("#dialog_consultTime").text(startTime); //咨询发起时间
  264. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  265. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  266. $("#dialog_consultContentContainer").hide() //咨询内容
  267. $("#confirmBtn").removeClass("displayNone"); //确认完成按钮显示
  268. //点击确认完成
  269. $("#confirmBtn").click(function() {
  270. clickConfirmFn(consultId, thanksStatus);
  271. })
  272. //发表评论
  273. $("#sendAssessBtn").click(function() {
  274. clickSendAssessBtn2(consultId, attrParams, thanksStatus)
  275. });
  276. //稍后评价
  277. $("#noAssessBtn").click(function() {
  278. noAssessFn2(consultId, attrParams, thanksStatus);
  279. });
  280. //点击关闭
  281. $("#closeAssessBtn").click(function() {
  282. noAssessFn2(consultId, attrParams, thanksStatus);
  283. });
  284. } else if(myData["consultStatus"] == 2) {
  285. $("#dil_consultStatus").text("待回复"); //咨询状态
  286. $(".dialogfoot").css("display", "block"); //显示发送对话部分
  287. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  288. $("#dialog_consultTime").text(startTime); //咨询发起时间
  289. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  290. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  291. $("#dialog_consultContentContainer").hide() //咨询内容
  292. $(".dialogfoot").css("display", "none"); //隐藏发送对话部分
  293. } else if(myData["consultStatus"] == 3) {
  294. var finishTime = myData["finishTime"].substr(0, 4) + "年" + myData["finishTime"].substr(4, 2) + "月" + myData["finishTime"].substr(6, 2) + "日 " + myData["finishTime"].substr(8, 2) + ":" + myData["finishTime"].substr(10, 2)
  295. $("#dil_consultStatus").text("被谢绝"); //咨询状态
  296. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  297. $("#dialog_consultTime").text(startTime); //咨询发起时间
  298. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  299. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  300. $("#dialog_consultContent").html(myData["consultContant"]) //咨询内容
  301. $("#no_title").text(finishTime); //谢绝时间
  302. $(".rejectOver").show(); //显示谢绝内容和时间模块
  303. $(".dialogfoot").css("display", "none"); //隐藏发送对话部分
  304. noReason(consultId); //谢绝内容
  305. } else { //回复完成
  306. $("#dil_consultStatus").text("已完成"); //咨询状态
  307. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  308. $("#dialog_consultTime").text(startTime); //咨询发起时间
  309. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  310. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  311. $("#dialog_consultContent").html(myData["consultContant"]) //咨询内容
  312. $(".dialogfoot").css("display", "none"); //隐藏发送对话部分
  313. //回复完成未评价
  314. if(myData["assessStatus"] == 0) {
  315. assessFn2(consultId, attrParams, thanksStatus)
  316. } else {
  317. //评价星级
  318. var startConut = myData["assessStar"];
  319. for(var i = 0; i < startConut; i++) {
  320. $("#showAllAssess .evastar2").eq(i).addClass("addStar");
  321. }
  322. $("#showAllAssess").removeClass("displayNone"); //总体评价
  323. // $("#dialog_thanksBtn").removeClass("displayNone");
  324. $("#dialog_assessContent").removeClass("displayNone");
  325. $("#dialog_assessContentText").html(myData["assessContant"]);
  326. $("#dialog_consultContentContainer").show() //咨询内容
  327. $("#confirmBtn").hide();
  328. //未感谢
  329. if(myData["thanksStatus"] == 0) {
  330. // $("#dialog_thanksBtn").removeClass("dispalyNone");
  331. } else {
  332. //感谢金额
  333. // $("#dialog_thanks").removeClass("displayNone");
  334. // $("#dialog_thanksMoney").text(myData["thanksMoney"]);
  335. }
  336. }
  337. }
  338. };
  339. //咨询内容展开收起效果
  340. /*if($("#dialog_consultContent")){
  341. showMore();
  342. };*/
  343. },
  344. error: function(error) {
  345. //对话标题信息
  346. }
  347. });
  348. }
  349. //谢绝理由显示
  350. function noReason(consultId) {
  351. $.ajax('/ajax/consultReject/reasons', {
  352. data: {
  353. "consultId": consultId,
  354. }, //咨询ID
  355. dataType: 'json', //服务器返回json格式数据
  356. type: 'GET', //HTTP请求类型
  357. timeout: 10000, //超时时间设置为10秒;
  358. success: function(data) {
  359. if(data.success && data.data) {
  360. var cent = "";
  361. for(var i = 0; i < data.data.length; i++) {
  362. cent += ' ' + data.data[i].sort + '、' + data.data[i].rejectReason;
  363. }
  364. $("#no_cent").html("感谢您的咨询,但很抱歉,由于以下原因,暂时不能接受您的咨询:" + cent + "。");
  365. }
  366. },
  367. error: function() {
  368. $.MsgBox.Alert('提示', "服务器链接超时");
  369. }
  370. });
  371. }
  372. //点击确认完成
  373. function clickConfirmFn(consultId, thanksStatus) {
  374. $.MsgBox.Confirm('科袖提示', '是否确定完成', function() {
  375. finishFn(consultId)
  376. });
  377. }
  378. //点击确认完成弹窗中完成
  379. function finishFn(consultId, thanksStatus) {
  380. //更新咨询状态
  381. $.ajax({
  382. url: "/ajax/consult/finishTime",
  383. type: "post",
  384. data: {
  385. "consultId": consultId, //咨询ID
  386. "consultStatus": "1", //咨询状态 0-进行中,1-已完成
  387. },
  388. success: function(response) {
  389. //console.log(response);
  390. $(".blackcover").remove();
  391. $("body").css("position", "");
  392. assessFn2(consultId, "consultId", thanksStatus);
  393. },
  394. error: function(error) {
  395. //更新咨询状态失败
  396. }
  397. });
  398. };
  399. //============对话内容数据处理函数
  400. function dialogContentDataHandle2(consultId) {
  401. $.ajax({
  402. "url": "/ajax/tidings/qacon", //对话内容显示接口
  403. "type": "get",
  404. "data": {
  405. "consultId": consultId
  406. },
  407. "success": function(response) {
  408. $("#dialogContent").empty("");
  409. var dialogConData = response["data"];
  410. var dialogStr;
  411. dialogStr = dialogContentStrFn(dialogConData);
  412. $("#dialogContent").prepend(dialogStr);
  413. $("#dialogContent").removeClass("dialog");
  414. var height = $("#dialogContent").height();
  415. $("#dialogContent").addClass("dialog");
  416. $("#dialogContent").scrollTop(height);
  417. },
  418. error: function(error) {
  419. }
  420. });
  421. };
  422. //发送按钮处理函数
  423. function sendDialogContentFn2(sendId, consultId) {
  424. var tidingsContant = $("#dialog_sendContent").val();
  425. //console.log(tidingStr);
  426. $.ajax({
  427. "url": "/ajax/tidings",
  428. "type": "post",
  429. "data": {
  430. "tidingsContant": tidingsContant,
  431. "senderId": sendId,
  432. "consultId": consultId
  433. },
  434. "success": function(response) {
  435. // console.log(response);//返回对话内容的id
  436. if(response.success) {
  437. dialogContentDataHandle2(consultId);
  438. }
  439. },
  440. "error": function(error) {
  441. //对话发送消息失败
  442. console.log(error);
  443. }
  444. });
  445. $("#dialog_sendContent").val("");
  446. };
  447. //评价
  448. function assessFn2(consultId, attrParams, thanksStatus) {
  449. ConsultComment();
  450. $("#sendAssessBtn").css({
  451. "cursor": "auto",
  452. "background-color": "#dadada"
  453. });
  454. //评价星星样式
  455. var start;
  456. function clickStar() {
  457. //发表评论
  458. var cont1 = $("#assessCon").val();
  459. if(cont1)
  460. $("#sendAssessBtn").css({
  461. "cursor": "pointer",
  462. "background-color": "#ff9900",
  463. " border": ":1px solid #ff8500"
  464. });
  465. $("#sendAssessBtn").click(function() {
  466. clickSendAssessBtn2(consultId, attrParams, thanksStatus)
  467. });
  468. $(".evastar2").removeClass('addStar');
  469. start = $(this).index() + 1;
  470. for(var i = 0; i < start; i++) {
  471. if(i < start) {
  472. $(".evastar2").eq(i).addClass("addStar");
  473. } else {
  474. $(".evastar2").eq(i).removeClass('addStar');
  475. }
  476. }
  477. $("#startCount").val($(".addStar").length);
  478. };
  479. $(".evastar2").bind("click", clickStar);
  480. $("#assessCon").on("keyup", function() {
  481. var ass1 = $("#assessCon").val();
  482. if(ass1.trim() == "") {
  483. if($("#sendAssessBtn").css("background-color") == "rgb(255, 153, 0)") {
  484. $("#sendAssessBtn").css({
  485. "cursor": "auto",
  486. "background-color": "#dadada"
  487. });
  488. }
  489. } else {
  490. if($("#startCount").val().trim()) {
  491. $("#sendAssessBtn").css({
  492. "cursor": "pointer",
  493. "background-color": "#ff9900",
  494. " border": ":1px solid #ff8500"
  495. });
  496. }
  497. }
  498. })
  499. //稍后评价
  500. $("#noAssessBtn").click(function() {
  501. noAssessFn2(consultId, attrParams, thanksStatus)
  502. });
  503. //点击关闭
  504. $("#closeAssessBtn").click(function() {
  505. noAssessFn2(consultId, attrParams, thanksStatus)
  506. });
  507. };
  508. //发送评价
  509. //点击发表评论:保存发表内容和星级
  510. function clickSendAssessBtn2(consultId, attrParams, thanksStatus) {
  511. var assessStar = $("#startCount").val();
  512. var assessContant = $("#assessCon").val();
  513. if($("#sendAssessBtn").css("background-color") != "rgb(255, 153, 0)") {
  514. return;
  515. }
  516. var assessContentStr = {
  517. "consultId": consultId, //咨询ID
  518. "assessStatus": "1", //评价状态 0-未评价,1-已评价
  519. "assessStar": assessStar, //评价星级
  520. "assessContant": assessContant //评价内容
  521. };
  522. //保存
  523. $.ajax({
  524. "url": "/ajax/consult/assess", //点击发表评论接口
  525. "type": "post",
  526. "data": assessContentStr,
  527. "success": function(response) {
  528. $(".blackcover").remove();
  529. $("body").css("position", "");
  530. //发表评价后进入对话页
  531. dialogHeadFn2("/ajax/consult/qacon", attrParams, consultId, thanksStatus);
  532. dialogContentDataHandle2(consultId);
  533. },
  534. "error": function(error) {
  535. //发表评论失败
  536. $.MsgBox.Alert('提示', "评论失败");
  537. }
  538. });
  539. };
  540. //稍后评价、
  541. function noAssessFn2(consultId, attrParams, thanksStatus) {
  542. $.ajax({
  543. url: "/ajax/consult/qacon", //对话标题信息接口
  544. data: {
  545. "consultId": consultId,
  546. "readStatus": "1"
  547. },
  548. type: "get",
  549. aysnc: false,
  550. success: function(response) {
  551. var myData = response["data"];
  552. var startTime2 = myData["createTime"].substr(0, 4) + "年" + myData["createTime"].substr(4, 2) + "月" + myData["createTime"].substr(6, 2) + "日 " + myData["createTime"].substr(8, 2) + ":" + myData["createTime"].substr(10, 2);
  553. $(".blackcover").remove();
  554. $("body").css("position", "");
  555. //稍后评价说明已经完成
  556. $("#dil_consultStatus").text("已完成"); //咨询状态
  557. $("#dialog_consultTitle").text(myData["consultTitle"]); //咨询主题
  558. $("#dialog_consultTime").text(startTime2); //咨询发起时间
  559. $("#dialog_consultType").text(myData["consultType"]); //咨询目的
  560. $("#dial_consultName").text(myData["professor"]["name"]); //与@@@对话
  561. $(".dialogfoot").css("display", "none"); //隐藏发送对话部分
  562. $("#dialog_consultContentContainer").css("display", "none");
  563. $("#confirmBtn").hide();
  564. $("#dialog_assessBtn").removeClass("displayNone");
  565. $("#dialog_assessBtn").click(function() {
  566. assessFn2(consultId, attrParams, thanksStatus);
  567. location.reload(true);
  568. });
  569. },
  570. error: function(error) {
  571. }
  572. });
  573. dialogContentDataHandle2(consultId);
  574. };