about.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. $(document).ready(function () {
  2. var certifySwiper = new Swiper('.safeCon .swiper-container', {
  3. watchSlidesProgress: true,
  4. slidesPerView: 'auto',
  5. centeredSlides: true,
  6. loop: true,
  7. loopedSlides: 9,
  8. autoplay: true,
  9. navigation: {
  10. nextEl: '.swiper-button-next',
  11. prevEl: '.swiper-button-prev',
  12. },
  13. pagination: {
  14. el: '.swiper-pagination',
  15. clickable: true,
  16. },
  17. on: {
  18. progress: function (progress) {
  19. for (i = 0; i < this.slides.length; i++) {
  20. var slide = this.slides.eq(i);
  21. var slideProgress = this.slides[i].progress;
  22. modify = 1;
  23. if (Math.abs(slideProgress) > 1) {
  24. modify = (Math.abs(slideProgress) - 1) * 0.4 + 1;
  25. }
  26. translate = slideProgress * modify * 328 + 'px';
  27. scale = 1 - Math.abs(slideProgress) / 9;
  28. zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
  29. slide.transform('translateX(' + translate + ') scale(' + scale + ')');
  30. slide.css('zIndex', zIndex);
  31. slide.css('opacity', 1);
  32. if (Math.abs(slideProgress) > 3) {
  33. slide.css('opacity', 0);
  34. }
  35. }
  36. },
  37. setTransition: function (transition) {
  38. for (var i = 0; i < this.slides.length; i++) {
  39. var slide = this.slides.eq(i)
  40. slide.transition(transition);
  41. }
  42. }
  43. }
  44. })
  45. var certifySwiper = new Swiper('.safeCon1 .swiper-container', {
  46. watchSlidesProgress: true,
  47. slidesPerView: 'auto',
  48. centeredSlides: true,
  49. loop: true,
  50. loopedSlides: 5,
  51. autoplay: true,
  52. navigation: {
  53. nextEl: '.swiper-button-next',
  54. prevEl: '.swiper-button-prev',
  55. },
  56. pagination: {
  57. el: '.swiper-pagination',
  58. clickable: true,
  59. },
  60. on: {
  61. progress: function (progress) {
  62. for (i = 0; i < this.slides.length; i++) {
  63. var slide = this.slides.eq(i);
  64. var slideProgress = this.slides[i].progress;
  65. modify = 1;
  66. if (Math.abs(slideProgress) > 1) {
  67. modify = (Math.abs(slideProgress) - 1) * 0.4 + 1;
  68. }
  69. translate = slideProgress * modify * 90 + 'px';
  70. scale = 1 - Math.abs(slideProgress) / 5;
  71. zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
  72. slide.transform('translateX(' + translate + ') scale(' + scale + ')');
  73. slide.css('zIndex', zIndex);
  74. slide.css('opacity', 1);
  75. if (Math.abs(slideProgress) > 3) {
  76. slide.css('opacity', 0);
  77. }
  78. }
  79. },
  80. setTransition: function (transition) {
  81. for (var i = 0; i < this.slides.length; i++) {
  82. var slide = this.slides.eq(i)
  83. slide.transition(transition);
  84. }
  85. }
  86. }
  87. })
  88. $('#myTab a:first').tab('show');
  89. $('#myTab a').click(function (e) {
  90. e.preventDefault();
  91. $(this).tab('show');
  92. })
  93. $('.panel-group').on('hide.bs.collapse', '.panel-collapse', function (e) {
  94. var $this = $(this)
  95. console.log(e)
  96. // $this.prev().find("span").toggleClass("icon-xiangxiajiantou");
  97. if (e.type == 'hide') {
  98. $this.prev().find("span").css('transform', 'rotate(0deg)')
  99. } else {
  100. $this.prev().find("span").css('transform', 'rotate(-180deg)');
  101. }
  102. // if ($('.panel-collapse').hasClass('in')) {
  103. // $this.prev().find("span").css('transform', 'rotate(-180deg)');
  104. // } else {
  105. // $this.prev().find("span").css('transform', 'rotate(0deg)');
  106. // }
  107. })
  108. $('.panel-group').on('show.bs.collapse', '.panel-collapse', function (e) {
  109. console.log(e)
  110. var $this = $(this)
  111. $this.prev().find("span").css('transform', 'rotate(-180deg)');
  112. if (e.type == 'show') {
  113. $this.prev().find("span").css('transform', 'rotate(-180deg)');
  114. } else {
  115. $this.prev().find("span").css('transform', 'rotate(0deg)')
  116. }
  117. })
  118. if ($('.panel-collapse').hasClass('in')) {
  119. console.log($('.panel-collapse').hasClass('in'))
  120. $(this).parents('panel-group').prev().find("span").css('transform', 'rotate(-180deg)');
  121. console.log($(this).parent().parent('.panel-group').find("span"))
  122. } else {
  123. $('.panel-group').prev().find("span").css('transform', 'rotate(0deg)');
  124. }
  125. // $('.dropdown-menu li').click(function() {
  126. // $(this).siblings('li').removeClass('cur');
  127. // $(this).addClass('cur');
  128. // })
  129. $('#example-navbar-collapse .dropdow_menu a').click(function (e) {
  130. if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
  131. var target = $(this.hash);
  132. console.log(target);
  133. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  134. if (target.length) {
  135. $('html,body').animate({
  136. scrollTop: target.offset().top - 40
  137. }, 900);
  138. return false;
  139. }
  140. }
  141. });
  142. $(document).off('click.bs.dropdown.data-api');
  143. $('.top').click(function (e) {
  144. e.preventDefault();
  145. $("body,html").animate({
  146. scrollTop: 0
  147. }, 500);
  148. });
  149. $('.about-video').trigger('play');
  150. //boss 招聘好了,这个打开
  151. // getJobList();
  152. listClick();
  153. joinBtn();
  154. var num = 1;
  155. var list = [];
  156. $('.loadmore').click(function () {
  157. ++num;
  158. console.log(num)
  159. if (num > 3) {
  160. $(this).css('display', 'none')
  161. } else {
  162. $.ajax({
  163. type: 'get',
  164. url: "https://www.cestong.com/cecf/wapi/zpjob/wjd/more/job?sbid=b6f2ee03f7e80a7c1HF_3di6FVE~&page=" + num,
  165. dataType: 'json',
  166. async: false,
  167. success: function (data) {
  168. var arr = sessionStorage.getItem('jobList');
  169. list = list.concat(JSON.parse(arr));
  170. list = list.concat(data.zpData.jobList);
  171. // list = list.concat(data.zpData.jobList)
  172. if (data.code == '0') {
  173. var myli = '';
  174. for (var i = 0; i < list.length; i++) {
  175. var html = list[i].postDescription.replace(/\n/g, '<br>');
  176. myli += `<li class='list-group-item'>
  177. <div>
  178. <span class="salary">查看详情</span>
  179. <h4>${list[i].jobName}</h4>
  180. <div class="info-labels">
  181. <span class="com-location">${list[i].locationName}</span>
  182. <span class="com-years">${list[i].experienceName}</span>
  183. <span class="com-education">${list[i].degreeName}</span>
  184. </div>
  185. <div class="info_desc">
  186. <div>${html}</div>
  187. <div><button class="btn btn-primary btn-lg join_btn" data-toggle="modal" data-target="#join">立即申请</button></div>
  188. </div>
  189. </div>
  190. </li>`
  191. }
  192. $('.list-group').html(myli);
  193. listClick();
  194. joinBtn();
  195. } else {
  196. layer.msg(data.message);
  197. }
  198. },
  199. error: function () {},
  200. });
  201. }
  202. })
  203. // setTimeout(function () {
  204. // $("body,html").animate({
  205. // scrollTop: 860
  206. // }, 1000);
  207. // }, 3500)
  208. $(window).scroll(function () {
  209. if ($(document).scrollTop() < 880) {
  210. $('.img1').show();
  211. $('.img2').hide();
  212. $('.header.active').css('background', '#000')
  213. $('.header .header_link .header_title').css("color", "#fff")
  214. $('.header .header_link.active .header_title').css("color", "#0052D9")
  215. } else {
  216. $('.img1').hide();
  217. $('.img2').show();
  218. $('.header.active').css('background', '#fff')
  219. $('.header .header_link .header_title').css("color", "#434343")
  220. $('.header .header_link.active .header_title').css("color", "#0052D9")
  221. }
  222. });
  223. // $(window).scroll(function () {
  224. // if ($(document).scrollTop() < 20) {
  225. // $('.about_desc_list_wrap').css('display', 'none');
  226. // } else {
  227. // $('.about_desc_list_wrap').css('display', 'block');
  228. // }
  229. // });
  230. // var video = document.querySelector('video');
  231. // video.addEventListener('canplay', function () {
  232. // this.width = this.videoWidth;
  233. // this.height = this.videoHeight;
  234. // console.log(this.videoWidth, this.videoHeight)
  235. // })
  236. // var videoH = $('.about-video').height() + 60;
  237. // $('.head_bg').css("height", videoH + "px");
  238. // console.log($('.head_bg').height(), 'div高度')
  239. // $(window).resize(function () {
  240. // var h = $('.about-video').height();
  241. // console.log(h, '视频高度')
  242. // $('.head_bg').css("height", h + "px");
  243. // console.log($('.head_bg').height(), '变化中div高度')
  244. // var w = $(window).width();
  245. // console.log(w, '')
  246. // });
  247. var h = $(window).height();
  248. $('.head_bg').css("height", h + "px");
  249. $(window).resize(function () {
  250. var vh = $(window).height();
  251. $('.head_bg').css("height", vh + "px");
  252. // var h = $('.about-video').height();
  253. // console.log(h, '视频高度')
  254. // $('.head_bg').css("height", h + "px");
  255. // console.log($('.head_bg').height(), '变化中div高度')
  256. });
  257. })
  258. // http://39.106.74.84:8045
  259. // 获取职位列表
  260. function getJobList() {
  261. $.ajax({
  262. type: 'get',
  263. url: "https://www.cestong.com/cecf/wapi/zpjob/wjd/boss/b6f2ee03f7e80a7c1HF_3di6FVE~?sbid=b6f2ee03f7e80a7c1HF_3di6FVE~&aid=",
  264. dataType: 'json',
  265. async: false,
  266. success: function (data) {
  267. var list = [];
  268. list = list.concat(data.zpData.data.otherJobList)
  269. console.log(list, 'aaaa')
  270. if (data.code == '0') {
  271. var myli = '';
  272. for (var i = 0; i < list.length; i++) {
  273. var html = list[i].postDescription.replace(/\n/g, '<br>');
  274. myli += `<li class='list-group-item'>
  275. <div>
  276. <span class="salary">查看详情</span>
  277. <h4>${list[i].jobName}</h4>
  278. <div class="info-labels">
  279. <span class="com-location">${list[i].locationName}</span>
  280. <span class="com-years">${list[i].experienceName}</span>
  281. <span class="com-education">${list[i].degreeName}</span>
  282. </div>
  283. <div class="info_desc">
  284. <div>${html}</div>
  285. <div><button class="btn btn-primary btn-lg join_btn" data-toggle="modal" data-target="#join">立即申请</button></div>
  286. </div>
  287. </div>
  288. </li>`
  289. }
  290. $('.list-group').html(myli);
  291. list = JSON.stringify(list)
  292. sessionStorage.setItem('jobList', list)
  293. } else {
  294. layer.msg(data.message);
  295. }
  296. },
  297. error: function () {},
  298. });
  299. // $('#join').on('shown.bs.modal', function () {
  300. // var $this = $(this);
  301. // var $modal_dialog = $this.find('.modal-dialog');
  302. // var m_top = ($(window).height() - $modal_dialog.height()) / 2;
  303. // $modal_dialog.css({
  304. // 'margin': m_top + 'px auto'
  305. // });
  306. // });
  307. }
  308. function listClick() {
  309. $(".list-group-item").on("click", function (event) {
  310. // event = event || window.event;
  311. // if (event && event.stopPropagation) {
  312. // event.stopPropagation();
  313. // } else {
  314. // event.cancelBubble = true;
  315. // }
  316. $(".list-group-item").find('.info_desc').slideUp();
  317. if ($(this).find('.info_desc').css('display') == 'none') {
  318. $(this).find('.info_desc').slideDown()
  319. } else {
  320. $(this).find('.info_desc').slideUp()
  321. }
  322. });
  323. }
  324. function joinBtn() {
  325. $('.join_btn').click(function (event) {
  326. console.log(this)
  327. event = event || window.event;
  328. if (event && event.stopPropagation) {
  329. event.stopPropagation();
  330. } else {
  331. event.cancelBubble = true;
  332. }
  333. $('#join').modal('show')
  334. });
  335. }