portal html css js resource

needSure.js 3.8KB

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