co_detail.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. webpackJsonp([5], {
  2. 0: function (i, t) {},
  3. 1: function (i, t) {},
  4. 14: function (i, t) {},
  5. 20: function (i, t) {},
  6. 36: function (i, t, e) {
  7. "use strict";
  8. e(5), e(6), e(7), e(14), e(20), e(1), e(0), e(8), e(9), e(37), e(10), e(38);
  9. var n = function (i) {
  10. return i && i.__esModule ? i : {
  11. "default": i
  12. }
  13. }(e(11));
  14. window.pop = n["default"]
  15. },
  16. 37: function (i, t, e) {
  17. "use strict";
  18. $(document).ready(function () {
  19. window.onload = function () {
  20. slider.init(".jc_ilst", {
  21. time: 700,
  22. width: 65
  23. }), $(".jc_lf").on("click", function () {
  24. slider.right()
  25. }), $(".jc_rt").on("click", function () {
  26. slider.left()
  27. })
  28. };
  29. var i = $('input[name="islogin"]').val();
  30. 1 == $('input[name="iseffect"]').val() && 1 == i && getshieldcompanystatus(), $(".elswitch").click(function () {
  31. var i = 1;
  32. $(this).hasClass("on") ? $(this).removeClass("on") : ($(this).addClass("on"), i = 3), shieldcompany(i)
  33. })
  34. }), window.shieldcompany = function (i) {
  35. var t = $("#coid").val(),
  36. e = $("#pagecode").val(),
  37. n = window.location.href,
  38. o = $_CONFIG.domain + "ajax/my/shieldcompany.ajax.php?jsoncallback=?",
  39. s = {
  40. coid: t,
  41. type: i,
  42. url: n,
  43. pagecode: e,
  44. requesttype: "jsonp",
  45. t: Math.random()
  46. };
  47. $.getJSON(o, s, function (i) {
  48. if (1 != i.status) {
  49. if ($(".elswitch").toggleClass("on"), i.url) return window.location.href = i.url, !1;
  50. pop.ini([
  51. [i.desc, "warn"]
  52. ], ["确定"])
  53. }
  54. })
  55. }, window.getshieldcompanystatus = function () {
  56. var i = $("#coid").val(),
  57. t = window.location.href,
  58. e = $_CONFIG.domain + "ajax/my/getshieldcompanystatus.ajax.php?jsoncallback=?",
  59. n = {
  60. coid: i,
  61. url: t,
  62. requesttype: "jsonp",
  63. t: Math.random()
  64. };
  65. $.getJSON(e, n, function (i) {
  66. 1 == i.status && $(".elswitch").addClass("on")
  67. })
  68. }
  69. },
  70. 38: function (i, t, e) {
  71. "use strict";
  72. function n(i) {
  73. var t = window.innerHeight - 30,
  74. e = $(i),
  75. n = e.find("img"),
  76. o = 0;
  77. var s = e.find("span").attr("title"),
  78. a = new Image;
  79. a.src = s, a.onload = function () {
  80. ! function (i) {
  81. (o = i.width <= 300 ? i.height : parseInt(300 * i.height / i.width)) > t && (e.height(t), $("#imgSwiper").height(t + document.body.scrollTop), o = t)
  82. }(a);
  83. var i = (t - o) / 2 - 80;
  84. i = i > 0 ? i : 0, n.removeAttr("width").removeAttr("height").removeAttr("style").attr("src", s).attr("alt", "").css({
  85. "max-height": t,
  86. "margin-top": i
  87. })
  88. }
  89. }
  90. window.slider = function () {
  91. $ = Zepto || new Error("依赖Zepto");
  92. var i, t, e, n, o = 200,
  93. s = 0,
  94. a = 0,
  95. r = 0,
  96. c = 0,
  97. d = $(window).width() - 64;
  98. function l(t) {
  99. i.css({
  100. transform: "translateX(" + t + "px)"
  101. }), t >= 0 ? $(".jc_lf").hide() : $(".jc_lf").show(), d < t + o ? $(".jc_rt").show() : $(".jc_rt").hide()
  102. }
  103. function p(t) {
  104. i.css("transition", "transform " + n + "ms ease"), l(t), setTimeout(function () {
  105. h()
  106. }, n)
  107. }
  108. function h() {
  109. if (r > 0) l(0), r = 0;
  110. else if (Math.abs(r) > Math.abs(t - i.width())) l(r = -Math.abs(t - i.width()));
  111. else {
  112. l(Math.round(r / e) * e)
  113. }
  114. }
  115. return {
  116. init: function (p, w) {
  117. (i = $('<div class="clearbox"></div>')).append($(p).children()), $(p).append(i), t = i.parent().width(), i.parent().css("overflow", "hidden"), c = Math.round(t / (w.width + 16)), n = w.time, e = w.width + 16, i.width(i.children().length * e - 16), (o = $(".clearbox").width()) > d ? ($(".jc_rt").show(), i.on("touchstart", function (i) {
  118. s = i.touches[0].pageX
  119. }), i.on("touchmove", function (i) {
  120. var t = $(this);
  121. a = i.touches[0].pageX - s, s = i.touches[0].pageX, t.css("transition", ""), l(r += a)
  122. }), i.on("touchend", function (i) {
  123. $(this).css("transition", "transform " + n + "ms ease"), h()
  124. })) : $(".jc_rt").hide()
  125. },
  126. left: function () {
  127. Math.abs(r) >= Math.abs(t - i.width()) ? r -= e / 2 : r -= e * c, p(r)
  128. },
  129. right: function () {
  130. p(r += r >= 0 ? e / 2 : e * c)
  131. }
  132. }
  133. }(Zepto), window.fSwiper = function (i) {
  134. var t = swiperImg.length,
  135. e = window.innerHeight - 30,
  136. o = (e + document.body.scrollTop) / 1.2,
  137. s = 0;
  138. if ($("#js_swiper")[0]) $("#shadow,#js_swiper").show(), $("#imgSwiper").css("height", e), setTimeout(function () {
  139. imgSwiper.swipeTo(i, 0)
  140. }, 100);
  141. else {
  142. var a = "<div id='js_swiper'>";
  143. a += "<div class='swiper_box'>", t > 1 && (a += "<span class='prev' onclick='imgSwiper.swipePrev()' style='top:" + (e / 2 - 30 + document.body.scrollTop) + "px'></span><span class='next' onclick='imgSwiper.swipeNext()' style='top:" + (e / 2 - 30 + document.body.scrollTop) + "px'></span>"), a += "<div id='imgSwiper' class='swiper-container' style='height:" + o + "px'>", a += "<div class='swiper-wrapper'>";
  144. for (var r = 0; r < t; r++) a += "<div class='swiper-slide' style='color:red;height:" + e + "px'>", a += "<img width='40' height='40' style='margin-top:" + (e / 2 - 50 + document.body.scrollTop) + "px' src='//img01.51jobcdn.com/im/mobile/m/loading3.gif' alt='loading' />", a += "<span style='display:none' title='" + swiperImg[r] + "'></span>", a += "</div>";
  145. a += "</div>", a += "</div>", a += "<div class='close'><span></span></div>", a += "<div class='page'><span>" + r + "</span>/" + t + "</div>", a += "</div>", a += "</div>", $("#shadow")[0] || (a += "<div id='shadow'></div>"), $("body").append(a);
  146. var c = t > 1;
  147. window.imgSwiper = $("#imgSwiper").swiper({
  148. mode: "horizontal",
  149. loop: c,
  150. onSwiperCreated: function () {
  151. c && (n($("#imgSwiper .swiper-slide")[1]), $(".swiper_box").find(".page span").html(1))
  152. },
  153. onSlideChangeStart: function (i) {
  154. var o = imgSwiper.activeSlide(),
  155. s = imgSwiper.activeIndex;
  156. 0 == s ? s = t - 1 : s > t ? s = 0 : s--;
  157. var a = s + 1;
  158. $(".swiper_box").find(".page span").html(a);
  159. e = window.innerHeight - 30, document.body.scrollTop;
  160. $(".swiper-slide img").removeAttr("style").attr("src", "//img01.51jobcdn.com/im/mobile/m/loading3.gif").attr("alt", "loading").css({
  161. width: "40px",
  162. height: "40px",
  163. "margin-top": e
  164. }), n(o)
  165. }
  166. }), n(imgSwiper.activeSlide()), fSwiper(i)
  167. }
  168. document.addEventListener("touchmove", function (i) {
  169. 0 == s && i.preventDefault()
  170. }, !1), $("#js_swiper .close").click(function (i) {
  171. s = 1, $("#shadow,#js_swiper").hide()
  172. }), $(window).resize(function (i) {
  173. var t = imgSwiper.activeSlide(),
  174. e = window.innerHeight - 30;
  175. document.body.scrollTop, document.body.scrollTop;
  176. $("#imgSwiper").css("height", e), $(".swiper-slide img").removeAttr("style").attr("src", "//img01.51jobcdn.com/im/mobile/m/loading3.gif").attr("alt", "loading").css({
  177. width: "40px",
  178. height: "40px",
  179. "margin-top": e
  180. }), n(t)
  181. })
  182. }
  183. }
  184. }, [36]);