Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (() => {
- if (uplayData.authenticated !== "true") {
- return;
- }
- let triedProducts = {};
- let newActivited = {};
- jQuery('button.add-to-library').each((i, el) => {
- const btn = jQuery(el);
- const packageId = btn.data("subscription-package-id");
- const productId = btn.data('product-id');
- const productName = btn.closest('div.card-overlay').data('tc100').productName;
- if (productId != "5b06a39a4e0165fa45ffdcfd") return;
- if (!productId) {
- const tile = btn.parents('product-tile');
- const slide = btn.parents('.pass-page-slide');
- tile.length ? productId = tile.data('itemid') : slide && (productId = slide.data('productId'))
- }
- if (productId && packageId != null && triedProducts[productId] === undefined) {
- triedProducts[productId] = productName;
- let status = "未知错误";
- if ("true" === uplayData.authenticated && null != packageId) {
- $.ajax({
- async: false,
- url: Urls.activateSubscriptionProduct,
- data: { productID: productId }
- }).done(function(data) {
- const result = JSON.parse(data);
- status = result.success ? "成功添加" : "激活失败";
- });
- }
- console.log(`${status} ${productId} ${productName}`);
- }
- });
- console.log(`Total: ${Object.keys(triedProducts).length}, New Activited: ${Object.keys(newActivited).length}`);
- })()
Add Comment
Please, Sign In to add comment