portal html css js resource

dialogs.js 21KB

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