portal html css js resource

companybrowinfor.js 7.3KB

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