portal html css js resource

companybrowinfor.js 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. $(document).ready(function() {
  2. var id = GetQueryString("orgId");
  3. var oComDescp,oComIndustry,oComSubject,oComQualification,oComUser;
  4. loginStatus();//判断个人是否登录
  5. /*企业信息*/
  6. function companyInformation() {
  7. $.ajax({
  8. url: "/ajax/org/" + id,
  9. type: "GET",
  10. timeout: 10000,
  11. dataType: "json",
  12. beforeSend: function() {},
  13. success: function(data, textState) {
  14. if(data.success) {
  15. var $data = data.data;
  16. var companytitle = $data.name + "-科袖网";
  17. window.setTimeout(function() {
  18. document.title = companytitle;
  19. }, 500);
  20. $("#comName").text($data.name);
  21. if($data.authStatus == 3) {
  22. $("#authS").addClass("authicon-com-ok").attr("title", "认证企业");
  23. } else {
  24. $("#authS").addClass("authicon-com-no").attr("title", "未认证企业");
  25. }
  26. if($data.hasOrgLogo) {
  27. $("#oimg").attr("src", "/images/org/" + $data.id + ".jpg");
  28. } else {
  29. $("#oimg").attr("src", "images/default-icon.jpg");
  30. }
  31. if($data.orgUrl) {
  32. $("#inteAddress").text($data.orgUrl);
  33. } else {
  34. $("#inteAddress").text("");
  35. }
  36. if($data.foundTime) {
  37. var oTime = timeGeshi($data.foundTime);
  38. $("#createTime").text(oTime);
  39. } else {
  40. $("#createTime").remove();
  41. }
  42. if($data.city) {
  43. $("#ocity").text($data.city);
  44. }
  45. if($data.descp) {
  46. $(".editbox").text($data.descp);
  47. } else {
  48. oComDescp=0;
  49. $("span:contains('企业简介')").parents(".introduction").hide();
  50. $("a:contains('企业简介')").hide();
  51. }
  52. if($data.orgSize) {
  53. switch($data.orgSize) {
  54. case '1':
  55. $("#qualificationList").text("50人以内")
  56. break;
  57. case '2':
  58. $("#qualificationList").text("50-100人")
  59. break;
  60. case '3':
  61. $("#qualificationList").text("100-200人")
  62. break;
  63. case '4':
  64. $("#qualificationList").text("200-500人")
  65. break;
  66. case '5':
  67. $("#qualificationList").text("500-1000人")
  68. break;
  69. default:
  70. $("#qualificationList").text("1000人以上")
  71. break;
  72. }
  73. } else {
  74. $("#qualificationList").remove();
  75. }
  76. if($data.orgType) {
  77. switch($data.orgType) {
  78. case '2':
  79. $("#orgType").text("国有企业");
  80. break;
  81. case '3':
  82. $("#orgType").text("上市企业");
  83. break;
  84. case '4':
  85. $("#orgType").text("合资企业");
  86. break;
  87. case '5':
  88. $("#orgType").text("私人企业");
  89. break;
  90. case '6':
  91. $("#orgType").text("外资企业");
  92. break;
  93. default:
  94. $("#orgType").text("初创企业");
  95. break;
  96. }
  97. }
  98. if($data.industry) {
  99. indu($data.industry, '#industryShow')
  100. } else {
  101. oComIndustry=0;
  102. $("span:contains('所属行业')").parents(".introduction").hide();
  103. $("a:contains('所属行业')").hide();
  104. }
  105. if($data.subject) {
  106. indu($data.subject, '#subjectShow')
  107. } else {
  108. oComSubject=0;
  109. $("span:contains('专注领域')").parents(".introduction").hide();
  110. $("a:contains('专注领域')").hide();
  111. }
  112. if($data.qualification) {
  113. indu($data.qualification, '#qiye ')
  114. } else {
  115. oComQualification=0;
  116. $("span:contains('企业资质')").parents(".introduction").hide();
  117. $("a:contains('企业资质')").hide();
  118. }
  119. }
  120. },
  121. error: function(XMLHttpRequest, textStats, errorThrown) {
  122. $.MsgBox.Alert('提示', '服务器请求失败')
  123. }
  124. })
  125. }
  126. /*时间格式转换*/
  127. function timeGeshi(otm) {
  128. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  129. return otme;
  130. }
  131. /*应用行业及领域及企业纸质*/
  132. function indu(oString, oSelector) {
  133. var arr = oString.split(",");
  134. var oArr = new Array();
  135. var i;
  136. for(i in arr) {
  137. if(oSelector == "#subjectShow") {
  138. oArr.push('<div class="acad">' + arr[i] + '</div>');
  139. } else {
  140. oArr.push('<li>' + arr[i] + '</li>');
  141. }
  142. }
  143. $(oSelector).html(oArr.join(""));
  144. }
  145. /*获取所有的企业用户*/
  146. function companyUser() {
  147. $.ajax({
  148. url: "/ajax/professor/qaOrgAuth",
  149. type: "GET",
  150. timeout: 10000,
  151. dataType: "json",
  152. data: {
  153. "orgId": id,
  154. },
  155. beforeSend: function() {},
  156. success: function(data, textState) {
  157. if(data.success) {
  158. var $info = data.data;
  159. if($info.length==0){
  160. $("span:contains('企业用户')").parents(".introduction").hide();
  161. $("a:contains('企业用户')").hide();
  162. oComUser=0;
  163. if(oComDescp==0&&oComIndustry==0&&oComSubject==0&&oComQualification==0&&oComUser==0){
  164. $("div:contains('企业信息')").parents(".content-left").hide();
  165. }
  166. }
  167. userHtml($info);
  168. }
  169. },
  170. error: function(XMLHttpRequest, textStats, errorThrown) {
  171. $.MsgBox.Alert('提示', '服务器请求失败')
  172. }
  173. })
  174. }
  175. /*填充企业下用户*/
  176. function userHtml(arr) {
  177. for(var i = 0; i < arr.length; i++) {
  178. var tiof = "",
  179. img;
  180. if(arr[i].hasHeadImage) {
  181. img = "/images/head/" + arr[i].id + "_l.jpg";
  182. } else {
  183. img = "images/default-photo.jpg"
  184. }
  185. if(arr[i].title) {
  186. if(arr[i].office) {
  187. tiof = arr[i].title + " ," + arr[i].office;
  188. } else {
  189. tiof = arr[i].title;
  190. }
  191. } else {
  192. if(arr[i].office) {
  193. tiof = arr[i].office;
  194. }
  195. }
  196. var oString = '<dd>'
  197. oString += '<div class="staffChild">'
  198. oString += '<img class="headRadius" src="' + img + '" width="100%" />'
  199. oString += '</div><div class="h4Font"><span>' + arr[i].name + '</span></div>'
  200. oString += '<div class="h4Font">' + tiof + '</div></dd>'
  201. $("#userList").append(oString);
  202. }
  203. }
  204. companyInformation();
  205. companyUser();
  206. /*企业文章*/
  207. $.ajax({
  208. url: "/ajax/article/qaOrg",
  209. dataType: 'json', //数据格式类型
  210. type: 'GET', //http请求类型
  211. data: {
  212. "orgId": id
  213. },
  214. timeout: 10000, //超时设置
  215. success: function(data) {
  216. if(data.success) {
  217. if(data.data.length==0){
  218. $("span:contains('科研文章')").parents(".introduction").hide();
  219. }
  220. for(var i = 0; i < data.data.length; i++) {
  221. var add = '<li><a href="articalInfo.html?oFlag=1&articleId=' + data.data[i].articleId + '&professorId=' + data.data[i].orgId + '" style="display:block;">'
  222. add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
  223. add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
  224. add += '</div><div class="tagsBox"><span></span></div>'
  225. add += '</a></li>';
  226. $add = $(add);
  227. $("#reachArticle").append($add);
  228. $add.find('.tagsBox span').text(data.data[i].industry); //data.data[i].subject
  229. if(data.data[i].articleImg) {
  230. $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") 0 0 no-repeat;background-size:cover;");
  231. }
  232. }
  233. //资源轮播
  234. var $content2 = $(".sharescrollbox.Acrollbox");
  235. var childcount2 = $content2.find(".otherRes.shareshow li").length;
  236. Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev"));
  237. }
  238. },
  239. error: function() {
  240. return;
  241. }
  242. })
  243. })