MxWeiXinPF.Web/weixin/magazine/js/base_b67b711127.js

(完整代码) 9KB

window.Zepto && function (e) { ["width", "height"].forEach(function (t) { var n = t.replace(/./, function (e) { return e[0].toUpperCase() }); e.fn["outer" + n] = function (e) { var n = this; if (n) { var a = n[t](), i = { width: ["left", "right"], height: ["top", "bottom"] }; return i[t].forEach(function (t) { e && (a += parseInt(n.css("margin-" + t), 10)) }), a } return null } }) }(Zepto), define("vendor/zepto/outer", function () { }), define("wap/showcase/footer", ["vendor/zepto/outer"], function () { var e = navigator.userAgent; if (!(e.indexOf("MI") > -1 || !$(".showcase-feature").length && !$(".vote-page").length || $(".full-screen").length)) { var t = $(window).height(), n = $(".footer").outerHeight(!0), a = $(".container > .header").outerHeight(!0), i = t - n - a, o = $(".content"), s = $(".shopnav"); s.length && (i -= s.height()), o.length && o.css("min-height", i + "px") } }), function () { function e() { clearTimeout(i), t.addClass("done") } var t = $(".js-tpl-weixin-list-item"), n = $(".js-tpl-weixin-bg"); if (!(n.length <= 0)) { var a = n[0], i = setTimeout(function () { e() }, 2e3); a.onload = a.onerror = a.onabort = e, a.complete && e() } }(), function () { var e = $(".js-tpl-shop"), t = "/v2/showcase/homepage/goodscount.json"; e.length && $.ajax({ url: t, type: "GET", dataType: "json", data: { kdt_id: window._global.kdt_id } }).done(function (t) { if (0 === +t.code) { var n = e.find(".js-all-goods"), a = e.find(".js-new-goods"), i = e.find(".js-order"), o = t.data, s = ""; s = (o.all_goods.count + "").length, n.find("a").attr("href", o.all_goods.url), n.find(".count").html(o.all_goods.count).addClass("l-" + s), s = (o.new_goods.count + "").length, a.find("a").attr("href", o.new_goods.url), a.find(".count").html(o.new_goods.count).addClass("l-" + s), i.find("a").attr("href", o.order.url) } }) }(), function () { $(".js-select-coupon").on("click", function () { var e = $(this), t = e.data("id"), n = e.data("kdt-id"), a = window.motify; $.ajax({ url: "/v2/guang/promocard/take.json", type: "POST", data: { groupId: t, kdtId: n } }).done(function (e) { a.log(0 === +e.code ? e.msg || "成功领取优惠券" : e.msg || "网络错误") }).fail(function () { a.log("网络错误") }) }); var e = $(".js-scroll-notice"); e.length && e.each(function () { function t() { s--, 0 > s + i && (s = o), n.css({ left: s }) } var n = $(this), a = e.parents(".tpl-11-11-notice-inner"), i = e.width(), o = a.width(), s = 0; o >= i || (n.css({ position: "relative" }), setInterval(t, 25)) }) }(), define("wap/showcase/homepage/homepage", function () { }), function () { var e = $(".js-custom-level"), t = $(".js-custom-point"), n = $(".js-custom-level-title-section"); if (!(+_global.fans_id <= 0 && +_global.buyer_id <= 0)) { var a = window._global.url.wap + "/showcase/component/point.jsonp?" + $.param({ kdt_id: window._global.kdt_id }); (e.length > 0 || t.length > 0) && $.ajax({ dataType: "jsonp", type: "GET", url: a, success: function (a) { 0 === +a.code && (e.html(a.data.level || "会员"), t.html(a.data.point || "暂无数据"), n.removeClass("hide")) } }) } }(), define("wap/uc/title", function () { }), define("wap/showcase/shop_nav/main", ["vendor/zepto/outer"], function () { var e = { showSubmenu: function (e) { var t = $(e.target), n = t.parents(".nav-item"), a = t.hasClass(".js-mainmenu") ? t : n.find(".js-mainmenu"), i = n.find(".js-submenu"), o = i.find(".arrow"), s = t.parents(".js-navmenu"), r = s.find(".nav-item"); i.css("opacity", "0").toggle(); var d = r.length, c = r.index(n), l = a.outerWidth(), u = (i.outerWidth() - a.outerWidth()) / 2, h = i.outerWidth() / 2; if (0 === i.size()) $(".js-submenu:visible").hide(); else { var f = i.outerWidth(), p = n.outerWidth(), v = "auto", m = "auto", g = "auto", w = "auto"; 0 === c ? (v = a.position().left - u, m = h - o.outerWidth() / 2) : c === d - 1 && f > p ? (g = 8, w = l / 2 - g) : (v = a.position().left - u, m = h - o.outerWidth() / 2); var j = 5; 0 > v && (m = m + v + j, v = j), 0 > g && (w = w + g + j, g = j), i.css({ left: v, right: g }), o.css({ left: m, right: w }), $(".js-submenu:visible").not(i).hide(), i.css("opacity", "1") } } }; $(document).on("click", function () { $(".js-submenu:visible").hide(0); var e = $(".js-navmenu"), t = e.find(".js-nav-pop"); e.hasClass("nav-show") && (e.removeClass("nav-show").addClass("nav-hide"), setTimeout(function () { t.hide(0) }, 500)) }), $("body").on("click", ".js-navmenu", function (e) { e.fromMenu = !0, $.kdt.clickLogHandler.call(e.target, e), e.stopPropagation() }), $("body").on("click", ".js-submenu", function (e) { e.fromMenu = !0, $.kdt.clickLogHandler.call(e.target, e), e.stopPropagation() }), $("body").on("click", ".js-mainmenu", function (t) { e.showSubmenu(t) }); var t = ".js-navmenu", n = $(".js-custom-paginations"); $(t).size() + n.size() > 0 && $("body").css("padding-bottom", $(".js-navmenu").height() || n.height()); var a; $(window).on("scroll", function (e) { e.preventDefault(); var t = $(".js-navmenu"), n = t.find(".js-nav-pop"); t.hasClass("nav-show") && (t.removeClass("nav-show").addClass("nav-hide"), setTimeout(function () { n.hide(0) }, 500)) }), $("body").on("click", ".js-nav-special", function (e) { var t = $(e.target), n = t.parents(".js-navmenu"), i = n.find(".js-nav-pop"); "animation" != n.data("animation") && (n.data("animation", "animation"), n.hasClass("nav-show") ? (n.removeClass("nav-show").addClass("nav-hide"), a = setTimeout(function () { i.css("display", "none"), n.data("animation", "") }, 600)) : (i.css("display", "block"), n.addClass("nav-show").removeClass("nav-hide"), setTimeout(function () { n.data("animation", "") }, 600))) }) }), function () { function e(e) { "undefined" != typeof window.WeixinJSBridge && window.WeixinJSBridge.invoke("imagePreview", { current: e, urls: a }) } if ("undefined" != typeof Swiper) { !function () { var e = $(".custom-image-swiper"), t = e.find(".swiper-container"), n = e.width(); n > 320 && t.each(function (e, t) { var a = $(t), i = a.height(), o = Math.floor(n / 320 * i); a.height(o).find(".swiper-slide a").height(o).find("img").css({ "max-height": o, "max-width": n }) }) }(), $(".custom-image-swiper").each(function (e, t) { var n = $(t), a = n.find(".swiper-container"), i = n.find(".swiper-pagination"), o = { mode: "horizontal", pagination: i[0], paginationClickable: !0, calculateHeight: !0, autoplay: 3500, updateOnImagesReady: !1, onFirstInit: function () { var e = n.find(".js-slide-lazy"); e.each(function () { var e = $(this); e.attr("src", e.data("src")) }) }, onTouchStart: function (e) { e.stopAutoplay() }, onTouchEnd: function (e) { e.startAutoplay() } }; a.find(".swiper-slide").length > 1 && new Swiper(a[0], o) }); var t = window.navigator.userAgent.match(/MicroMessenger\/(\d+(\.\d+)*)/); if (null !== t && t.length) { var n = $(".js-image-swiper img, .custom-richtext img"), a = [], i = 0; n.each(function () { var t = $(this), n = t.attr("data-src") || t.attr("src"); if (t.width() >= i && n) { if (t.parents("a").length > 0) return; a.push(n), t.on("click", function () { e(n) }) } }) } !function () { function e() { t += 100; var e = $(this); setTimeout(function () { e.addClass("done") }, t) } var t = 0, n = $(".js-tpl-fbb"); n.find(".swiper-slide").each(e), n.swiper({ mode: "horizontal", slidesPerView: "auto" }) }(), function () { var e, t = $(".js-custom-scroll-nav"), n = t.find(".swiper-container"); if (!(t.length <= 0)) { $(document).on("touchmove", function (e) { e.preventDefault() }); var a = 0, i = ""; t.hasClass("custom-scroll-nav-left") ? (a = "-15deg", i = "RotateLeft") : t.hasClass("custom-scroll-nav-right") && (a = "15deg", i = "RotateRight"); var o = t.data("animate"), s = t.data("animate-type"); e = 0; var r = t.find(".swiper-slide"); r.each(function (t) { e += 100; var n = $(this); setTimeout(function () { return function () { var e = { rotate: a, skewX: a, translate3d: "0, 0, 0" }; 1 >= t && (e.opacity = 1), n.zeptoAnimate(e, 500) } }(t), e) }); var d = $(".js-scroll-nav-blur"), c = $("body").height() / 2; t.find(".swiper-container").css({ height: c, paddingTop: c, overflow: "hidden" }); var l, u = !1, h = 0; n.swiper({ mode: "vertical", calculateHeight: !1, slidesPerView: "auto", freeModeFluid: !0, watchActiveIndex: !0, onTouchMove: function (e) { if (u || (u = !0, l = setTimeout(function () { d.addClass("custom-scroll-nav-blur-show") }, 400)), e.positions.current > -10 && (u = !1, clearTimeout(l), d.removeClass("custom-scroll-nav-blur-show")), e.activeIndex > 1 && h != e.activeIndex && 0 == $(e.getSlide(e.activeIndex)).css("opacity")) if (h = e.activeIndex, "zoom" === o) { var t = 1.2; "zoom_in" === s && (t = .8), $(e.getSlide(e.activeIndex)).css({ opacity: 0, "-webkit-transform": " scale(" + t + ") rotate(" + a + ") skewX(" + a + ") translate3d(0px, 0px, 0px)" }).zeptoAnimate({ opacity: 1, scale: "1", rotate: a, skewX: a, translate3d: "0, 0, 0" }, 400); for (var n = h; n--;) 0 == $(e.getSlide(n)).css("opacity") && $(e.getSlide(n)).css({ opacity: 0, "-webkit-transform": " scale(" + t + ") rotate(" + a + ") skewX(" + a + ") translate3d(0px, 0px, 0px)" }).zeptoAnimate({ opacity: 1, scale: "1", rotate: a, skewX: a, translate3d: "0, 0, 0" }, 400) } else { var r = $(e.getSlide(e.activeIndex)), c = "bounceInLeft" + i; "slide_right" === s && (c = "bounceInRight" + i), r.addClass("animated " + c); for (var n = h; n--;) 0 == $(e.getSlide(n)).css("opacity") && $(e.getSlide(n)).addClass("animated " + c) } }, onTouchEnd: function (e) { e.positions.current > -10 && (u = !1, clearTimeout(l)) } }) } }() } }(), define("wap/showcase/modules/swiper/swiper_init", function () { }), require(["vendor/zepto/outer", "wap/showcase/footer", "wap/showcase/homepage/homepage", "wap/uc/title", "wap/showcase/shop_nav/main", "wap/showcase/modules/swiper/swiper_init"], function () { }), define("main", function () { });

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。