@etspress/netflix 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/public/console.css +21 -16
- package/public/console.js +9 -3
- package/public/inject.js +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etspress/netflix",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "流媒体合租主题插件",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"id": "netflix",
|
|
19
19
|
"name": "流媒体合租主题",
|
|
20
20
|
"description": "流媒体合租商店主题与页面展示配置",
|
|
21
|
-
"version": "0.1.
|
|
21
|
+
"version": "0.1.11",
|
|
22
22
|
"runtime": {
|
|
23
23
|
"type": "npm-static",
|
|
24
24
|
"publicRoot": "public"
|
package/plugin.json
CHANGED
package/public/console.css
CHANGED
|
@@ -64,17 +64,18 @@
|
|
|
64
64
|
#netflix-theme-home.nfc-console .nfc-pagination button{padding:7px 12px;color:#666;background:#fff;border:1px solid #e8e8e8;border-radius:5px;font:inherit;cursor:pointer}
|
|
65
65
|
#netflix-theme-home.nfc-console .nfc-pagination button:disabled{opacity:.45;cursor:not-allowed}
|
|
66
66
|
#netflix-theme-home.nfc-console .nfc-promo-top{display:grid;grid-template-columns:1.55fr 1fr 1fr;gap:18px}
|
|
67
|
-
#netflix-theme-home.nfc-console .nfc-link-panel{display:
|
|
67
|
+
#netflix-theme-home.nfc-console .nfc-link-panel{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:12px}
|
|
68
|
+
#netflix-theme-home.nfc-console .nfc-link-panel.has-qr{grid-template-columns:minmax(0,1fr) 88px}
|
|
68
69
|
#netflix-theme-home.nfc-console .nfc-link-content{min-width:0;flex:1}
|
|
69
|
-
#netflix-theme-home.nfc-console .nfc-link-
|
|
70
|
-
#netflix-theme-home.nfc-console .nfc-link-panel
|
|
71
|
-
#netflix-theme-home.nfc-console .nfc-link-panel
|
|
72
|
-
#netflix-theme-home.nfc-console .nfc-link-panel .nfc-copyline
|
|
73
|
-
#netflix-theme-home.nfc-console .nfc-link-panel .nfc-copyline
|
|
74
|
-
#netflix-theme-home.nfc-console .nfc-link-panel
|
|
75
|
-
#netflix-theme-home.nfc-console .nfc-
|
|
76
|
-
#netflix-theme-home.nfc-console .nfc-promo-qr-wrap{display:flex;
|
|
77
|
-
#netflix-theme-home.nfc-console .nfc-promo-qr{display:block;width:
|
|
70
|
+
#netflix-theme-home.nfc-console .nfc-link-content{flex:none;width:100%}
|
|
71
|
+
#netflix-theme-home.nfc-console .nfc-link-panel,#netflix-theme-home.nfc-console .nfc-code-panel{min-height:246px;padding:24px 24px;border:1px solid #f0f0f0;border-radius:14px}
|
|
72
|
+
#netflix-theme-home.nfc-console .nfc-link-panel h1,#netflix-theme-home.nfc-console .nfc-code-panel h2{font-size:19px;font-weight:600;line-height:1.4}
|
|
73
|
+
#netflix-theme-home.nfc-console .nfc-link-panel .nfc-copyline,#netflix-theme-home.nfc-console .nfc-code-panel .nfc-copyline,#netflix-theme-home.nfc-console .nfc-code-panel .nfc-affiliate-closed,#netflix-theme-home.nfc-console .nfc-promo-code-form{min-height:44px;margin-top:12px;padding:4px;border:1px solid #ededed;border-radius:8px}
|
|
74
|
+
#netflix-theme-home.nfc-console .nfc-link-panel .nfc-copyline input,#netflix-theme-home.nfc-console .nfc-code-panel .nfc-copyline input,#netflix-theme-home.nfc-console .nfc-promo-code-form input{padding:6px 9px;font-size:13px}
|
|
75
|
+
#netflix-theme-home.nfc-console .nfc-link-panel .nfc-copyline button,#netflix-theme-home.nfc-console .nfc-code-panel .nfc-copyline button,#netflix-theme-home.nfc-console .nfc-code-panel .nfc-affiliate-closed button,#netflix-theme-home.nfc-console .nfc-promo-code-form button{min-width:64px;padding:6px 12px;border-radius:6px;font-size:14px}
|
|
76
|
+
#netflix-theme-home.nfc-console .nfc-link-panel>p,#netflix-theme-home.nfc-console .nfc-code-panel>p{margin-top:12px;font-size:14px;line-height:1.6}
|
|
77
|
+
#netflix-theme-home.nfc-console .nfc-promo-qr-wrap{display:flex;width:88px;align-self:center;align-items:center;justify-content:center;flex-direction:column;gap:5px;color:#888;font-size:11px}
|
|
78
|
+
#netflix-theme-home.nfc-console .nfc-promo-qr{display:block;width:74px;height:74px;padding:4px;background:#fff;border:1px solid #eee;border-radius:7px;image-rendering:pixelated}
|
|
78
79
|
#netflix-theme-home.nfc-console .nfc-promo-code-form{display:flex;min-width:0;margin-top:9px;padding:4px;background:#f4f4f4;border-radius:4px;gap:5px}
|
|
79
80
|
#netflix-theme-home.nfc-console .nfc-promo-code-form input{width:0;min-width:0;flex:1;padding:5px 7px;color:#555;background:transparent;border:0;outline:0;font:inherit;font-size:12px}
|
|
80
81
|
#netflix-theme-home.nfc-console .nfc-promo-code-form button{min-width:55px;padding:5px 10px;color:#333;background:#fff;border:0;border-radius:4px;font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
|
|
@@ -85,9 +86,12 @@
|
|
|
85
86
|
#netflix-theme-home.nfc-console .nfc-copyline{display:flex;min-width:0;margin-top:9px;padding:4px;background:#f4f4f4;border-radius:4px}
|
|
86
87
|
#netflix-theme-home.nfc-console .nfc-copyline input{width:0;min-width:0;flex:1;padding:5px 7px;color:#555;background:transparent;border:0;outline:0;font:inherit;font-size:12px}
|
|
87
88
|
#netflix-theme-home.nfc-console .nfc-copyline button{min-width:47px;padding:5px 9px;color:#333;background:#fff;border:0;border-radius:4px;font:inherit;font-size:12px;cursor:pointer}
|
|
88
|
-
#netflix-theme-home.nfc-console .nfc-affiliate-closed{display:flex;min-height:
|
|
89
|
-
#netflix-theme-home.nfc-console .nfc-affiliate-closed
|
|
90
|
-
#netflix-theme-home.nfc-console .nfc-affiliate-closed
|
|
89
|
+
#netflix-theme-home.nfc-console .nfc-affiliate-closed{display:flex;min-width:0;min-height:44px;margin-top:12px;padding:4px;align-items:center;gap:6px;background:#f5f5f5;border-radius:8px}
|
|
90
|
+
#netflix-theme-home.nfc-console .nfc-affiliate-closed input{width:0;min-width:0;flex:1;padding:6px 9px;color:#777;background:transparent;border:0;outline:0;font:inherit;font-size:13px}
|
|
91
|
+
#netflix-theme-home.nfc-console .nfc-affiliate-closed input::placeholder{color:#999;opacity:1}
|
|
92
|
+
#netflix-theme-home.nfc-console .nfc-affiliate-closed input{font-size:12px}
|
|
93
|
+
#netflix-theme-home.nfc-console .nfc-affiliate-closed button{min-height:34px;padding:6px 12px;color:#333;background:#fff;border:1px solid #ededed;border-radius:6px;font:inherit;font-size:13px;white-space:nowrap;cursor:pointer}
|
|
94
|
+
#netflix-theme-home.nfc-console .nfc-affiliate-closed button:hover{color:#ef5350;border-color:#f2c9c8}
|
|
91
95
|
#netflix-theme-home.nfc-console .nfc-panel>p{margin:8px 0 0;color:#b48b56;font-size:12px;line-height:1.6}
|
|
92
96
|
#netflix-theme-home.nfc-console .nfc-code-panel>p{color:#b48b56}
|
|
93
97
|
#netflix-theme-home.nfc-console .nfc-range{display:flex;justify-content:flex-end;gap:9px;white-space:nowrap}
|
|
@@ -208,11 +212,12 @@
|
|
|
208
212
|
#netflix-theme-home.nfc-console .nfc-order-stats>div{padding:10px}
|
|
209
213
|
#netflix-theme-home.nfc-console .nfc-order-stats strong{font-size:17px}
|
|
210
214
|
#netflix-theme-home.nfc-console .nfc-promo-top,#netflix-theme-home.nfc-console .nfc-chart-grid{grid-template-columns:1fr}
|
|
211
|
-
#netflix-theme-home.nfc-console .nfc-link-panel,#netflix-theme-home.nfc-console .nfc-code-panel{min-height:0;padding:
|
|
215
|
+
#netflix-theme-home.nfc-console .nfc-link-panel,#netflix-theme-home.nfc-console .nfc-code-panel{min-height:0;padding:16px;border-radius:11px}
|
|
216
|
+
#netflix-theme-home.nfc-console .nfc-link-panel.has-qr{grid-template-columns:minmax(0,1fr) 76px;gap:8px}
|
|
212
217
|
#netflix-theme-home.nfc-console .nfc-link-panel h1,#netflix-theme-home.nfc-console .nfc-code-panel h2{font-size:18px}
|
|
213
218
|
#netflix-theme-home.nfc-console .nfc-link-panel>p,#netflix-theme-home.nfc-console .nfc-code-panel>p{font-size:14px}
|
|
214
|
-
#netflix-theme-home.nfc-console .nfc-promo-qr-wrap{
|
|
215
|
-
#netflix-theme-home.nfc-console .nfc-promo-qr{width:
|
|
219
|
+
#netflix-theme-home.nfc-console .nfc-promo-qr-wrap{width:76px}
|
|
220
|
+
#netflix-theme-home.nfc-console .nfc-promo-qr{width:68px;height:68px}
|
|
216
221
|
#netflix-theme-home.nfc-console .nfc-summary-panel{grid-column:auto}
|
|
217
222
|
#netflix-theme-home.nfc-console .nfc-panel{padding:13px}
|
|
218
223
|
#netflix-theme-home.nfc-console .nfc-metrics strong{font-size:18px}
|
package/public/console.js
CHANGED
|
@@ -243,6 +243,7 @@
|
|
|
243
243
|
'<div class="nfh-language"><label for="nfc-language-select">站点语言</label><select class="nfc-language" id="nfc-language-select"><option value="zh-CN">简体中文</option><option value="zh-TW">繁體中文</option><option value="en-US">English</option></select></div><div class="nfh-footer-bottom"><span>' + escapeHtml(c.copyrightText || '© 2019 - 2026 奈飞小铺') + '</span><div>' + (licenseRows || '<span>辽ICP备2021010230号</span><span class="nfh-license-separator">|</span><span>ICP经营许可证:辽B2-20220360</span>') + '</div></div></div></footer>' +
|
|
244
244
|
mobileNavMarkup(c, page) + '<button class="nfc-to-top" type="button" aria-label="返回顶部">⌃</button>';
|
|
245
245
|
document.body.appendChild(root);
|
|
246
|
+
document.documentElement.classList.remove('nfc-auth-route-pending');
|
|
246
247
|
root.querySelector('.nfc-logout').addEventListener('click', function () {
|
|
247
248
|
localStorage.removeItem('user_token');
|
|
248
249
|
localStorage.removeItem('user_profile');
|
|
@@ -384,17 +385,22 @@
|
|
|
384
385
|
var path = String(info.promotion_path || '/?aff=' + encodeURIComponent(info.affiliate_code));
|
|
385
386
|
link = /^https?:\/\//i.test(path) ? path : location.origin + (path.charAt(0) === '/' ? path : '/' + path);
|
|
386
387
|
}
|
|
388
|
+
var linkLabel = link;
|
|
389
|
+
if (link) {
|
|
390
|
+
try { var parsedLink = new URL(link); linkLabel = parsedLink.host + parsedLink.pathname + parsedLink.search; }
|
|
391
|
+
catch (_error) { linkLabel = link.replace(/^https?:\/\//i, ''); }
|
|
392
|
+
}
|
|
387
393
|
var total = rows.reduce(function (sum, row) { return sum + Number(row.commission_amount || 0); }, 0);
|
|
388
394
|
var orderCount = rows.length;
|
|
389
395
|
var clicks = info.click_count == null ? '—' : info.click_count;
|
|
390
396
|
var qr = link ? '<div class="nfc-promo-qr-wrap"><img class="nfc-promo-qr" data-promo-qr alt="推广二维码"><small>推广二维码</small></div>' : '';
|
|
391
397
|
var codePanel = !info.opened
|
|
392
|
-
? '<div class="nfc-affiliate-closed"><
|
|
398
|
+
? '<div class="nfc-affiliate-closed"><input readonly aria-label="专属推广优惠码" placeholder="开通后设专属码"><button type="button" data-open-affiliate>立即开通</button></div>'
|
|
393
399
|
: affiliatePromoCode
|
|
394
400
|
? '<div class="nfc-copyline nfc-promo-code-value"><input readonly aria-label="专属推广优惠码" value="' + escapeHtml(affiliatePromoCode) + '"><button type="button" data-copy-code>复制</button></div>'
|
|
395
401
|
: '<form class="nfc-promo-code-form" data-promo-code-form><input name="promo_code" maxlength="15" autocomplete="off" placeholder="请输入自定义优惠码"><button type="submit"' + (savingAffiliatePromoCode ? ' disabled' : '') + '>' + (savingAffiliatePromoCode ? '保存中…' : '确定') + '</button></form><div class="nfc-promo-code-error" data-promo-code-error></div>';
|
|
396
402
|
var content =
|
|
397
|
-
'<div class="nfc-promo-top"><section class="nfc-panel nfc-link-panel"><div class="nfc-link-content"><h1>' + escapeHtml(homeConfig.affiliatePageTitle || '推荐朋友购买立享20%佣金') + '</h1><div class="nfc-copyline"><input readonly aria-label="推广链接"
|
|
403
|
+
'<div class="nfc-promo-top"><section class="nfc-panel nfc-link-panel' + (link ? ' has-qr' : '') + '"><div class="nfc-link-content"><h1>' + escapeHtml(homeConfig.affiliatePageTitle || '推荐朋友购买立享20%佣金') + '</h1><div class="nfc-copyline"><input readonly aria-label="推广链接" title="' + escapeHtml(link) + '" value="' + escapeHtml(linkLabel || '开通推广后生成专属链接') + '"><button type="button" data-copy-link aria-label="复制推广链接">复制</button></div><p>' + escapeHtml(homeConfig.affiliatePageDescription || '将链接或二维码发送给好友即可') + '</p><small class="nfc-contact-hint">' + escapeHtml(homeConfig.affiliateContactHint || '') + '</small></div>' + qr + '</section>' +
|
|
398
404
|
'<section class="nfc-panel nfc-code-panel"><h2>' + escapeHtml(homeConfig.affiliateCodeTitle || '专属推广优惠码') + '</h2>' + codePanel + '<p>' + escapeHtml(homeConfig.affiliateCodeHint || '优惠码推广优先级最高,结合推广链接100%精准统计推广订单。') + '</p></section>' +
|
|
399
405
|
'<section class="nfc-panel nfc-summary-panel"><div class="nfc-range">' + rangeButtons() + '</div><div class="nfc-metrics"><div><strong>' + escapeHtml(clicks) + '</strong><span>' + escapeHtml(homeConfig.affiliateClicksLabel || '推广点击') + '</span></div><div><strong>' + orderCount + '</strong><span>' + escapeHtml(homeConfig.affiliateOrdersLabel || '订单数') + '</span></div><div><strong>' + escapeHtml(formatMoney(total)) + '</strong><span>' + escapeHtml(homeConfig.affiliateCommissionLabel || '佣金数') + '</span></div></div><div class="nfc-available"><span>' + escapeHtml(homeConfig.affiliateAvailableLabel || '可提现金额') + ' ' + escapeHtml(formatMoney(info.available_commission || 0)) + '</span><a href="/me/affiliate?native=1">点击提现</a></div></section></div>' +
|
|
400
406
|
'<div class="nfc-chart-grid"><section class="nfc-panel"><h2>订单分布</h2>' + distributionChart(rows) + '</section><section class="nfc-panel"><h2>订单统计</h2>' + chartBars(rows) + '</section></div>' +
|
|
@@ -595,7 +601,7 @@
|
|
|
595
601
|
root = document.createElement('div'); root.id = 'netflix-theme-home'; root.className = 'nfc-console nfc-auth';
|
|
596
602
|
var brand = homeConfig.brandLogoUrl ? '<img src="' + escapeHtml(homeConfig.brandLogoUrl) + '" alt="' + escapeHtml(homeConfig.brandName || '奈飞小铺') + '">' : escapeHtml(homeConfig.brandName || '奈飞小铺');
|
|
597
603
|
root.innerHTML = '<header class="nfh-header"><nav class="nfh-header-inner"><a class="nfh-logo" href="/">' + brand + '</a><div class="nfh-header-right"><div class="nfh-header-nav"><a href="/">' + escapeHtml(homeConfig.navHomeLabel || '首页') + '</a><a href="/me/orders">' + escapeHtml(homeConfig.navProductsLabel || '车票') + '</a><a href="/me/affiliate">' + escapeHtml(homeConfig.navPromotionLabel || '推广') + '</a></div></div></nav></header><main class="nfc-auth-main"><section class="nfc-auth-card"><a class="nfc-auth-back" href="/">‹ 返回首页</a>' + content + '</section></main><footer class="nfc-auth-footer">' + escapeHtml(homeConfig.copyrightText || '© 2019 - 2026 奈飞小铺') + '</footer>';
|
|
598
|
-
document.body.appendChild(root); document.documentElement.classList.add('nfc-active');
|
|
604
|
+
document.body.appendChild(root); document.documentElement.classList.add('nfc-active'); document.documentElement.classList.remove('nfc-auth-route-pending');
|
|
599
605
|
host = document.querySelector('#app'); if (host) {
|
|
600
606
|
if (!hostStateSaved) { hostDisplay = host.style.display; hostVisibility = host.style.visibility; hostStateSaved = true; }
|
|
601
607
|
host.style.visibility = ''; host.style.display = 'none';
|
package/public/inject.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
var pluginId = 'netflix';
|
|
3
3
|
var adminPath = '/admin/';
|
|
4
|
+
var authPath = window.location.pathname;
|
|
5
|
+
if ((authPath === '/auth/login' || authPath === '/auth/register') && new URLSearchParams(window.location.search).get('native') !== '1') {
|
|
6
|
+
document.documentElement.classList.add('nfc-auth-route-pending');
|
|
7
|
+
if (!document.getElementById('nfc-auth-route-gate')) {
|
|
8
|
+
var authGateStyle = document.createElement('style');
|
|
9
|
+
authGateStyle.id = 'nfc-auth-route-gate';
|
|
10
|
+
authGateStyle.textContent = 'html.nfc-auth-route-pending #app{visibility:hidden!important}';
|
|
11
|
+
(document.head || document.documentElement).appendChild(authGateStyle);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
4
14
|
if (window.location.pathname.indexOf(adminPath) !== 0) return;
|
|
5
15
|
if (window.__NETFLIX_THEME_SETTINGS_INJECTOR__) return;
|
|
6
16
|
window.__NETFLIX_THEME_SETTINGS_INJECTOR__ = true;
|