portal html css js resource

companybrowinfor.js 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. case '6':
  99. $("#qualificationList").text("1000人以上")
  100. break;
  101. default:
  102. break;
  103. }
  104. } else {
  105. $("#qualificationList").remove();
  106. }
  107. if($data.orgType) {
  108. switch($data.orgType) {
  109. case '2':
  110. $("#orgType").text("国有企业");
  111. break;
  112. case '3':
  113. $("#orgType").text("上市企业");
  114. break;
  115. case '4':
  116. $("#orgType").text("合资企业");
  117. break;
  118. case '5':
  119. $("#orgType").text("私人企业");
  120. break;
  121. case '6':
  122. $("#orgType").text("外资企业");
  123. break;
  124. case '7':
  125. $("#orgType").text("初创企业");
  126. break;
  127. default:
  128. break;
  129. }
  130. }else{
  131. $("#orgType").remove();
  132. }
  133. if($data.industry) {
  134. indu($data.industry, '#industryShow')
  135. } else {
  136. oComIndustry=0;
  137. $("span:contains('所属行业')").parents(".introduction").hide();
  138. $("a:contains('所属行业')").hide();
  139. }
  140. if($data.subject) {
  141. indu($data.subject, '#subjectShow')
  142. } else {
  143. oComSubject=0;
  144. $("span:contains('专注领域')").parents(".introduction").hide();
  145. $("a:contains('专注领域')").hide();
  146. }
  147. if($data.qualification) {
  148. indu($data.qualification, '#qiye ')
  149. } else {
  150. oComQualification=0;
  151. $("span:contains('企业资质')").parents(".introduction").hide();
  152. $("a:contains('企业资质')").hide();
  153. }
  154. }
  155. },
  156. error: function(XMLHttpRequest, textStats, errorThrown) {
  157. $.MsgBox.Alert('提示', '服务器请求失败')
  158. }
  159. })
  160. }
  161. /*时间格式转换*/
  162. function timeGeshi(otm) {
  163. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  164. return otme;
  165. }
  166. /*应用行业及领域及企业纸质*/
  167. function indu(oString, oSelector) {
  168. var arr = oString.split(",");
  169. var oArr = new Array();
  170. var i;
  171. for(i in arr) {
  172. if(oSelector == "#subjectShow") {
  173. oArr.push('<div class="acad">' + arr[i] + '</div>');
  174. } else {
  175. oArr.push('<li>' + arr[i] + '</li>');
  176. }
  177. }
  178. $(oSelector).html(oArr.join(""));
  179. }
  180. /*获取所有的企业用户*/
  181. function companyUser() {
  182. $.ajax({
  183. url: "/ajax/professor/qaOrgAuth",
  184. type: "GET",
  185. timeout: 10000,
  186. dataType: "json",
  187. data: {
  188. "orgId": id,
  189. orgAuth:1
  190. },
  191. beforeSend: function() {},
  192. success: function(data, textState) {
  193. if(data.success) {
  194. var $info = data.data;
  195. if($info.length==0){
  196. $("span:contains('企业用户')").parents(".introduction").hide();
  197. $("a:contains('企业用户')").hide();
  198. oComUser=0;
  199. if(oComDescp==0&&oComIndustry==0&&oComSubject==0&&oComQualification==0&&oComUser==0){
  200. $("div:contains('企业信息')").parents(".content-left").hide();
  201. }
  202. }
  203. userHtml($info);
  204. }
  205. },
  206. error: function(XMLHttpRequest, textStats, errorThrown) {
  207. $.MsgBox.Alert('提示', '服务器请求失败')
  208. }
  209. })
  210. }
  211. /*填充企业下用户*/
  212. function userHtml(arr) {
  213. for(var i = 0; i < arr.length; i++) {
  214. var tiof = "",
  215. img;
  216. if(arr[i].hasHeadImage) {
  217. img = "/images/head/" + arr[i].id + "_l.jpg";
  218. } else {
  219. img = "images/default-photo.jpg"
  220. }
  221. if(arr[i].title) {
  222. if(arr[i].office) {
  223. tiof = arr[i].title + " ," + arr[i].office;
  224. } else {
  225. tiof = arr[i].title;
  226. }
  227. } else {
  228. if(arr[i].office) {
  229. tiof = arr[i].office;
  230. }
  231. }
  232. var oString = '<dd>'
  233. oString += '<div class="staffChild">'
  234. oString += '<img class="userRadius" src="' + img + '" width="100%" data-id="'+arr[i].id+'" style="cursor:pointer"/>'
  235. oString += '</div><div class="h4Font"><span>' + arr[i].name + '</span></div>'
  236. oString += '<div class="h4Font">' + tiof + '</div></dd>'
  237. $("#userList").append(oString);
  238. }
  239. }
  240. companyInformation();
  241. companyUser();
  242. /*企业文章*/
  243. $.ajax({
  244. url: "/ajax/article/qaOrgPublish",
  245. dataType: 'json', //数据格式类型
  246. type: 'GET', //http请求类型
  247. data: {
  248. "orgId": id
  249. },
  250. timeout: 10000, //超时设置
  251. success: function(data) {
  252. if(data.success) {
  253. if(data.data.length==0){
  254. $("span:contains('科研文章')").parents(".introduction").hide();
  255. }
  256. for(var i = 0; i < data.data.length; i++) {
  257. var add = '<li><a href="articalShow.html?articleId=' + data.data[i].articleId +'" style="display:block;">'
  258. add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
  259. add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
  260. add += '</div><div class="tagsBox"><span></span></div>'
  261. add += '</a></li>';
  262. $add = $(add);
  263. $("#reachArticle").append($add);
  264. $add.find('.tagsBox span').text(data.data[i].subject); //data.data[i].subject
  265. if(data.data[i].articleImg) {
  266. $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") center center no-repeat;background-size:cover;");
  267. }
  268. }
  269. //资源轮播
  270. var $content2 = $(".sharescrollbox.Acrollbox");
  271. var childcount2 = $content2.find(".otherRes.shareshow li").length;
  272. Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev"));
  273. }
  274. },
  275. error: function() {
  276. return;
  277. }
  278. });
  279. /*点击企业员工头像跳转个人浏览页面*/
  280. $("#userList").on("click","img",function(){
  281. var dataId=$(this).attr("data-id");
  282. console.log(dataId)
  283. location.href="information-brow.html?professorId="+dataId;
  284. })
  285. })