feat(pwa): add install prompt banner and register in all POS templates

- pwa-install.js: captures beforeinstallprompt, shows dismissible
  banner with 7-day localStorage cooldown, handles appinstalled
- Registered in 12 POS templates alongside existing service worker
This commit is contained in:
2026-04-29 06:30:38 +00:00
parent 4b3b0f8313
commit 3b8224d15e
13 changed files with 142 additions and 0 deletions

View File

@@ -352,6 +352,33 @@
</div><!-- end chart-card -->
</section>
<!-- =================================================================
ESTADÍSTICAS EN TIEMPO REAL
================================================================= -->
<section>
<div class="section-header">
<span class="section-title">Rendimiento Hoy</span>
</div>
<div class="two-col-grid">
<div class="rank-card">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4);">
<div style="font-family:var(--font-heading);font-weight:var(--heading-weight-secondary);font-size:var(--text-body-sm);letter-spacing:var(--tracking-wider);text-transform:uppercase;color:var(--color-text-secondary);">
Ventas por Hora
</div>
</div>
<canvas id="hourlySalesChart" height="180"></canvas>
</div>
<div class="rank-card">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4);">
<div style="font-family:var(--font-heading);font-weight:var(--heading-weight-secondary);font-size:var(--text-body-sm);letter-spacing:var(--tracking-wider);text-transform:uppercase;color:var(--color-text-secondary);">
Top Productos (Hoy)
</div>
</div>
<canvas id="topProductsChart" height="180"></canvas>
</div>
</div>
</section>
<!-- =================================================================
TOP PRODUCTOS / TOP CLIENTES
================================================================= -->
@@ -453,13 +480,16 @@
</div><!-- end app-shell -->
<script src="/pos/static/js/chart.umd.min.js" defer></script>
<script src="/pos/static/js/i18n.js" defer></script>
<script src="/pos/static/js/app-init.js" defer></script>
<script src="/pos/static/js/pos-utils.js" defer></script>
<script src="/pos/static/js/sidebar.js" defer></script>
<script src="/pos/static/js/dashboard-stats.js" defer></script>
<script src="/pos/static/js/dashboard.js" defer></script>
<script src="/pos/static/js/sync-engine.js" defer></script>
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('/pos/sw.js',{scope:'/pos/'});}</script>
<script src="/pos/static/js/pwa-install.js" defer></script>
<script src="/pos/static/js/chat.js" defer></script>
</body>