portal html css js resource

cmp-needShow.js 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. $(document).ready(function() {
  2. var demandId = GetQueryString("demandId");
  3. function angleDemand() {
  4. $.ajax({
  5. url: "/ajax/demand/queryOne",
  6. type: "GET",
  7. timeout: 10000,
  8. dataType: "json",
  9. data: {
  10. "demandId": demandId,
  11. },
  12. beforeSend: function() {},
  13. success: function(data, textState) {
  14. if(data.success) {
  15. console.log(data);
  16. var $data = data.data;
  17. var oTime, oDemandType;
  18. $("#dialog_consultTitle").text($data.demandTitle);
  19. oTime = $data["createTime"].substr(0, 4) + "年" + $data.createTime.substr(4, 2) + "月" + $data.createTime.substr(6, 2) + "日" +
  20. $data.createTime.substr(8, 2) + ":" + $data.createTime.substr(10, 2);
  21. $("#dialog_consultTime").text(oTime);
  22. if($data.closeTime) {
  23. $("#dil_consultStatus").text("已关闭");
  24. var oCloseTime = $data["closeTime"].substr(0, 4) + "年" + $data.closeTime.substr(4, 2) + "月" + $data.createTime.substr(6, 2) + "日" +
  25. $data.closeTime.substr(8, 2) + ":" + $data.closeTime.substr(10, 2);
  26. $("#dialog_consultTime1").text(oCloseTime);
  27. $(".closeBtn").hide();
  28. } else {
  29. $("#dil_consultStatus").text("发布中");
  30. }
  31. if($data.demandType == 1) {
  32. oDemandType = "个人需求"
  33. } else {
  34. oDemandType = "企业需求"
  35. }
  36. $("#dialog_consultType1").text(oDemandType);
  37. if($data.demandAim == 1) {
  38. oDemandAim = "技术咨询"
  39. } else if($data.demandAim == 2) {
  40. oDemandAim = "资源咨询"
  41. } else if($data.demandAim == 3) {
  42. oDemandAim = "其他咨询"
  43. }
  44. $("#dialog_consultType2").text(oDemandAim);
  45. $("#dialog_consultContent").text($data.demandContent);
  46. if($data.professor.hasHeadImage){
  47. $("#oimg").attr("src","/images/head/" + $data.professor.id + "_l.jpg")
  48. }else{
  49. $("#oimg").attr("src","../images/default-photo.jpg")
  50. }
  51. $("#userName").text($data.professor.name);
  52. var oString = todStr($data.professor.title, $data.professor.office, $data.professor.department);
  53. $("#offt").text(oString);
  54. if($data.organization.hasOrgLogo){
  55. $("#organizationImg").attr("src", "/images/org/" + $data.organization.id + ".jpg");
  56. }else{
  57. $("#organizationImg").attr("src", "../images/default-icon.jpg");
  58. }
  59. $("#organName").text($data.organization.name);
  60. if($data.organization.authStatus){
  61. $("#authCompany").addClass("authicon-com-ok");
  62. $("#authCompany").attr("title","认证企业")
  63. }else{
  64. $("#authCompany").addClass("authicon-com-no");
  65. $("#authCompany").attr("title","未认证企业")
  66. }
  67. if($data.organization.industry){
  68. $(".ellipsisSty").text($data.organization.industry);
  69. }
  70. var oClass = autho($data.professor.authType, $data.professor.orgAuth, $data.professor.authStatus);
  71. $("#authFlag").addClass(oClass.sty).attr("title",oClass.title);
  72. }
  73. },
  74. error: function(XMLHttpRequest, textStats, errorThrown) {
  75. }
  76. })
  77. }
  78. angleDemand();
  79. $(".closeBtn").click(function() {
  80. $.MsgBox.Confirm("消息", "确认关闭此需求?——关闭后,专家将看不到此需求,但不会影响进行中的相关咨询。", closeDemand)
  81. })
  82. function closeDemand() {
  83. $.ajax({
  84. url: "/ajax/demand/close",
  85. type: "POST",
  86. timeout: 10000,
  87. dataType: "json",
  88. data: {
  89. "demandId": demandId,
  90. },
  91. beforeSend: function() {},
  92. success: function(data, textState) {
  93. if(data.success) {
  94. $(".closeBtn").hide();
  95. $("#dil_consultStatus").text("已关闭");
  96. }
  97. },
  98. error: function(XMLHttpRequest, textStats, errorThrown) {
  99. }
  100. })
  101. }
  102. /*职位职称所属机构*/
  103. function todStr() {
  104. var arr = new Array(),
  105. i;
  106. for(i in arguments) {
  107. if(arguments[i]) {
  108. arr.push(arguments[i])
  109. }
  110. }
  111. return arr.join();
  112. }
  113. })