portal html css js resource

companybrowinfor.js 8.1KB

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