portal html css js resource

needSure.js 3.7KB

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