@etspress/netflix 0.1.1 → 0.1.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etspress/netflix",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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.1",
21
+ "version": "0.1.2",
22
22
  "runtime": {
23
23
  "type": "npm-static",
24
24
  "publicRoot": "public"
package/plugin.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schemaVersion": 1,
4
4
  "id": "netflix",
5
5
  "name": "流媒体合租主题",
6
- "version": "0.1.1",
6
+ "version": "0.1.2",
7
7
  "description": "流媒体合租商店主题与页面展示配置。",
8
8
  "author": "D&J Studio",
9
9
  "license": "MIT",
@@ -151,3 +151,8 @@
151
151
  #netflix-theme-home.nfc-console .nfh-footer-bottom{font-size:11px}
152
152
  #netflix-theme-home.nfc-console .nfc-to-top{right:12px;bottom:18px}
153
153
  }
154
+
155
+ @media(max-width:720px){
156
+ #netflix-theme-home.nfc-console .nfc-layout{min-height:calc(100vh - 72px)}
157
+ #netflix-theme-home.nfc-console .nfc-sidebar{display:none}
158
+ }
package/public/console.js CHANGED
@@ -69,6 +69,19 @@
69
69
  return icon ? icon.svg : '';
70
70
  }
71
71
 
72
+ function mobileNavItem(href, label, path, active) {
73
+ return '<a href="' + href + '"' + (active ? ' class="is-active"' : '') + ' aria-label="' + escapeHtml(label) + '"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="' + path + '"/></svg><span>' + escapeHtml(label) + '</span></a>';
74
+ }
75
+
76
+ function mobileNavMarkup(config, page) {
77
+ return '<nav class="nfh-mobile" aria-label="移动导航">' +
78
+ mobileNavItem('/', config.navHomeLabel || '首页', 'M4 14.85V11q0-.2.075-.375T4.3 10.3l7-7q.15-.15.325-.225Q11.8 3 12 3t.375.075q.175.075.325.225l1.425 1.4ZM17 20v-8.175L13.075 7.9 15.2 5.775l4.5 4.525q.125.15.213.325Q20 10.8 20 11v8q0 .425-.288.712Q19.425 20 19 20ZM5 20q-.425 0-.713-.288Q4 19.425 4 19v-2.05l3-3V17h8.5v3Z', false) +
79
+ mobileNavItem('/me/orders', config.navProductsLabel || '车票', 'M5.35 5.64c-.9-.64-1.12-1.88-.49-2.79.63-.9 1.88-1.12 2.79-.49.9.64 1.12 1.88.49 2.79-.64.9-1.88 1.12-2.79.49M16 20c0-.55-.45-1-1-1H8.93c-1.48 0-2.74-1.08-2.96-2.54L4.16 7.78A.976.976 0 0 0 3.2 7c-.62 0-1.08.57-.96 1.18l1.75 8.58A5.01 5.01 0 0 0 8.94 21H15c.55 0 1-.45 1-1m-.46-5h-4.19l-1.03-4.1c1.28.72 2.63 1.28 4.1 1.3.58.01 1.05-.49 1.05-1.07 0-.59-.49-1.04-1.08-1.06-1.31-.04-2.63-.56-3.61-1.33L9.14 7.47c-.23-.18-.49-.3-.76-.38a2.2 2.2 0 0 0-.99-.06h-.02a2.27 2.27 0 0 0-1.84 2.61l1.35 5.92A3.01 3.01 0 0 0 9.83 18h6.85l3.09 2.42c.42.33 1.02.29 1.39-.08.45-.45.4-1.18-.1-1.57l-4.29-3.35a2 2 0 0 0-1.23-.42', page === 'ticket') +
80
+ mobileNavItem('/me/affiliate', config.navPromotionLabel || '推广', 'm13.576 17.271-5.11-2.787a3.5 3.5 0 1 1 0-4.968l5.11-2.787a3.5 3.5 0 1 1 .958 1.755l-5.11 2.787a3.5 3.5 0 0 1 0 1.457l5.11 2.788a3.5 3.5 0 1 1-.958 1.755', page === 'promotion') +
81
+ mobileNavItem('/support', '工单', 'M21 8a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-1.062A8 8 0 0 1 12 23v-2a6 6 0 0 0 6-6V9A6 6 0 0 0 6 9v7H3a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1.062a8.001 8.001 0 0 1 15.876 0zM7.76 15.785l1.06-1.696A5.97 5.97 0 0 0 12 15a5.97 5.97 0 0 0 3.18-.911l1.06 1.696A7.96 7.96 0 0 1 12 17a7.96 7.96 0 0 1-4.24-1.215', false) +
82
+ mobileNavItem('/me', '我的', 'M12 17c3.662 0 6.865 1.575 8.607 3.925l-1.842.871C17.347 20.116 14.847 19 12 19c-2.848 0-5.347 1.116-6.765 2.796l-1.841-.872C5.136 18.574 8.338 17 12 17m0-15a5 5 0 0 1 5 5v3a5 5 0 0 1-4.783 4.995L12 15a5 5 0 0 1-5-5V7a5 5 0 0 1 4.783-4.995zm0 2a3 3 0 0 0-2.995 2.824L9 7v3a3 3 0 0 0 5.995.176L15 10V7a3 3 0 0 0-3-3', false) + '</nav>';
83
+ }
84
+
72
85
  function promoIconMarkup() {
73
86
  var factory = window.__NETFLIX_THEME_ICONS__;
74
87
  return factory && factory.promo ? factory.promo() : '';
@@ -211,7 +224,7 @@
211
224
  '<aside class="nfh-tools" aria-label="快捷入口">' + quickTools + '</aside>' +
212
225
  '<footer class="nfh-footer"><div class="nfh-footer-inner"><div class="nfh-promises">' + promises + '</div><div class="nfh-footer-divider"></div><div class="nfh-footer-body"><div class="nfh-footer-links">' + footerNav + '<section><h3>' + escapeHtml(c.footerContactTitle || '联系我们') + '</h3><div class="nfh-contact-socials">' + socialLinks + '</div><p class="nfh-contact-hours">' + contactHours + '</p></section></div></div>' +
213
226
  '<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>' +
214
- '<button class="nfc-to-top" type="button" aria-label="返回顶部">⌃</button>';
227
+ mobileNavMarkup(c, page) + '<button class="nfc-to-top" type="button" aria-label="返回顶部">⌃</button>';
215
228
  document.body.appendChild(root);
216
229
  root.querySelector('.nfc-logout').addEventListener('click', function () {
217
230
  localStorage.removeItem('user_token');
package/public/home.css CHANGED
@@ -389,3 +389,214 @@
389
389
  #netflix-theme-home .nfh-detail-faq{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:30px;margin:10px 0 15px;padding:7px 10px;border:0;border-radius:8px;background:#fffbed;color:#ff7446;font-size:14px;font-weight:400;line-height:16px;text-align:left;cursor:pointer}
390
390
  #netflix-theme-home .nfh-detail-faq[hidden]{display:none}
391
391
  .nfh-detail-faq-slides{height:16px;line-height:16px}.nfh-detail-faq-arrow{width:16px;height:16px;flex:0 0 16px}
392
+
393
+ /* Mobile reference layout: compact bottom-sheet purchase dialog and five native links. */
394
+ @media (max-width: 639px) {
395
+ #netflix-theme-home .nfh-mobile {
396
+ position: fixed;
397
+ z-index: 75;
398
+ right: 0;
399
+ bottom: 0;
400
+ left: 0;
401
+ display: flex;
402
+ height: 60px;
403
+ min-height: 60px;
404
+ padding: 0 0 env(safe-area-inset-bottom);
405
+ align-items: center;
406
+ justify-content: space-around;
407
+ color: #111;
408
+ background: #fff;
409
+ border-top: 0;
410
+ box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
411
+ }
412
+ #netflix-theme-home .nfh-mobile a {
413
+ display: flex;
414
+ width: auto;
415
+ min-width: 0;
416
+ height: 60px;
417
+ flex: 1 1 0;
418
+ align-items: center;
419
+ justify-content: center;
420
+ flex-direction: column;
421
+ gap: 2px;
422
+ color: #666 !important;
423
+ font-size: 12px;
424
+ line-height: 1.2;
425
+ }
426
+ #netflix-theme-home .nfh-mobile a svg {
427
+ display: block;
428
+ width: 25px;
429
+ height: 25px;
430
+ flex: 0 0 25px;
431
+ fill: currentColor;
432
+ }
433
+ #netflix-theme-home .nfh-mobile a span { font-size: 12px; line-height: 14px; }
434
+ #netflix-theme-home .nfh-mobile a.is-active { color: var(--nfh-red) !important; }
435
+
436
+ #netflix-theme-home .nfh-purchase-dialog[open] {
437
+ position: fixed;
438
+ inset: auto 0 0;
439
+ display: flex;
440
+ width: 100vw;
441
+ max-width: none;
442
+ height: 70vh;
443
+ height: 70dvh;
444
+ max-height: 70vh;
445
+ max-height: 70dvh;
446
+ margin: 0;
447
+ padding: 0;
448
+ transform: none;
449
+ flex-direction: column;
450
+ overflow: hidden;
451
+ border: 0;
452
+ border-radius: 16px 16px 0 0;
453
+ background: #09cdad;
454
+ box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
455
+ }
456
+ #netflix-theme-home .nfh-purchase-dialog::backdrop { background: rgba(0, 0, 0, .64); }
457
+ #netflix-theme-home .nfh-purchase-banner {
458
+ position: relative;
459
+ z-index: 1;
460
+ display: flex;
461
+ height: 33px;
462
+ min-height: 33px;
463
+ flex: 0 0 33px;
464
+ padding: 8px 12px;
465
+ align-items: center;
466
+ justify-content: center;
467
+ gap: 4px;
468
+ border-radius: 16px 16px 0 0;
469
+ background: #09cdad;
470
+ color: #fff;
471
+ font-size: 14px;
472
+ font-weight: 400;
473
+ line-height: 17px;
474
+ }
475
+ #netflix-theme-home .nfh-purchase-banner svg { width: 17px; height: 17px; flex: 0 0 17px; }
476
+ #netflix-theme-home .nfh-purchase-body {
477
+ position: relative;
478
+ z-index: 2;
479
+ display: flex;
480
+ min-height: 0;
481
+ margin-top: -1px;
482
+ padding: 15px 15px 0 !important;
483
+ flex: 1 1 auto;
484
+ flex-direction: column;
485
+ overflow: hidden;
486
+ border-radius: 16px 16px 0 0;
487
+ background: #fff;
488
+ color: #101010;
489
+ font-family: -apple-system, "Yuanti SC", system-ui, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
490
+ }
491
+ #netflix-theme-home .nfh-purchase-product {
492
+ position: relative;
493
+ min-height: 100px;
494
+ padding: 0 28px 0 0;
495
+ flex: 0 0 100px;
496
+ align-items: flex-start;
497
+ gap: 12px;
498
+ }
499
+ #netflix-theme-home .nfh-detail-image,
500
+ #netflix-theme-home .nfh-purchase-product img { width: 60px; height: 60px; flex: 0 0 60px; border-radius: 8px; }
501
+ #netflix-theme-home .nfh-purchase-product h2 { margin: 0; color: #101010; font-size: 18px; font-weight: 700; line-height: 1.25; }
502
+ #netflix-theme-home .nfh-detail-titleline { min-height: 23px; gap: 6px; }
503
+ #netflix-theme-home .nfh-detail-new { padding: 3px 7px; border-radius: 999px; background: #ef5350; color: #fff; font-size: 12px; line-height: 1.2; }
504
+ #netflix-theme-home .nfh-detail-price { margin: 5px 0 0; color: #f45b5c; font-size: 20px; font-weight: 600; line-height: 24px; }
505
+ #netflix-theme-home .nfh-detail-tags { display: flex; position: absolute; top: 71px; right: 0; left: 0; margin: 0; gap: 6px; flex-wrap: wrap; }
506
+ #netflix-theme-home .nfh-detail-tags span { padding: 4px 6px; border-radius: 3px; background: #f7f7f7; color: rgba(16, 16, 16, .6); font-size: 12px; line-height: 14px; }
507
+ #netflix-theme-home .nfh-detail-notice { display: none; }
508
+ #netflix-theme-home .nfh-detail-faq {
509
+ display: flex;
510
+ width: 100%;
511
+ min-height: 30px;
512
+ height: 30px;
513
+ margin: 10px 0 0;
514
+ padding: 7px 10px;
515
+ flex: 0 0 30px;
516
+ align-items: center;
517
+ justify-content: space-between;
518
+ border: 0;
519
+ border-radius: 8px;
520
+ background: #fffbed;
521
+ color: #ff7446;
522
+ font-size: 14px;
523
+ font-weight: 400;
524
+ line-height: 16px;
525
+ text-align: left;
526
+ }
527
+ #netflix-theme-home .nfh-purchase-scroll {
528
+ min-height: 0;
529
+ max-height: 300px;
530
+ margin: 0 -15px;
531
+ padding: 0 15px;
532
+ flex: 1 1 300px;
533
+ overflow-x: hidden;
534
+ overflow-y: auto;
535
+ overscroll-behavior: contain;
536
+ -webkit-overflow-scrolling: touch;
537
+ }
538
+ #netflix-theme-home .nfh-detail-choices h3,
539
+ #netflix-theme-home .nfh-detail-addons h3 { margin: 15px 0 10px; border-left-width: 3px; padding-left: 8px; font-size: 14px; line-height: 18px; }
540
+ #netflix-theme-home .nfh-detail-choices button { min-height: 38px; margin: 4px 8px 8px 0; padding: 0 14px; border-radius: 9px; background: #f7e9eb; color: #ef5350; font-size: 14px; line-height: 14px; }
541
+ #netflix-theme-home .nfh-detail-choices button.selected { outline: 0; background: #f7e9eb; color: #ef5350; }
542
+ #netflix-theme-home .nfh-detail-addons { padding: 0 0 8px; }
543
+ #netflix-theme-home .nfh-detail-addons label { margin: 4px 4px 4px 0; padding: 10px 12px; border-radius: 8px; background: #fff8eb; font-size: 14px; }
544
+ #netflix-theme-home .nfh-detail-manual { grid-template-columns: 1fr; }
545
+ #netflix-theme-home .nfh-purchase-footer {
546
+ position: relative;
547
+ z-index: 2;
548
+ padding: 10px 0 max(16px, env(safe-area-inset-bottom));
549
+ flex: 0 0 auto;
550
+ background: #fff;
551
+ }
552
+ #netflix-theme-home .nfh-purchase-footer .nfh-detail-coupons { display: flex; margin: 0 0 8px; gap: 8px; flex-wrap: wrap; }
553
+ #netflix-theme-home .nfh-purchase-footer .nfh-detail-coupons button {
554
+ min-height: 26px;
555
+ margin: 0;
556
+ padding: 7px 6px;
557
+ border-radius: 4px;
558
+ background: #fffbed;
559
+ color: #ff7446;
560
+ font-size: 12px;
561
+ line-height: 12px;
562
+ }
563
+ #netflix-theme-home .nfh-purchase-footer .nfh-detail-coupons input { max-width: 100%; padding: 8px 10px; font-size: 14px; }
564
+ #netflix-theme-home .nfh-coupon-options { max-height: 88px; overflow: auto; margin: 0 0 8px; }
565
+ #netflix-theme-home .nfh-detail-total { display: none; }
566
+ #netflix-theme-home .nfh-guest-fields { margin: 4px 0 8px; gap: 6px; }
567
+ #netflix-theme-home .nfh-guest-fields input { padding: 8px 10px; font-size: 13px; }
568
+ #netflix-theme-home .nfh-purchase-footer .nfh-detail-submit {
569
+ display: block;
570
+ position: static;
571
+ width: 100%;
572
+ min-height: 36px;
573
+ margin: 8px 0 0;
574
+ padding: 9px 16px;
575
+ border: 0;
576
+ border-radius: 999px;
577
+ background: linear-gradient(90deg, #ff5736, #f31824);
578
+ box-shadow: none;
579
+ color: #fff;
580
+ font-size: 14px;
581
+ font-weight: 500;
582
+ line-height: 18px;
583
+ }
584
+ #netflix-theme-home .nfh-purchase-footer .nfh-detail-error { margin: 4px 0 0; font-size: 12px; }
585
+ #netflix-theme-home .nfh-purchase-close { top: 44px; right: 12px; display: grid; width: 22px; height: 22px; padding: 0; place-items: center; color: #101010; opacity: .4; }
586
+ #netflix-theme-home .nfh-purchase-close svg { width: 21px; height: 21px; }
587
+ }
588
+
589
+ /* Upsell rows follow the reference product card layout. */
590
+ #netflix-theme-home .nfh-detail-addons label.nfh-addon-card { position: relative; display: flex; width: 100%; min-height: 72px; margin: 6px 0; padding: 8px 12px; align-items: center; gap: 10px; border: 1px solid #f1f1f1; border-radius: 10px; background: #fff; cursor: pointer; }
591
+ #netflix-theme-home .nfh-addon-card > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
592
+ #netflix-theme-home .nfh-addon-image { display: flex; width: 48px; height: 48px; flex: 0 0 48px; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; background: #ef5350; color: #fff; font-size: 12px; font-weight: 700; }
593
+ #netflix-theme-home .nfh-addon-image img { width: 100%; height: 100%; object-fit: cover; }
594
+ #netflix-theme-home .nfh-addon-copy { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 4px; }
595
+ #netflix-theme-home .nfh-addon-copy strong { overflow: hidden; color: #111; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
596
+ #netflix-theme-home .nfh-addon-copy small { overflow: hidden; color: #999; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
597
+ #netflix-theme-home .nfh-addon-prices { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 3px; }
598
+ #netflix-theme-home .nfh-addon-prices strong { color: #ef5350; font-size: 14px; font-weight: 600; white-space: nowrap; }
599
+ #netflix-theme-home .nfh-addon-prices small { color: #aaa; font-size: 12px; text-decoration: line-through; white-space: nowrap; }
600
+ #netflix-theme-home .nfh-addon-card:has(input:checked) { border-color: #f45b5c; background: #fffafa; }
601
+ #netflix-theme-home .nfh-addon-card:has(input:checked)::after { position: absolute; top: 5px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: #ef5350; color: #fff; content: '✓'; font-size: 9px; line-height: 12px; text-align: center; }
602
+ @media(max-width:639px) { #netflix-theme-home .nfh-detail-addons label.nfh-addon-card { min-height: 68px; margin: 6px 0; padding: 7px 9px; gap: 9px; } #netflix-theme-home .nfh-addon-image { width: 44px; height: 44px; flex-basis: 44px; } #netflix-theme-home .nfh-addon-copy strong { max-width: 190px; font-size: 14px; } #netflix-theme-home .nfh-addon-prices strong { font-size: 13px; } }
package/public/home.js CHANGED
@@ -207,14 +207,18 @@
207
207
  function dialogIsOpen(element) { var dialog = element.closest('dialog'); return !!(dialog && dialog.open); }
208
208
 
209
209
  function mountPurchaseDialog(settings, allProducts) {
210
- var dialog=document.createElement('dialog');dialog.className='nfh-purchase-dialog';dialog.innerHTML='<div class="nfh-purchase-banner"></div><button type="button" class="nfh-purchase-close" aria-label="关闭"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41L17.59 5Z"/></svg></button><main class="nfh-purchase-body"><div class="nfh-purchase-scroll"><div class="nfh-purchase-product"><img class="nfh-detail-image"><div class="nfh-purchase-meta"><div class="nfh-detail-titleline"><h2></h2><span class="nfh-detail-new"></span></div><b class="nfh-detail-price"></b><div class="nfh-detail-tags"></div></div></div><div class="nfh-detail-notice"></div><button class="nfh-detail-faq"></button><section class="nfh-detail-choices"></section><section class="nfh-detail-addons"></section><section class="nfh-detail-manual"></section></div><div class="nfh-purchase-footer"><div class="nfh-detail-coupons"><button data-coupon="券"></button><button data-coupon="码"></button><input placeholder="输入优惠码" hidden></div><div class="nfh-coupon-options" hidden></div><div class="nfh-guest-fields" hidden><input type="email"><input type="password"></div><div class="nfh-detail-total"></div><button class="nfh-detail-submit"></button><p class="nfh-detail-error"></p></div></main>';
210
+ var dialog=document.createElement('dialog');dialog.className='nfh-purchase-dialog';dialog.innerHTML='<div class="nfh-purchase-banner"></div><button type="button" class="nfh-purchase-close" aria-label="关闭"><svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41L17.59 5Z"/></svg></button><main class="nfh-purchase-body"><div class="nfh-purchase-product"><img class="nfh-detail-image"><div class="nfh-purchase-meta"><div class="nfh-detail-titleline"><h2></h2><span class="nfh-detail-new"></span></div><b class="nfh-detail-price"></b><div class="nfh-detail-tags"></div></div></div><div class="nfh-detail-notice"></div><button class="nfh-detail-faq"></button><div class="nfh-purchase-scroll"><section class="nfh-detail-choices"></section><section class="nfh-detail-addons"></section><section class="nfh-detail-manual"></section></div><div class="nfh-purchase-footer"><div class="nfh-detail-coupons"><button data-coupon="券"></button><button data-coupon="码"></button><input placeholder="输入优惠码" hidden></div><div class="nfh-coupon-options" hidden></div><div class="nfh-guest-fields" hidden><input type="email"><input type="password"></div><div class="nfh-detail-total"></div><button class="nfh-detail-submit"></button><p class="nfh-detail-error"></p></div></main>';
211
211
  root.appendChild(dialog);var product,sku,extra=[],code='',siblings=[],memberOnly=false,previewVersion=0,categoryRequest=0,couponInputTimer=null,guestInputTimer=null;
212
212
  function manualFormData(){var data={};dialog.querySelectorAll('[data-manual-key]').forEach(function(input){var key=input.dataset.manualKey;if(input.type==='checkbox'){if(!data[key])data[key]=[];if(input.checked)data[key].push(input.value)}else if(input.type==='radio'){if(input.checked)data[key]=input.value}else data[key]=input.value.trim()});var result={};result[String(product.id)]=data;return result}function lineItems(){return [{product_id:product.id,sku_id:sku&&sku.id||undefined,quantity:1,fulfillment_type:product.fulfillment_type||undefined}].concat(extra.map(function(x){return {product_id:x.id,sku_id:x.sku||undefined,quantity:1}}))}
213
213
  function credentials(){var token=localStorage.getItem('user_token'),email=dialog.querySelector('.nfh-guest-fields input[type=email]').value.trim(),password=dialog.querySelector('.nfh-guest-fields input[type=password]').value.trim();if(token)return {path:'/api/v1/orders',headers:{Authorization:'Bearer '+token},guest:{}};var raw=btoa(Array.from(new TextEncoder().encode(email.toLowerCase()+'\n'+password),function(x){return String.fromCharCode(x)}).join('')).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/g,'');return {path:'/api/v1/guest/orders',headers:{Authorization:'Guest '+raw},guest:{email:email,order_password:password}}}function preview(){var version=++previewVersion,c=credentials();if(!localStorage.getItem('user_token')&&(!c.guest.email&&!c.guest.order_password)){dialog.querySelector('.nfh-detail-total').textContent='预计合计 ¥'+(sku&&sku.price_amount||product.price_amount||'0');dialog.querySelector('.nfh-detail-error').textContent='';return}if(!localStorage.getItem('user_token')&&(!c.guest.email||c.guest.order_password.length<6)){dialog.querySelector('.nfh-detail-error').textContent='填写游客邮箱和至少6位订单密码后计算优惠';return}dialog.querySelector('.nfh-detail-error').textContent='';fetch(c.path+'/preview',{method:'POST',credentials:'include',headers:Object.assign({'Content-Type':'application/json','X-Lang':currentLocale()},c.headers),body:JSON.stringify(Object.assign({items:lineItems(),coupon_code:code||undefined,manual_form_data:manualFormData()},c.guest))}).then(function(r){return r.json()}).then(function(x){if(version!==previewVersion)return;if(x.status_code&&x.status_code!==0){dialog.querySelector('.nfh-detail-total').textContent='';dialog.querySelector('.nfh-detail-error').textContent=x.msg||'价格预览失败';return}var d=x.data||{};dialog.querySelector('.nfh-detail-total').textContent='合计 ¥'+(d.total_amount||d.pay_amount||sku&&sku.price_amount||product.price_amount||'0');dialog.querySelector('.nfh-detail-error').textContent=''}).catch(function(){if(version===previewVersion)dialog.querySelector('.nfh-detail-error').textContent='价格预览失败'})}
214
- function load(data,titleOverride){product=data.data||data;memberOnly=product.purchase_type==='member';siblings=(allProducts||[]).filter(function(p){return Number(p.category_id)===Number(product.category_id)});if(!siblings.some(function(p){return Number(p.id)===Number(product.id)}))siblings.unshift(product);sku=(product.skus||[]).find(function(x){return x.is_active!==false&&!x.is_sold_out})||product.skus&&product.skus[0];extra=[];dialog.querySelector('.nfh-guest-fields').hidden=true;dialog.querySelector('.nfh-purchase-banner').innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M12 2 4 5v6c0 5.1 3.4 9.7 8 11 4.6-1.3 8-5.9 8-11V5zm-1.1 13.4-3.2-3.2 1.4-1.4 1.8 1.8 4.1-4.1 1.4 1.4z"/></svg><span>'+escapeHtml(settings.productBanner||'微信客服 · 全年无休 · 售后有保障')+'</span>';var cardTitle=titleOverride||(root.querySelector('.nfh-card[data-product-id="'+product.id+'"] .nfh-card-title')||{}).textContent;dialog.querySelector('h2').textContent=localized(product.category&&product.category.name)||cardTitle||localized(product.title)||'';dialog.querySelector('.nfh-detail-price').textContent='¥'+(sku&&sku.price_amount||product.price_amount||'0');dialog.querySelector('.nfh-detail-tags').innerHTML=(product.tags&&product.tags.length?product.tags.map(function(x){return localized(x.name||x)}):String(settings.tags||'').split(/[,,]/).filter(Boolean)).map(function(x){return '<span>'+escapeHtml(x)+'</span>'}).join('');dialog.querySelector('.nfh-detail-notice').textContent='';var cardForFaq=root.querySelector('[data-product-id="'+product.id+'"]');var cardQuestions=cardForFaq?Array.prototype.map.call(cardForFaq.querySelectorAll('.nfh-faq-slides .nfh-slide'),function(item){return item.textContent.trim()}).filter(Boolean):[];var faqRows=cardQuestions.length?cardQuestions:String(settings.faqs||'').split(/\r?\n/).filter(Boolean);var faqButtons=dialog.querySelectorAll('.nfh-detail-faq');faqButtons.forEach(function(button,index){if(index)button.remove()});var faqButton=dialog.querySelector('.nfh-detail-faq');if(faqRows.length){faqButton.innerHTML='<span class="nfh-detail-faq-slides">'+faqRows.map(function(question,index){return '<span class="nfh-slide"'+(index?' hidden':'')+'>'+escapeHtml(question)+'</span>'}).join('')+'</span><svg class="nfh-detail-faq-arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 5 7 7-7 7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';faqButton.hidden=false;faqButton.querySelector('.nfh-detail-faq-slides').dataset.nextCarousel=String(Date.now()+3500);faqButton.onclick=function(){dialog.close();var article=root.querySelector('[data-product-id="'+product.id+'"]');var trigger=article&&article.querySelector('.nfh-faq-trigger');if(trigger)trigger.click()}}else faqButton.hidden=true;var skus=(product.skus||[]).filter(function(x){return x.is_active!==false});dialog.querySelector('.nfh-detail-choices').innerHTML='<h3>商品</h3><div class="nfh-product-options">'+siblings.map(function(item){return '<button type="button" data-product-choice="'+escapeHtml(item.slug||item.id)+'" class="'+(Number(item.id)===Number(product.id)?'selected':'')+'"'+(item.is_sold_out?' disabled':'')+'>'+escapeHtml(localized(item.title)||'商品')+'</button>'}).join('')+'</div><h3>规格</h3><div class="nfh-sku-options">'+skus.map(function(item,i){return '<button type="button" data-sku="'+i+'" class="'+(item===sku?'selected':'')+'"'+(item.is_sold_out?' disabled':'')+'>'+escapeHtml(localized(item.spec_values)||item.sku_code)+' <span>¥'+escapeHtml(item.price_amount)+'</span></button>'}).join('')+'</div>';dialog.querySelectorAll('[data-product-choice]').forEach(function(b){b.onclick=function(){var request=++categoryRequest;fetch('/api/v1/public/products/'+encodeURIComponent(b.dataset.productChoice)).then(function(r){if(!r.ok)throw Error('商品加载失败');return r.json()}).then(function(data){if(data.status_code)throw Error(data.msg||'商品加载失败');if(request===categoryRequest)load(data)}).catch(function(e){if(request===categoryRequest)dialog.querySelector('.nfh-detail-error').textContent=e.message})}});dialog.querySelectorAll('[data-sku]').forEach(function(b){b.onclick=function(){sku=skus[Number(b.dataset.sku)];dialog.querySelectorAll('[data-sku]').forEach(function(option){option.classList.toggle('selected',option===b)});dialog.querySelector('.nfh-detail-price').textContent='¥'+sku.price_amount;preview()}});var schema=product.manual_form_schema&&Array.isArray(product.manual_form_schema.fields)?product.manual_form_schema.fields:[];dialog.querySelector('.nfh-detail-manual').innerHTML=schema.length?'<h3>交付信息</h3>'+schema.map(function(f){var key=String(f.key||'');if(!key)return '';var label=localized(f.title||f.label)||key,required=f.required?' required':'',safeKey=escapeHtml(key),type=f.type==='textarea'?'textarea':f.type==='select'?'select':f.type==='email'?'email':f.type==='phone'?'tel':f.type==='number'?'number':'text';if(type==='checkbox'||type==='radio'){var inputType=type;return '<fieldset class="nfh-manual-choice"><legend>'+escapeHtml(label)+(f.required?' *':'')+'</legend>'+((Array.isArray(f.options)?f.options:[]).map(function(v,index){var value=typeof v==='string'?v:localized(v);return '<label><input type="'+inputType+'" data-manual-key="'+safeKey+'" name="manual-'+safeKey+'" value="'+escapeHtml(value)+'"'+(f.required&&index===0?' required':'')+'> '+escapeHtml(value)+'</label>'}).join(''))+'</fieldset>'}if(type==='textarea')return '<label>'+escapeHtml(label)+'<textarea data-manual-key="'+safeKey+'"'+required+'></textarea></label>';if(type==='select')return '<label>'+escapeHtml(label)+'<select data-manual-key="'+safeKey+'"'+required+'><option value="">请选择</option>'+((Array.isArray(f.options)?f.options:[]).map(function(v){return '<option value="'+escapeHtml(v)+'">'+escapeHtml(v)+'</option>'}).join(''))+'</select></label>';return '<label>'+escapeHtml(label)+'<input type="'+type+'" data-manual-key="'+safeKey+'"'+required+' '+(f.placeholder?'placeholder="'+escapeHtml(localized(f.placeholder))+'"':'')+'></label>'}).join(''):'';var rows=String(settings.productAddons||'').split(/\r?\n/).filter(Boolean);dialog.querySelector('.nfh-detail-addons').innerHTML=settings.productAddonsEnabled==='是'&&rows.length?'<h3>特惠增购</h3>'+rows.map(function(r,i){var a=r.split('|');return '<label><input type="checkbox" data-addon="'+i+'"> '+escapeHtml(a[0])+' ¥'+escapeHtml(a[3]||'0')+'</label>'}).join(''):'';dialog.querySelectorAll('[data-addon]').forEach(function(b){b.onchange=function(){var a=rows[Number(b.dataset.addon)].split('|');extra=extra.filter(function(x){return x.id!==Number(a[1])});if(b.checked)extra.push({id:Number(a[1]),sku:Number(a[2])||0});preview()}});var couponRows=String(settings.productCouponOptions||'').split(/\r?\n/).map(function(line){return line.split('|')}).filter(function(row){return row[0]&&row[1]});var couponOptions=dialog.querySelector('.nfh-coupon-options');couponOptions.innerHTML=couponRows.map(function(row,index){return '<button type="button" data-coupon-option="'+index+'">'+escapeHtml(row[0])+'</button>'}).join('');couponOptions.hidden=!couponRows.length;couponOptions.querySelectorAll('[data-coupon-option]').forEach(function(button){button.onclick=function(){code=couponRows[Number(button.dataset.couponOption)][1].trim();dialog.querySelector('.nfh-detail-coupons input').value=code;preview()}});dialog.querySelector('[data-coupon="券"]').textContent=couponRows.length?(settings.productCouponLabel||'选择优惠券'):'无可用优惠券';dialog.querySelector('[data-coupon="码"]').textContent=settings.productCouponCodeLabel||'使用优惠码';dialog.querySelector('.nfh-detail-submit').textContent=memberOnly&&!localStorage.getItem('user_token')?'登录后购买':(settings.productSubmitLabel||'去付款');if(memberOnly&&!localStorage.getItem('user_token'))dialog.querySelector('.nfh-detail-error').textContent='';else preview()}
214
+ function load(data,titleOverride){product=data.data||data;memberOnly=product.purchase_type==='member';siblings=(allProducts||[]).filter(function(p){return Number(p.category_id)===Number(product.category_id)});if(!siblings.some(function(p){return Number(p.id)===Number(product.id)}))siblings.unshift(product);sku=(product.skus||[]).find(function(x){return x.is_active!==false&&!x.is_sold_out})||product.skus&&product.skus[0];extra=[];dialog.querySelector('.nfh-guest-fields').hidden=true;dialog.querySelector('.nfh-purchase-banner').innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M12 2 4 5v6c0 5.1 3.4 9.7 8 11 4.6-1.3 8-5.9 8-11V5zm-1.1 13.4-3.2-3.2 1.4-1.4 1.8 1.8 4.1-4.1 1.4 1.4z"/></svg><span>'+escapeHtml(settings.productBanner||'微信客服 · 全年无休 · 售后有保障')+'</span>';var cardTitle=titleOverride||(root.querySelector('.nfh-card[data-product-id="'+product.id+'"] .nfh-card-title')||{}).textContent;dialog.querySelector('h2').textContent=localized(product.category&&product.category.name)||cardTitle||localized(product.title)||'';dialog.querySelector('.nfh-detail-price').textContent='¥'+(sku&&sku.price_amount||product.price_amount||'0');dialog.querySelector('.nfh-detail-tags').innerHTML=(product.tags&&product.tags.length?product.tags.map(function(x){return localized(x.name||x)}):String(settings.tags||'').split(/[,,]/).filter(Boolean)).map(function(x){return '<span>'+escapeHtml(x)+'</span>'}).join('');dialog.querySelector('.nfh-detail-notice').textContent='';var cardForFaq=root.querySelector('[data-product-id="'+product.id+'"]');var cardQuestions=cardForFaq?Array.prototype.map.call(cardForFaq.querySelectorAll('.nfh-faq-slides .nfh-slide'),function(item){return item.textContent.trim()}).filter(Boolean):[];var faqRows=cardQuestions.length?cardQuestions:String(settings.faqs||'').split(/\r?\n/).filter(Boolean);var faqButtons=dialog.querySelectorAll('.nfh-detail-faq');faqButtons.forEach(function(button,index){if(index)button.remove()});var faqButton=dialog.querySelector('.nfh-detail-faq');if(faqRows.length){faqButton.innerHTML='<span class="nfh-detail-faq-slides">'+faqRows.map(function(question,index){return '<span class="nfh-slide"'+(index?' hidden':'')+'>'+escapeHtml(question)+'</span>'}).join('')+'</span><svg class="nfh-detail-faq-arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 5 7 7-7 7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';faqButton.hidden=false;faqButton.querySelector('.nfh-detail-faq-slides').dataset.nextCarousel=String(Date.now()+3500);faqButton.onclick=function(){dialog.close();var article=root.querySelector('[data-product-id="'+product.id+'"]');var trigger=article&&article.querySelector('.nfh-faq-trigger');if(trigger)trigger.click()}}else faqButton.hidden=true;var skus=(product.skus||[]).filter(function(x){return x.is_active!==false});dialog.querySelector('.nfh-detail-choices').innerHTML='<h3>商品</h3><div class="nfh-product-options">'+siblings.map(function(item){return '<button type="button" data-product-choice="'+escapeHtml(item.slug||item.id)+'" class="'+(Number(item.id)===Number(product.id)?'selected':'')+'"'+(item.is_sold_out?' disabled':'')+'>'+escapeHtml(localized(item.title)||'商品')+'</button>'}).join('')+'</div><h3>规格</h3><div class="nfh-sku-options">'+skus.map(function(item,i){return '<button type="button" data-sku="'+i+'" class="'+(item===sku?'selected':'')+'"'+(item.is_sold_out?' disabled':'')+'>'+escapeHtml(localized(item.spec_values)||item.sku_code)+' <span>¥'+escapeHtml(item.price_amount)+'</span></button>'}).join('')+'</div>';dialog.querySelectorAll('[data-product-choice]').forEach(function(b){b.onclick=function(){var request=++categoryRequest;fetch('/api/v1/public/products/'+encodeURIComponent(b.dataset.productChoice)).then(function(r){if(!r.ok)throw Error('商品加载失败');return r.json()}).then(function(data){if(data.status_code)throw Error(data.msg||'商品加载失败');if(request===categoryRequest)load(data)}).catch(function(e){if(request===categoryRequest)dialog.querySelector('.nfh-detail-error').textContent=e.message})}});dialog.querySelectorAll('[data-sku]').forEach(function(b){b.onclick=function(){sku=skus[Number(b.dataset.sku)];dialog.querySelectorAll('[data-sku]').forEach(function(option){option.classList.toggle('selected',option===b)});dialog.querySelector('.nfh-detail-price').textContent='¥'+sku.price_amount;preview()}});var schema=product.manual_form_schema&&Array.isArray(product.manual_form_schema.fields)?product.manual_form_schema.fields:[];dialog.querySelector('.nfh-detail-manual').innerHTML=schema.length?'<h3>交付信息</h3>'+schema.map(function(f){var key=String(f.key||'');if(!key)return '';var label=localized(f.title||f.label)||key,required=f.required?' required':'',safeKey=escapeHtml(key),type=f.type==='textarea'?'textarea':f.type==='select'?'select':f.type==='email'?'email':f.type==='phone'?'tel':f.type==='number'?'number':'text';if(type==='checkbox'||type==='radio'){var inputType=type;return '<fieldset class="nfh-manual-choice"><legend>'+escapeHtml(label)+(f.required?' *':'')+'</legend>'+((Array.isArray(f.options)?f.options:[]).map(function(v,index){var value=typeof v==='string'?v:localized(v);return '<label><input type="'+inputType+'" data-manual-key="'+safeKey+'" name="manual-'+safeKey+'" value="'+escapeHtml(value)+'"'+(f.required&&index===0?' required':'')+'> '+escapeHtml(value)+'</label>'}).join(''))+'</fieldset>'}if(type==='textarea')return '<label>'+escapeHtml(label)+'<textarea data-manual-key="'+safeKey+'"'+required+'></textarea></label>';if(type==='select')return '<label>'+escapeHtml(label)+'<select data-manual-key="'+safeKey+'"'+required+'><option value="">请选择</option>'+((Array.isArray(f.options)?f.options:[]).map(function(v){return '<option value="'+escapeHtml(v)+'">'+escapeHtml(v)+'</option>'}).join(''))+'</select></label>';return '<label>'+escapeHtml(label)+'<input type="'+type+'" data-manual-key="'+safeKey+'"'+required+' '+(f.placeholder?'placeholder="'+escapeHtml(localized(f.placeholder))+'"':'')+'></label>'}).join(''):'';var rows=String(settings.productAddons||'').split(/\r?\n/).filter(Boolean);dialog.querySelector('.nfh-detail-addons').innerHTML=settings.productAddonsEnabled==='是'&&rows.length?'<h3>特惠增购</h3>'+rows.map(function(r,i){var a=r.split('|'),addon=(allProducts||[]).find(function(item){return String(item.id)===String(a[1])}),addonSku=addon&&(addon.skus||[]).find(function(item){return String(item.id)===String(a[2])})||addon&&(addon.skus||[])[Number(a[2])||0],image=addon&&(addon.image_url||addon.cover_image||addon.cover||addon.image||addon.thumbnail),tags=addon&&Array.isArray(addon.tags)?addon.tags.slice(0,2).map(function(tag){return localized(tag&&tag.name||tag)}).filter(Boolean).join(' '):'' ,price=a[3]||addonSku&&addonSku.price_amount||addon&&addon.price_amount||'0',original=addonSku&&(addonSku.original_price_amount||addonSku.market_price)||addon&&(addon.original_price_amount||addon.market_price);return '<label class="nfh-addon-card"><input type="checkbox" data-addon="'+i+'"><span class="nfh-addon-image">'+(image?'<img src="'+escapeHtml(safeHref(image,''))+'" alt="" loading="lazy">':'<b>奈飞</b>')+'</span><span class="nfh-addon-copy"><strong>'+escapeHtml(a[0]||localized(addon&&addon.title)||'特惠商品')+'</strong><small>'+escapeHtml(tags)+'</small></span><span class="nfh-addon-prices"><strong>特惠 ¥'+escapeHtml(price)+'</strong>'+(original?'<small>原价 ¥'+escapeHtml(original)+'</small>':'')+'</span></label>'}).join(''):'';dialog.querySelectorAll('[data-addon]').forEach(function(b){b.onchange=function(){var a=rows[Number(b.dataset.addon)].split('|');extra=extra.filter(function(x){return x.id!==Number(a[1])});if(b.checked)extra.push({id:Number(a[1]),sku:Number(a[2])||0});preview()}});var couponRows=String(settings.productCouponOptions||'').split(/\r?\n/).map(function(line){return line.split('|')}).filter(function(row){return row[0]&&row[1]});var couponOptions=dialog.querySelector('.nfh-coupon-options');couponOptions.innerHTML=couponRows.map(function(row,index){return '<button type="button" data-coupon-option="'+index+'">'+escapeHtml(row[0])+'</button>'}).join('');couponOptions.hidden=!couponRows.length;couponOptions.querySelectorAll('[data-coupon-option]').forEach(function(button){button.onclick=function(){code=couponRows[Number(button.dataset.couponOption)][1].trim();dialog.querySelector('.nfh-detail-coupons input').value=code;preview()}});dialog.querySelector('[data-coupon="券"]').textContent=couponRows.length?(settings.productCouponLabel||'选择优惠券'):'无可用优惠券';dialog.querySelector('[data-coupon="码"]').textContent=settings.productCouponCodeLabel||'使用优惠码';dialog.querySelector('.nfh-detail-submit').textContent=memberOnly&&!localStorage.getItem('user_token')?'登录后购买':(settings.productSubmitLabel||'去付款');if(memberOnly&&!localStorage.getItem('user_token'))dialog.querySelector('.nfh-detail-error').textContent='';else preview()}
215
215
  dialog.querySelectorAll('[data-coupon]').forEach(function(b){b.onclick=function(){if(b.dataset.coupon==='券'){var options=dialog.querySelector('.nfh-coupon-options');if(options.children.length){options.hidden=!options.hidden;dialog.querySelector('.nfh-detail-error').textContent=''}else dialog.querySelector('.nfh-detail-error').textContent='暂无可用优惠券';return}var i=dialog.querySelector('.nfh-detail-coupons input');i.hidden=false;i.focus();i.oninput=function(){clearTimeout(couponInputTimer);couponInputTimer=setTimeout(function(){code=i.value.trim();preview()},350)}}});dialog.querySelectorAll('.nfh-guest-fields input').forEach(function(i){i.addEventListener('input',function(){clearTimeout(guestInputTimer);guestInputTimer=setTimeout(preview,350)});i.addEventListener('change',preview)});dialog.querySelector('.nfh-detail-submit').onclick=function(){if(memberOnly&&!localStorage.getItem('user_token')){var back='/?buy='+encodeURIComponent(product.slug||product.id);location.href='/auth/login?redirect='+encodeURIComponent(back);return}if(!localStorage.getItem('user_token')){location.href=safeProductHref(product);return}var c=credentials();fetch(c.path+'/create-and-pay',{method:'POST',credentials:'include',headers:Object.assign({'Content-Type':'application/json','X-Lang':currentLocale()},c.headers),body:JSON.stringify(Object.assign({items:lineItems(),coupon_code:code||undefined,manual_form_data:manualFormData()},c.guest))}).then(function(r){return r.json()}).then(function(x){var d=x.data||x;if(x.status_code&&x.status_code!==0)throw Error(x.msg||'下单失败');if(!d.order_no)throw Error(x.message||'下单失败');location.href='/pay?'+(!localStorage.getItem('user_token')?'guest=1&':'')+'order_no='+encodeURIComponent(d.order_no)}).catch(function(e){dialog.querySelector('.nfh-detail-error').textContent=e.message||'下单失败'})};dialog.querySelector('.nfh-purchase-close').onclick=function(){dialog.close()};root.addEventListener('click',function(e){var b=e.target.closest('.nfh-buy[data-nfh-product],.nfh-card-title[data-nfh-product]');if(!b||b.classList.contains('is-sold'))return;e.preventDefault();dialog.showModal();fetch('/api/v1/public/products/'+encodeURIComponent(b.dataset.nfhProduct)).then(function(r){return r.json()}).then(function(data){load(data,b.dataset.nfhTitle)}).catch(function(){dialog.querySelector('.nfh-detail-error').textContent='商品加载失败'})});var pending=new URLSearchParams(location.search).get('buy');if(pending){history.replaceState(history.state,'',location.pathname);var trigger=Array.prototype.find.call(root.querySelectorAll('.nfh-buy[data-nfh-product]'),function(b){return b.dataset.nfhProduct===pending});if(trigger)trigger.click()}
216
216
  }
217
217
 
218
+ function mobileNavItem(href, label, path, active) {
219
+ return '<a href="' + href + '"' + (active ? ' class="is-active"' : '') + ' aria-label="' + escapeHtml(label) + '"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="' + path + '"/></svg><span>' + escapeHtml(label) + '</span></a>';
220
+ }
221
+
218
222
  function render(config, products, productConfig) {
219
223
  var statIcons = ['stat-support.svg', 'stat-riders.svg', 'stat-members.svg', 'stat-shield.svg'];
220
224
  var stats = rows(config.serviceStats).slice(0, 4).map(function (row, index) {
@@ -284,7 +288,7 @@
284
288
  '<footer class="nfh-footer"><div class="nfh-footer-inner"><div class="nfh-promises">' + promises + '</div><div class="nfh-footer-divider"></div><div class="nfh-footer-body"><div class="nfh-footer-links">' + footerGroups + '</div>' +
285
289
  '</div><div class="nfh-language"><label for="nfh-language-select">' + escapeHtml(translate('language')) + '</label><div class="nfh-language-picker"><button id="nfh-language-select" class="nfh-language-select" type="button" aria-haspopup="listbox" aria-expanded="false"><span class="nfh-language-current"></span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button><div class="nfh-language-menu" role="listbox" aria-label="' + escapeHtml(translate('language')) + '" hidden>' + languageOptions + '</div></div></div>' +
286
290
  '<div class="nfh-footer-bottom"><span>' + escapeHtml(config.copyrightText || '') + '</span><div>' + licenseInfo + '</div></div></div></footer>' +
287
- '<nav class="nfh-mobile" aria-label="移动导航"><a class="is-active" href="/">⌂<span>' + escapeHtml(configuredLabel(config.navHomeLabel, '首页', 'home')) + '</span></a><a href="/me/orders">▣<span>' + escapeHtml(configuredLabel(config.navProductsLabel, '车票', 'tickets')) + '</span></a><a href="/me/affiliate">♧<span>' + escapeHtml(configuredLabel(config.navPromotionLabel, '推广', 'promotion')) + '</span></a><a href="/me">♙<span>' + escapeHtml(translate('mine')) + '</span></a></nav>';
291
+ '<nav class="nfh-mobile" aria-label="移动导航">' + mobileNavItem('/', configuredLabel(config.navHomeLabel, '首页', 'home'), 'M4 14.85V11q0-.2.075-.375T4.3 10.3l7-7q.15-.15.325-.225Q11.8 3 12 3t.375.075q.175.075.325.225l1.425 1.4ZM17 20v-8.175L13.075 7.9 15.2 5.775l4.5 4.525q.125.15.213.325Q20 10.8 20 11v8q0 .425-.288.712Q19.425 20 19 20ZM5 20q-.425 0-.713-.288Q4 19.425 4 19v-2.05l3-3V17h8.5v3Z', true) + mobileNavItem('/me/orders', configuredLabel(config.navProductsLabel, '车票', 'tickets'), 'M5.35 5.64c-.9-.64-1.12-1.88-.49-2.79.63-.9 1.88-1.12 2.79-.49.9.64 1.12 1.88.49 2.79-.64.9-1.88 1.12-2.79.49M16 20c0-.55-.45-1-1-1H8.93c-1.48 0-2.74-1.08-2.96-2.54L4.16 7.78A.976.976 0 0 0 3.2 7c-.62 0-1.08.57-.96 1.18l1.75 8.58A5.01 5.01 0 0 0 8.94 21H15c.55 0 1-.45 1-1m-.46-5h-4.19l-1.03-4.1c1.28.72 2.63 1.28 4.1 1.3.58.01 1.05-.49 1.05-1.07 0-.59-.49-1.04-1.08-1.06-1.31-.04-2.63-.56-3.61-1.33L9.14 7.47c-.23-.18-.49-.3-.76-.38a2.2 2.2 0 0 0-.99-.06h-.02a2.27 2.27 0 0 0-1.84 2.61l1.35 5.92A3.01 3.01 0 0 0 9.83 18h6.85l3.09 2.42c.42.33 1.02.29 1.39-.08.45-.45.4-1.18-.1-1.57l-4.29-3.35a2 2 0 0 0-1.23-.42', false) + mobileNavItem('/me/affiliate', configuredLabel(config.navPromotionLabel, '推广', 'promotion'), 'm13.576 17.271-5.11-2.787a3.5 3.5 0 1 1 0-4.968l5.11-2.787a3.5 3.5 0 1 1 .958 1.755l-5.11 2.787a3.5 3.5 0 0 1 0 1.457l5.11 2.788a3.5 3.5 0 1 1-.958 1.755', false) + mobileNavItem('/support', translate('support'), 'M21 8a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-1.062A8 8 0 0 1 12 23v-2a6 6 0 0 0 6-6V9A6 6 0 0 0 6 9v7H3a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1.062a8.001 8.001 0 0 1 15.876 0zM7.76 15.785l1.06-1.696A5.97 5.97 0 0 0 12 15a5.97 5.97 0 0 0 3.18-.911l1.06 1.696A7.96 7.96 0 0 1 12 17a7.96 7.96 0 0 1-4.24-1.215', false) + mobileNavItem('/me', translate('mine'), 'M12 17c3.662 0 6.865 1.575 8.607 3.925l-1.842.871C17.347 20.116 14.847 19 12 19c-2.848 0-5.347 1.116-6.765 2.796l-1.841-.872C5.136 18.574 8.338 17 12 17m0-15a5 5 0 0 1 5 5v3a5 5 0 0 1-4.783 4.995L12 15a5 5 0 0 1-5-5V7a5 5 0 0 1 4.783-4.995zm0 2a3 3 0 0 0-2.995 2.824L9 7v3a3 3 0 0 0 5.995.176L15 10V7a3 3 0 0 0-3-3', false) + '</nav>';
288
292
 
289
293
  if (config.heroBackgroundUrl) {
290
294
  var background = safeHref(config.heroBackgroundUrl, '');