portal html css js resource

needShow.js 2.7KB

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