portal html css js resource

needShow.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. //console.log(data);
  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.closeTime){
  26. $("#dil_consultStatus").text("已关闭");
  27. $(".displayNone").show();
  28. var oCloseTime=$data["closeTime"].substr(0, 4) + "年" + $data.closeTime.substr(4, 2) + "月" + $data.createTime.substr(6, 2) + "日" +
  29. $data.closeTime.substr(8, 2) + ":" + $data.closeTime.substr(10, 2);
  30. $("#dialog_consultTime1").text(oCloseTime);
  31. $(".closeBtn").hide();
  32. }else{
  33. $("#dil_consultStatus").text("发布中");
  34. }
  35. if($data.demandType == 1) {
  36. oDemandType = "个人需求"
  37. } else {
  38. oDemandType = "企业需求"
  39. }
  40. $("#dialog_consultType1").text(oDemandType);
  41. if($data.demandAim == 1) {
  42. oDemandAim = "技术咨询"
  43. } else if($data.demandAim == 2) {
  44. oDemandAim = "资源咨询"
  45. } else if($data.demandAim == 3) {
  46. oDemandAim = "其他咨询"
  47. }
  48. $("#dialog_consultType2").text(oDemandAim);
  49. $("#dialog_consultContent").text($data.demandContent);
  50. consuId = $data.professor.id;
  51. demandTitle = $data.demandTitle;
  52. demandContent = $data.demandContent;
  53. demandType = $data.demandAim
  54. }
  55. },
  56. error: function(XMLHttpRequest, textStats, errorThrown) {
  57. }
  58. })
  59. }
  60. angleDemand() ;
  61. $(".closeBtn").click(function(){
  62. $.MsgBox.Confirm("消息", "确认关闭此需求?", closeDemand)
  63. })
  64. function closeDemand(){
  65. $.ajax({
  66. url: "/ajax/demand/close",
  67. type: "POST",
  68. timeout: 10000,
  69. dataType: "json",
  70. data: {
  71. "demandId": demandId,
  72. },
  73. beforeSend: function() {},
  74. success: function(data, textState) {
  75. if(data.success) {
  76. $(".closeBtn").hide();
  77. $("#dil_consultStatus").text("已关闭");
  78. }
  79. },
  80. error: function(XMLHttpRequest, textStats, errorThrown) {
  81. }
  82. })
  83. }
  84. })