portal html css js resource

dialogs.js 21KB

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