/** * static.cms - v1.0.0 License By * WEB小组 */ $(function() { function t() { return { autoplay: !0, direction: "horizontal", loop: !0 } } function a(a, e) { a = new Swiper(e, t()), $(e).find(".swiper-slide").length - 2 < 2 } function e() { if (u <= 3 || v) return ! 1; v = !0, $(".yh_ul li").hide(); for (var t = new Array, a = 0; a < u; a++) t.push(a); for (t = n(t, f); t.length > 3;) t.splice(i(0, t.length - 1), 1); t.length < 3 && $.each(f, function(a, e) { if (t.push(e), t.length >= 3) return ! 1 }), f = t, $.each(t, function(t, a) { $(".yh_ul li").eq(a).show() }), v = !1 } function n(t, a) { return $.merge($.grep(t, function(t) { return $.inArray(t, a) == -1 }), $.grep(a, function(a) { return $.inArray(a, t) == -1 })) } function i(t, a) { return Math.floor(Math.random() * (a - t)) + t } function s(t) { return 1 == t.toString().length ? "0" + t: t } function l() { var t = $(".cent.ddq .time").attr("data-next1_date"), a = $(".cent.ddq .time").attr("data-next1_hour"), e = $(".cent.ddq .time").attr("data-next2_date"), n = $(".cent.ddq .time").attr("data-next2_hour"), i = (new Date).getFullYear() + "-" + s((new Date).getMonth() + 1) + "-" + s((new Date).getDate()), l = (new Date).getHours(), r = (new Date).getMinutes(), c = (new Date).getSeconds(), o = new RegExp(i), d = o.test(t); if (d !== !1) if (a - l > 0) { var p = s(a - l - 1), h = s(59 - r), u = s(60 - c); $(".cent.ddq .time .cc_hour").html(p), $(".cent.ddq .time .cc_min").html(h), $(".cent.ddq .time .cc_sec").html(u) } else { var f = new RegExp(i), d = f.test(e), h = s(59 - r), u = s(60 - c); d !== !1 ? _h2 = s(n - l - 1) : _h2 = s(n - l + 23), $(".cent.ddq .time .cc_hour").html(_h2), $(".cent.ddq .time .cc_min").html(h), $(".cent.ddq .time .cc_sec").html(u) } else { var p = s(a - l + 23), h = s(59 - r), u = s(60 - c); $(".cent.ddq .time .cc_hour").html(p), $(".cent.ddq .time .cc_min").html(h), $(".cent.ddq .time .cc_sec").html(u) } } var r = new Swiper(".banner-center", { direction: "horizontal", loop: !0, autoplay: { disableOnInteraction: !1 }, pagination: { el: ".swiper-pagination", clickable: !0 }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev" } }); $(".banner-center .swiper-slide").length - 2 > 1 && $(".swiper-pagination").show(); try { r.el.onmouseenter = function() { $(".banner-center .swiper-slide").length - 2 > 1 && (r.navigation.$nextEl.addClass("show"), r.navigation.$prevEl.addClass("show")) }, r.el.onmouseleave = function() { $(".banner-center .swiper-slide").length - 2 > 1 && (r.navigation.$nextEl.removeClass("show"), r.navigation.$prevEl.removeClass("show")) } } catch(c) {} new Swiper(".notice", { direction: "vertical", loop: !0 }); $(".com_banner").each(function(t) { $(this).find(".swiper-slide").length > 1 && a($(this).attr("banner-id"), "." + $(this).attr("banner-id")) }); var o = $("#nav").children("a").length; o >= 11 && $("#nav").children("[data-dtk-satc]").css({ "padding-left": 20 }); var d = $(".cent.ddq .list").length, p = new Array(0, 1, 2, 3), h = !1; $(".cent.ddq .change").on("click", function() { if (d <= 4 || h) return ! 1; h = !0, $(".cent.ddq .list").hide(); for (var t = new Array, a = 0; a < d; a++) t.push(a); for (t = n(t, p); t.length > 4;) t.splice(i(0, t.length - 1), 1); t.length < 4 && $.each(p, function(a, e) { if (t.push(e), t.length >= 4) return ! 1 }), p = t, $.each(t, function(t, a) { $(".cent.ddq .list").eq(a).show() }), h = !1 }); var u = $(".yh_ul li").length, f = new Array(0, 1, 2), v = !1; setInterval(function() { e() }, 1e4); l(); setInterval(function() { l() }, 1e3); $(window).scrollTop() > 200 ? $(".to_top").slideDown() : $(".to_top").slideUp(), $(window).scroll(function() { $(window).scrollTop() > 200 ? $(".to_top").slideDown() : $(".to_top").slideUp() }), $(".list-tab span").on("click", function() { $(".list-tab span").removeClass("act").eq($(this).index()).addClass("act"), $(".list_top").hide().eq($(this).index()).show(), $(".list_bt").hide().eq($(this).index()).show() }), $(".list-tab").siblings(".more").on("click", function() { window.open($(this).data("href") + "&type=" + parseInt($(".list-tab span.act").index() + 1), "_blank") }) }), ! function() { var t = $("#homeGoodsItem"); if (0 == t.length) return ! 1; for (var a = function(t, a) { var e = configObjGen(t, n), i = e.base_price_text || "", s = e.base_price || "原价", l = e.base_sale_num_text || "销量", r = e.single_pc_label_switch || "0", c = e.normal_label || ""; return '
' + t.d_title + '' + ("1" === r && c ? '
' + activityTagStr(t.quan_m_link, t.hz_quan_over) + "
" + redPocketGen(t, "") : "") + '

' + (t.istmall && 0 == parseInt(t.istmall) ? '': '') + t.d_title + '

' + s + " " + t.yuanjia + ' ' + l + " " + t.xiaoliang + '
' + i + '
' + accSub(t.jiage, t.market_group.split(",").indexOf("6") > -1 ? t.hz_quan_over: 0) + ' ' + t.quan_jine + "元券
" }, e = "", n = ActivityConfig ? JSON.parse(ActivityConfig) : {}, i = lsitData.length - 1; i >= 0; i--) e += a(lsitData[i], i); t.html(e) } (), ! function() { var t = $("#goodsItems"); if (0 == t.length) return ! 1; for (var a = function(t, a) { var e = ActivityConfig ? JSON.parse(ActivityConfig) : {}, n = configObjGen(t, e), i = n.base_price_text || "", s = n.base_price || "原价", l = n.base_sale_num_text || "销量", r = n.single_pc_label_switch || "0", c = n.normal_label || ""; return '
  • ' + (1 == parseInt(t.activity_type_3) && parseInt(t.hz_quan_over) > 0 ? '付' + t.quan_m_link + "减" + t.hz_quan_over + "": "") + (1 == parseInt(t.activity_type_3) && parseInt(t.hz_quan_over) <= 0 ? '': "") + (1 == parseInt(t.activity_type_4) ? '': "") + (1 == parseInt(t.activity_type_6) ? '': "") + (1 == parseInt(t.activity_type_7) ? '': "") + (1 == parseInt(t.activity_type_8) ? '' + (t.quan_m_link > 0 ? "定金" + t.quan_m_link + (t.hz_quan_over > 0 ? "立减" + t.hz_quan_over: "") + "": "") + "": "") + (1 == parseInt(t.activity_type_9) ? '': "") + '' + t.d_title + '' + ("1" === r && c ? '
    ' + activityTagStr(t.quan_m_link, t.hz_quan_over) + "
    " + redPocketGen(t, "") : "") + '
    ' + s + " " + t.yuanjia + '' + l + " " + t.xiaoliang + '
    ' + i + "
    " + accSub(t.jiage, 1 == parseInt(t.activity_type_8) || t.market_group.split(",").indexOf("6") > -1 ? t.hz_quan_over: 0) + '
    ' + t.quan_jine + ' 元券
  • ' }, e = "", n = 0; n < lsitData.length; n++) e += a(lsitData[n], n); t.html(e) } (), ! function() { function t(t) { var a = t.parent().parent(), e = t, n = a.find(".search-land li.active").length > 0 ? a.find(".search-land li.active").index() : 0; if (40 == event.keyCode) return n = a.find(".search-land li.active").length ? n + 1 : 0, n = n > a.find(".search-land li").length - 1 ? 0 : n, a.find(".search-land li").removeClass("active"), a.find(".search-land").find("li:eq(" + n + ")").addClass("active"), t.val(a.find(".search-land li.active").html()), !1; if (38 == event.keyCode) return n = a.find(".search-land li.active").length ? n - 1 : a.find(".search-land li").length - 1, n = n < 0 ? a.find(".search-land li").length - 1 : n, a.find(".search-land li").removeClass("active"), a.find(".search-land").find("li:eq(" + n + ")").addClass("active"), t.val(a.find(".search-land li.active").html()), !1; const i = t.parents("form").siblings(".search-land"), s = t.val(); var l = ""; l = s.replace(/\s+/g, ""), 0 == l.length ? ($(".src-close-btn").hide(), i.hide()) : $(".src-close-btn").show(), $.ajax({ url: _url, type: "get", dataType: "json", data: { kw: s }, success: function(a) { "1" == a.status && (0 == a.data.length || (e.parent("form").siblings(".search-land").show(), e.parent("form").siblings(".search-land").find("li").each(function(n) { n > a.data.length - 1 ? e.parent("form").siblings(".search-land").find("li").eq(n).hide() : "" == t.val() || e.parent("form").siblings(".search-land").find("li").eq(n).show().html(a.data[n]) }))); const n = e.val(); var s = ""; s = n.replace(/\s+/g, ""), 0 == s.length ? ($(".src-close-btn").hide(), i.hide()) : $(".src-close-btn").show() } }) } window.SetHome = function(t, a) { try { t.style.behavior = "url(#default#homepage)", t.setHomePage(a) } catch(e) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect") } catch(e) { layer.msg("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。") } var n = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); n.setCharPref("browser.startup.homepage", a) } else layer.msg("您的浏览器不支持,请按照下面步骤操作:\n 1.打开浏览器设置。\n 2.点击设置首页。\n 3.输入:" + a + "点击确定。") } }, window.shoucang = function(t, a) { try { window.external.addFavorite(a, t) } catch(e) { try { window.sidebar.addPanel(t, a, "") } catch(e) { layer.msg("加入收藏失败,请使用Ctrl+D进行添加") } } }; $(function() { $("#search button").click(function() { if ($('#search input[name="kw"]').val().length > 30) return layer.msg("您搜索的关键词过长!", { timer: 2500 }), !1 }), $(window).scroll(function() { $(window).scrollTop() > 500 ? $(".toTop").fadeIn(1e3) : $(".toTop").fadeOut(1e3) }) }), $(window).scroll(function() { var t = $(window).scrollTop(); t > 130 ? ($(".floatNav").fadeIn(), $(".floatNav .fn-block").width(1200 - $(".fn-left").width() - 47), $(".floatNav .fn-block .my-src-input").width(1200 - $(".fn-left").width() - 147), $(".floatNav .w_1200 .search-land").width(1200 - $(".fn-left").width() - 50), $(".search-land").eq(0).fadeOut()) : $(".floatNav").fadeOut() }); var a = "input"; navigator.userAgent.indexOf("MSIE") != -1 && (a = "propertychange"), $(".my-src-input").focus(function() { jQuery.fn.isChildAndSelfOf = function(t) { return this.closest(t).length > 0 }; var a = $(this).parent().parent(); $("body").unbind("click").on("click", function(t) { $(t.target).isChildAndSelfOf(a) || $(".search-land").hide() }), t($(this)) }).keyup(function(a) { t($(this)), "" == $(this).val() && $(this).parent("form").siblings(".search-land").find("li").text("") }), $(".search-land").on("click", "li", function() { $(".my-src-input").val($(this).text()), $(".my-src-btn").trigger("click") }), $(".search-land").on("click", "p", function() { $(".search-land").hide() }), $(".src-close-btn").click(function() { $(".src-close-btn").hide(), $(".search-land").hide(), "" == $(".my-src-input").attr("value") ? $(".my-src-input").val("") : $(".my-src-input").val("").attr("placeholder", "请输入要搜索的词") }), $("#search button").on("click", function() { var t = $(this); return "" == $(this).siblings('input[name="kw"]').val() && "" != kw_url ? (window.location.href = $("#m_url").val(), !1) : void t.parents("form").attr("action", $("#h_url").val()) }), $(".floatNav .srcBtn").on("click", function() { var t = $(this); return "" == $("#float-src-input").val() && "" !== kw_url ? (window.location.href = $("#m_url").val(), !1) : void t.parents("form").attr("action", $("#h_url").val()) }), function() { var t = $("#loseProductItems"); if (0 == t.length) return ! 1; for (var a = function(t, a) { return '
    ' + t.d_title + '

    ' + (t.istmall && 0 == parseInt(t.istmall) ? '': '') + t.d_title + '

    原价 ' + t.yuanjia + ' 销量 ' + t.xiaoliang + '
    ' + t.jiage + ' ' + t.quan_jine + "元券
    " }, e = "", n = listData.length - 1; n >= 0; n--) e += a(listData[n], n); t.html(e) } () } ();