portal html css js resource

dialogs.js 21KB

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