@etspress/netflix 0.1.18 → 0.1.20
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 +3 -0
- package/public/console.js +9 -6
- package/public/home.css +3 -0
- package/public/home.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etspress/netflix",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
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.20",
|
|
22
22
|
"runtime": {
|
|
23
23
|
"type": "npm-static",
|
|
24
24
|
"publicRoot": "public"
|
package/plugin.json
CHANGED
package/public/console.css
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#netflix-theme-home.nfc-console .nfc-side-icon .nfh-tool-icon svg{width:17px;height:17px;fill:currentColor;stroke:none}
|
|
19
19
|
#netflix-theme-home.nfc-console .nfc-side-chevron{margin-left:auto;font-size:20px;line-height:1}
|
|
20
20
|
#netflix-theme-home.nfc-console .nfc-logout{margin-top:10px;border-top:1px solid #eee;border-radius:0;padding-top:14px}
|
|
21
|
+
#netflix-theme-home.nfc-console .nfc-mobile-logout{display:none}
|
|
21
22
|
#netflix-theme-home.nfc-console .nfc-main{min-width:0}
|
|
22
23
|
#netflix-theme-home.nfc-console .nfc-page-content{display:grid;gap:18px}
|
|
23
24
|
#netflix-theme-home.nfc-console .nfc-info-banner{display:flex;width:367px;max-width:100%;min-height:56px;padding:9px 14px;align-items:center;gap:10px;color:#292929;background:#fdf4e6;border-radius:11px;text-decoration:none}
|
|
@@ -201,6 +202,8 @@
|
|
|
201
202
|
#netflix-theme-home.nfc-console .nfc-layout{display:block;width:calc(100% - 24px);margin:12px auto 50px}
|
|
202
203
|
#netflix-theme-home.nfc-console .nfc-sidebar{position:static;min-height:0;margin-bottom:12px;padding:8px;border-radius:7px}
|
|
203
204
|
#netflix-theme-home.nfc-console .nfc-account,#netflix-theme-home.nfc-console .nfc-logout{display:none}
|
|
205
|
+
#netflix-theme-home.nfc-console .nfc-mobile-logout{display:flex;width:100%;min-height:42px;margin:4px 0 8px;padding:9px 12px;align-items:center;justify-content:center;gap:8px;color:#ed4f51;background:#fff;border:1px solid #f1d0cf;border-radius:7px;font:inherit;font-size:13px;font-weight:500;cursor:pointer}
|
|
206
|
+
#netflix-theme-home.nfc-console .nfc-mobile-logout svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
|
|
204
207
|
#netflix-theme-home.nfc-console .nfc-sidebar nav{display:flex;overflow:auto;gap:5px}
|
|
205
208
|
#netflix-theme-home.nfc-console .nfc-side-link{width:auto;min-height:34px;padding:6px 10px;white-space:nowrap}
|
|
206
209
|
#netflix-theme-home.nfc-console .nfc-side-chevron{display:none}
|
package/public/console.js
CHANGED
|
@@ -249,11 +249,7 @@
|
|
|
249
249
|
document.body.appendChild(root);
|
|
250
250
|
animateThemePage(root.querySelector('.nfc-page-content'));
|
|
251
251
|
document.documentElement.classList.remove('nfc-auth-route-pending');
|
|
252
|
-
root.querySelector('.nfc-logout').addEventListener('click',
|
|
253
|
-
localStorage.removeItem('user_token');
|
|
254
|
-
localStorage.removeItem('user_profile');
|
|
255
|
-
location.href = '/auth/login';
|
|
256
|
-
});
|
|
252
|
+
root.querySelector('.nfc-logout').addEventListener('click', logoutUser);
|
|
257
253
|
var language = root.querySelector('.nfc-language');
|
|
258
254
|
language.value = localStorage.getItem('locale') || 'zh-CN';
|
|
259
255
|
language.addEventListener('change', function () { localStorage.setItem('locale', language.value); location.reload(); });
|
|
@@ -520,14 +516,21 @@
|
|
|
520
516
|
return false;
|
|
521
517
|
}
|
|
522
518
|
|
|
519
|
+
function logoutUser() {
|
|
520
|
+
localStorage.removeItem('user_token');
|
|
521
|
+
localStorage.removeItem('user_profile');
|
|
522
|
+
location.href = '/auth/login';
|
|
523
|
+
}
|
|
524
|
+
|
|
523
525
|
function renderAccount() {
|
|
524
526
|
var p = accountProfile || {};
|
|
525
527
|
var avatar = safeHref(p.avatar_url || p.avatar || '', '');
|
|
526
528
|
var avatarMarkup = avatar ? '<img src="' + escapeHtml(avatar) + '" alt="">' : escapeHtml(String(p.nickname || p.email || 'U').charAt(0).toUpperCase());
|
|
527
529
|
var content = '<div class="nfc-section-title"><h1>个人中心</h1><a class="nfc-refresh" href="/me/profile">编辑资料</a></div>' +
|
|
528
530
|
'<section class="nfc-panel nfc-account-hero"><span class="nfc-avatar">' + avatarMarkup + '</span><div><h2>' + escapeHtml(p.nickname || p.email || '用户') + '</h2><p>' + escapeHtml(p.email || '账号信息') + '</p></div><a href="/me/profile">账户设置 ›</a></section>' +
|
|
529
|
-
'<section class="nfc-account-grid"><a class="nfc-panel nfc-account-tile" href="/me/orders"><strong>我的车票</strong><span>查看订单与车票状态 ›</span></a><a class="nfc-panel nfc-account-tile" href="/me/affiliate"><strong>我的推广</strong><span>推广链接与返佣记录 ›</span></a><a class="nfc-panel nfc-account-tile" href="/me/wallet"><strong>我的钱包</strong><span>余额 ' + escapeHtml(formatMoney(walletAccount.balance_amount || walletAccount.balance || 0, walletAccount.currency)) + ' ›</span></a><a class="nfc-panel nfc-account-tile" href="/me/profile"><strong>个人资料</strong><span>昵称与账号安全 ›</span></a></section>';
|
|
531
|
+
'<section class="nfc-account-grid"><a class="nfc-panel nfc-account-tile" href="/me/orders"><strong>我的车票</strong><span>查看订单与车票状态 ›</span></a><a class="nfc-panel nfc-account-tile" href="/me/affiliate"><strong>我的推广</strong><span>推广链接与返佣记录 ›</span></a><a class="nfc-panel nfc-account-tile" href="/me/wallet"><strong>我的钱包</strong><span>余额 ' + escapeHtml(formatMoney(walletAccount.balance_amount || walletAccount.balance || 0, walletAccount.currency)) + ' ›</span></a><a class="nfc-panel nfc-account-tile" href="/me/profile"><strong>个人资料</strong><span>昵称与账号安全 ›</span></a></section><button class="nfc-mobile-logout" type="button"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M10 17l5-5-5-5m5 5H3m9-9h6a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3h-6"/></svg>退出登录</button>';
|
|
530
532
|
pageReady('account', content);
|
|
533
|
+
root.querySelector('.nfc-mobile-logout').addEventListener('click', logoutUser);
|
|
531
534
|
}
|
|
532
535
|
|
|
533
536
|
function renderProfile() {
|
package/public/home.css
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
line-height: 1.5;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
html.nfh-theme-active,
|
|
16
|
+
body.nfh-theme-active { background-color: #ef5350 !important; }
|
|
17
|
+
|
|
15
18
|
#netflix-theme-home *, #netflix-theme-home *::before, #netflix-theme-home *::after { box-sizing: border-box; }
|
|
16
19
|
#netflix-theme-home a { color: inherit; text-decoration: none; }
|
|
17
20
|
#netflix-theme-home button { font: inherit; }
|
package/public/home.js
CHANGED
|
@@ -396,6 +396,8 @@
|
|
|
396
396
|
if (!host) { root = null; return false; }
|
|
397
397
|
hostDisplay = host.style.display;
|
|
398
398
|
host.style.display = 'none';
|
|
399
|
+
document.documentElement.classList.add('nfh-theme-active');
|
|
400
|
+
document.body.classList.add('nfh-theme-active');
|
|
399
401
|
document.body.appendChild(root);
|
|
400
402
|
animateThemeEnter(root);
|
|
401
403
|
mountPurchaseDialog(productConfig || {}, products);
|
|
@@ -465,6 +467,8 @@
|
|
|
465
467
|
|
|
466
468
|
function unmount() {
|
|
467
469
|
if (root) root.remove();
|
|
470
|
+
document.documentElement.classList.remove('nfh-theme-active');
|
|
471
|
+
document.body.classList.remove('nfh-theme-active');
|
|
468
472
|
if (host && host.isConnected) host.style.display = hostDisplay;
|
|
469
473
|
if (stylesheet) stylesheet.remove();
|
|
470
474
|
if (scrollHandler) window.removeEventListener('scroll', scrollHandler);
|