fix: remover cantidad disponible de productos en menu, eliminar boton duplicado de salir en tarjeta y quitar boton de carnet en portal padres

This commit is contained in:
unknown
2026-10-04 21:03:20 -06:00
parent fb6852c456
commit 661987bf41
3 changed files with 14 additions and 26 deletions
+6 -14
View File
@@ -10,7 +10,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="RecreoPay"> <meta name="apple-mobile-web-app-title" content="RecreoPay">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="/css/styles.css?v=8.0"> <link rel="stylesheet" href="/css/styles.css?v=8.1">
<style> <style>
/* Transiciones suaves */ /* Transiciones suaves */
.fade-enter { animation: fadeIn 0.2s ease-in-out; } .fade-enter { animation: fadeIn 0.2s ease-in-out; }
@@ -364,13 +364,10 @@
</div> </div>
</div> </div>
<div style="display: flex; gap: 8px; flex-wrap: wrap;"> <div style="display: flex; gap: 8px;">
<button type="button" onclick="switchToSodaMenuAsParent()" style="flex: 1; padding: 9px; background: #0284c7; color: white; border: none; border-radius: 10px; font-weight: 800; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;"> <button type="button" onclick="switchToSodaMenuAsParent()" style="width: 100%; padding: 11px; background: #0284c7; color: white; border: none; border-radius: 10px; font-weight: 800; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;">
<span>🥪</span> Pre-ordenar Merienda <span>🥪</span> Pre-ordenar Merienda / Ver Menú
</button> </button>
<a id="btnParentViewCarnet" href="/carnet.html" target="_blank" style="padding: 9px 12px; background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; border-radius: 10px; font-weight: 800; font-size: 0.8rem; text-decoration: none; display: flex; align-items: center; gap: 4px;">
<span>🖨️</span> Ver Carné QR
</a>
</div> </div>
</div> </div>
@@ -538,15 +535,10 @@
<div class="student-info"> <div class="student-info">
<img id="walletAvatar" class="student-avatar" src="" alt="Avatar"> <img id="walletAvatar" class="student-avatar" src="" alt="Avatar">
<div class="student-meta" style="flex: 1; min-width: 0;"> <div class="student-meta" style="flex: 1; min-width: 0;">
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;">
<div style="min-width: 0;"> <div style="min-width: 0;">
<h2 id="walletName" style="word-break: break-word; margin: 0; font-size: 1.15rem; font-weight: 800;">Cargando...</h2> <h2 id="walletName" style="word-break: break-word; margin: 0; font-size: 1.15rem; font-weight: 800;">Cargando...</h2>
<span id="walletGrade" class="student-grade">Grado y Sección</span> <span id="walletGrade" class="student-grade">Grado y Sección</span>
</div> </div>
<button type="button" onclick="logout(true)" class="wallet-logout-pill" title="Cerrar sesión o cambiar de estudiante">
<span>🚪 Salir</span>
</button>
</div>
</div> </div>
</div> </div>
@@ -1078,8 +1070,8 @@
</button> </button>
</nav> </nav>
<script src="/js/sounds.js?v=8.0"></script> <script src="/js/sounds.js?v=8.1"></script>
<script src="/js/jsQR.js"></script> <script src="/js/jsQR.js"></script>
<script src="/js/app.js?v=8.0"></script> <script src="/js/app.js?v=8.1"></script>
</body> </body>
</html> </html>
+2 -6
View File
@@ -51,7 +51,7 @@ document.addEventListener('DOMContentLoaded', async () => {
// Registrar Service Worker para PWA // Registrar Service Worker para PWA
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js?v=8.0').then(reg => { navigator.serviceWorker.register('/sw.js?v=8.1').then(reg => {
// Registro limpio sin recargas forzadas // Registro limpio sin recargas forzadas
}).catch(err => console.log('SW error:', err)); }).catch(err => console.log('SW error:', err));
} }
@@ -521,10 +521,8 @@ function renderProducts() {
grid.innerHTML = filtered.map(prod => { grid.innerHTML = filtered.map(prod => {
const isOutOfStock = prod.control_stock === 1 && (prod.stock <= 0 || prod.disponible === 0); const isOutOfStock = prod.control_stock === 1 && (prod.stock <= 0 || prod.disponible === 0);
const stockBadge = prod.control_stock === 1 const stockBadge = (prod.control_stock === 1 && isOutOfStock)
? (isOutOfStock
? '<span class="badge-out-of-stock">🚫 AGOTADO</span>' ? '<span class="badge-out-of-stock">🚫 AGOTADO</span>'
: `<span style="font-size: 0.68rem; font-weight: 800; color: #166534; background: #dcfce7; padding: 2px 6px; border-radius: 4px;">🟢 ${prod.stock} disponibles</span>`)
: ''; : '';
return ` return `
@@ -1549,7 +1547,6 @@ function renderActiveChildDetails(child) {
const name = document.getElementById('parentActiveChildName'); const name = document.getElementById('parentActiveChildName');
const meta = document.getElementById('parentActiveChildMeta'); const meta = document.getElementById('parentActiveChildMeta');
const balance = document.getElementById('parentActiveChildBalance'); const balance = document.getElementById('parentActiveChildBalance');
const linkCarnet = document.getElementById('btnParentViewCarnet');
const lblLimit = document.getElementById('lblParentDailyLimitDisplay'); const lblLimit = document.getElementById('lblParentDailyLimitDisplay');
const inputCustomLimit = document.getElementById('inputParentCustomLimit'); const inputCustomLimit = document.getElementById('inputParentCustomLimit');
const rangeLimit = document.getElementById('rangeParentLimit'); const rangeLimit = document.getElementById('rangeParentLimit');
@@ -1559,7 +1556,6 @@ function renderActiveChildDetails(child) {
if (name) name.textContent = child.nombre_completo; if (name) name.textContent = child.nombre_completo;
if (meta) meta.textContent = `${child.grado} - Sección ${child.seccion} • Cód: ${child.codigo_estudiante}`; if (meta) meta.textContent = `${child.grado} - Sección ${child.seccion} • Cód: ${child.codigo_estudiante}`;
if (balance) balance.textContent = `₡${(child.saldo_colones || 0).toLocaleString('es-CR')}`; if (balance) balance.textContent = `₡${(child.saldo_colones || 0).toLocaleString('es-CR')}`;
if (linkCarnet) linkCarnet.href = `/carnet.html?token=${child.qr_token || ''}&id=${child.id}`;
const currentLimit = child.limite_diario_colones || 3000; const currentLimit = child.limite_diario_colones || 3000;
if (lblLimit) lblLimit.textContent = `₡${currentLimit.toLocaleString('es-CR')}`; if (lblLimit) lblLimit.textContent = `₡${currentLimit.toLocaleString('es-CR')}`;
+2 -2
View File
@@ -1,5 +1,5 @@
// RecreoPay PWA Service Worker v8.0 - Portal Padres, Registro QR y Buscador Admin // RecreoPay PWA Service Worker v8.1
const CACHE_NAME = 'recreopay-v8.0'; const CACHE_NAME = 'recreopay-v8.1';
const STATIC_ASSETS = [ const STATIC_ASSETS = [
'/', '/',
'/index.html', '/index.html',