portal html css js resource

needSure.js 3.9KB

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