if (localStorage.getItem("mandarin-vip") == "true") { details = JSON.parse(localStorage.getItem("mandarin-details")); $.ajax({ type: "GET", url: `https://vip.mandarin.club/details_refresh?email=${details["email"]}`, dataType: "text", success: function (data) { if (data == "login failed") { } else { localStorage.setItem("mandarin-vip", "true"); localStorage.setItem("mandarin-details", data); } }, error: function (data) { console.log(data); }, }); function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } details = JSON.parse(localStorage.getItem("mandarin-details")); current_credit = (Number(details["credits"]) / 100).toFixed(2); if (details["class"] == "abundance") { $(".store-logo").each((index, elem) => { $(elem).find("a").empty(); $(elem) .find("a") .append(``); }); $(".header-minimal").css("background-color","black") $(".main-header-wrap").css("background-color","black") $(".store-logo").css("transform","scale(1.1)") $(".nav-item").find(".label").css("color","#debc99") $(".list-item").find("a").css("color","#debc99") $(".mini-cart-wrap").css("margin-right","-6px") $("#localization_form").html( `
CR ${numberWithCommas( current_credit )}
` ); $(".account-options").attr("href", "https://mandarin.club/pages/vip-info-v2"); } else { $(".store-logo").each((index, elem) => { $(elem).find("a").empty(); $(elem) .find("a") .append(``); }); $("#localization_form").html( `
CR ${numberWithCommas( current_credit )}
` ); $(".account-options").attr("href", "https://mandarin.club/pages/vip-info"); } interval_debug = false; setInterval(function () { if (!interval_debug) { $(".blocker").remove(); $(".blocker-buynow").remove(); $(".checkout,.cart-mini-actions__checkout").prepend(`
`); $(".shopify-payment-button").prepend(`
`); $(".blocker").on("click", () => { location.assign("https://mandarin.club/pages/vip-checkout"); }); $(".blocker-buynow").on("click", () => { $(".shopify-payment-button__button--unbranded").text("添加中­..."); if (window.location.search.includes("variant")) { Shopify.addItem(window.location.search.split("=")[1]); } else { Shopify.addItem(meta.product.variants[0].id); } }); Shopify.onCartUpdate = function (t) {}; Shopify.onItemAdded = function (t) { window.setTimeout(function () { location.assign("https://mandarin.club/pages/vip-checkout"); }, 1000); }; } }, 500); } else { $(".account-options").attr("href", "https://mandarin.club/pages/vip-login"); if (decodeURI(location.pathname).includes("好眠喷雾-pillow-mist")) { location.replace("https://mandarin.club"); } }