portal html css js resource

cmp-needShow.js 3.9KB

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