portal html css js resource

needShow.js 2.7KB

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