"use strict"; $(function() { function e(e) { switch (e = e.replace("Default", "default")) { case "/cz/recharge/index": return "cz"; case "/card/default/cardList": return "card"; case "/newcard/default/cardListSelected": return "newcard"; case "/otherIndustry/default/index": return "otherIndustry"; case "/cardNum/default/cardNumList": return "cardNum"; case "/video/default/index_list": return "video"; case "/ringing/index": return "ringing"; case "/videoringing/default/index": return "videoringing"; case "/phoneCharge/default/index": return "cz"; case "/appfreeflow/default/gameFreeFlow": return "appfreeflow"; case "/freeFlow/default/index": return "freeFlow"; case "/outlink/default/outlink0": return "outlink0"; case "/outlink/default/outlink1": return "outlink1"; case "/outlink/default/outlink2": return "outlink2"; case "/outlink/default/outlink3": return "outlink3"; case "/outlink/default/outlink4": return "outlink4" } } function t() { var e = window.location.pathname , t = e.split("/"); i("outlink" == t[1] ? t[3] : t[1]) } function i(e) { $("#top-menu .item").removeClass("active"), "cz" == e ? $("#top-menu .cz").addClass("active") : "card" == e ? $("#top-menu .card").addClass("active") : "newcard" == e ? $("#top-menu .newcard").addClass("active") : "cardNum" == e ? $("#top-menu .cardNum").addClass("active") : "otherIndustry" == e ? $("#top-menu .otherIndustry").addClass("active") : "video" == e ? $("#top-menu .video").addClass("active") : "ring" == e ? $("#top-menu .ringing").addClass("active") : "videoringing" == e ? $("#top-menu .videoringing").addClass("active") : "phoneCharge" == e ? $("#top-menu .cz").addClass("active") : "appfreeflow" == e ? $("#top-menu .appfreeflow").addClass("active") : "freeFlow" == e ? $("#top-menu .freeFlow").addClass("active") : "outlink0" == e ? $("#top-menu .outlink0").addClass("active") : "outlink1" == e ? $("#top-menu .outlink1").addClass("active") : "outlink2" == e ? $("#top-menu .outlink2").addClass("active") : "outlink3" == e ? $("#top-menu .outlink3").addClass("active") : "outlink4" == e && $("#top-menu .outlink4").addClass("active") } function a() { var e = $(".scroll-inner .item").width(); o.find(".item").length < 5 ? o.removeClass("has-shadow") : o.find(".item:nth-child(5)").position().left < o.scrollLeft() + 4 * e ? o.removeClass("has-shadow") : o.addClass("has-shadow") } var n = 0 , o = $("#top-menu .scroll-inner"); // common.ajax("/Public/getMenuList", { // digest: common.getQuery("digest") // }, { // success: function(i) { // for (var n = i.list, s = "", l = "&" + location.href.split("&")[location.href.split("&").length - 1], r = location.href.replace(location.origin, "").replace(l, ""), c = 0; c < n.length; c++) { // var d = n[c] // , u = d.path.split("?")[0] // , m = e(u); // if (2 == d.is_brank) { // var f = d.path.split("?")[0].split("/")[3]; // s += '' + d.name + "", // r == d.path && (document.title = d.name) // } else // "/videoringing/Default/activity" == d.path && (m = "videoringing"), // s += '' + d.name + "" // } // o.html(s), // t(), // $(".scroll-inner").scrollLeft(localStorage.getItem("menuScrollLeft")), // a(); // var p = [] // , h = []; // localStorage.getItem("locationNav") ? (p = JSON.parse(localStorage.getItem("locationNav")), // h = JSON.parse(localStorage.getItem("isClickNav")), // n.forEach(function(e, t) { // p.forEach(function(i, a) { // i.path == e.path && (i.is_mark != e.is_mark ? (1 == e.is_mark ? $("#top-menu .item").eq(t).find("i").css("display", "none") : ($("#top-menu .item").eq(t).find("i").css("display", "block"), // h.forEach(function(t) { // t.path == e.path && (t.isClick = !1) // })), // p[a].is_mark = e.is_mark) : (2 == e.is_mark ? $("#top-menu .item").eq(t).find("i").css("display", "block") : $("#top-menu .item").eq(t).find("i").css("display", "none"), // h.forEach(function(i) { // i.path == e.path && (i.isClick ? $("#top-menu .item").eq(t).find("i").css("display", "none") : $("#top-menu .item").eq(t).find("i").css("display", "block")) // }))) // }) // }), // localStorage.setItem("locationNav", JSON.stringify(p)), // localStorage.setItem("isClickNav", JSON.stringify(h))) : (n.forEach(function(e, t) { // 2 == e.is_mark ? $("#top-menu .item").eq(t).find("i").css("display", "block") : $("#top-menu .item").eq(t).find("i").css("display", "none"), // p.push({ // path: e.path, // is_mark: e.is_mark // }) // }), // localStorage.setItem("locationNav", JSON.stringify(p)), // localStorage.setItem("isClickNav", JSON.stringify([]))), // $("#top-menu .item").click(function() { // var e = $(this).data("isoutlink") // , t = $(this).data("isneeddigest") // , i = $(this).data("url") // , a = JSON.parse(localStorage.getItem("isClickNav")) // , n = []; // if (0 == a.length) // n.push({ // path: i, // isClick: !0 // }); // else { // for (var o = !1, s = 0; s < a.length; s++) // i == a[s].path && (o = !0); // o ? a.forEach(function(e, t) { // i == e.path && (e.isClick = !0) // }) : a.push({ // path: i, // isClick: !0 // }) // } // $(this).find("i").css("display", "none"), // localStorage.setItem("isClickNav", JSON.stringify(n.concat(a))), // 2 == e ? 1 == t ? i.split("?").length > 2 ? location.href = i + "&digest=" + common.getQuery("digest", location.href) : location.href = i + "?digest=" + common.getQuery("digest", location.href) : location.href = i.split("?url=")[1] : i.indexOf("?") > 0 ? location.href = i + "&digest=" + common.getQuery("digest", location.href) : location.href = i + "?digest=" + common.getQuery("digest", location.href) // }) // } // }), o.scroll(function() { $(".scroll-inner .item").width(); n = $(this).scrollLeft(), localStorage.setItem("menuScrollLeft", n), a() }) });