portal html css js resource

needSure.js 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. $(document).ready(function() {
  2. var demandId = GetQueryString("demandId");
  3. var consuId, demandTitle, demandContent, oDemandAim;
  4. function angleDemand() {
  5. $.ajax({
  6. url: "/ajax/demand/queryOne",
  7. type: "GET",
  8. timeout: 10000,
  9. dataType: "json",
  10. data: {
  11. "demandId": demandId,
  12. },
  13. beforeSend: function() {},
  14. success: function(data, textState) {
  15. if(data.success) {
  16. var $data = data.data;
  17. var oTime, oDemandType;
  18. $("#dialog_consultTitle").text($data.demandTitle);
  19. oTime = $data["createTime"].substr(0, 4) + "年" + $data.createTime.substr(4, 2) + "月" + $data.createTime.substr(6, 2) + "日" +
  20. $data.createTime.substr(8, 2) + ":" + $data.createTime.substr(10, 2);
  21. $("#dialog_consultTime").text(oTime);
  22. if($data.demandType == 1) {
  23. oDemandType = "个人需求"
  24. } else {
  25. oDemandType = "企业需求"
  26. }
  27. $("#dialog_consultType").text(oDemandType);
  28. if($data.demandAim == 1) {
  29. oDemandAim = "技术咨询"
  30. } else if($data.demandAim == 2) {
  31. oDemandAim = "资源咨询"
  32. } else if($data.demandAim == 3) {
  33. oDemandAim = "其他咨询"
  34. }
  35. $("#dialog_consultType").text(oDemandAim);
  36. $("#dialog_consultContent").text($data.demandContent);
  37. $("#nameS").text($data.professor.name);
  38. if($data.professor.hasHeadImage == 1) {
  39. $("#headImg").attr("src", "/images/head/" + $data.professor.id + "_l.jpg")
  40. }
  41. if($data.professor.authType) {
  42. var typeTname = " authicon authicon-cu"
  43. } else {
  44. if($data.professor.authStatus == 3) {
  45. if($data.professor.authentication == 1) {
  46. var typeTname = " authicon2 authicon-mana";
  47. } else if($data.professor.authentication == 2) {
  48. var typeTname = " authicon2 authicon-staff";
  49. } else {
  50. var typeTname = " authicon2 authicon-stu"
  51. }
  52. }
  53. }
  54. $("#sta").addClass(typeTname);
  55. var oString = todStr($data.professor.title, $data.professor.office, $data.professor.department);
  56. $("#offt").text(oString);
  57. consuId = $data.professor.id;
  58. demandTitle = $data.demandTitle;
  59. demandContent = $data.demandContent;
  60. demandType = $data.demandAim
  61. }
  62. },
  63. error: function(XMLHttpRequest, textStats, errorThrown) {
  64. }
  65. })
  66. }
  67. /*职位职称所属机构*/
  68. function todStr() {
  69. var arr = new Array(),
  70. i;
  71. for(i in arguments) {
  72. if(arguments[i]) {
  73. arr.push(arguments[i])
  74. }
  75. }
  76. return arr.join();
  77. }
  78. angleDemand();
  79. /*确认回复*/
  80. $(".basicBtn").find("span").click(function() {
  81. $.ajax({
  82. url: "/ajax/consult/byDemand",
  83. type: "GET",
  84. timeout: 10000,
  85. dataType: "json",
  86. data: {
  87. "demandId": demandId,
  88. "professorId": userid
  89. },
  90. success: function(data, textState) {
  91. if(data.success) {
  92. console.log(data)
  93. if(data.data == null) {
  94. $.MsgBox.Confirm("消息", "确认回复此需求?", createConsult)
  95. } else {
  96. location.href="diloags.html?sendId="+userid+"&attrParams=professorId&consultId="+data.data+"&consultStatus=0&assessStatus=0&thanksStatus=0"
  97. }
  98. }
  99. },
  100. error: function(XMLHttpRequest, textStats, errorThrown) {
  101. }
  102. })
  103. })
  104. function createConsult() {
  105. $.ajax({
  106. url: "/ajax/consult",
  107. type: "POST",
  108. timeout: 10000,
  109. data: {
  110. "consultType": oDemandAim,
  111. "consultTitle": demandTitle,
  112. "consultContant": demandContent,
  113. "professorId": userid,
  114. "consultantId": consuId,
  115. "demandId": demandId
  116. },
  117. success: function(data, textState) {
  118. if(data.success) {
  119. location.href="diloags.html?sendId="+userid+"&attrParams=professorId&consultId="+data.data+"&consultStatus=0&assessStatus=0&thanksStatus=0"
  120. }
  121. },
  122. error: function(XMLHttpRequest, textStats, errorThrown) {
  123. }
  124. })
  125. }
  126. })