portal html css js resource

needShow.js 2.6KB

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