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