feat: campos de entrada escrita para limite de gasto diario y recargas SINPE en portal de padres

This commit is contained in:
unknown
2026-10-04 17:48:50 -06:00
parent eb3dca6d19
commit 528e39dcd1
2 changed files with 149 additions and 29 deletions
+60 -22
View File
@@ -206,37 +206,75 @@
<button onclick="toggleParentPanel(false)" style="background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b;">✕</button>
</div>
<!-- RECARGA SINPE MÓVIL -->
<div style="background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 14px; margin-bottom: 16px;">
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px;">
<span style="font-size: 1.4rem;">📱</span>
<div>
<strong style="color: #166534; font-size: 0.95rem;">Recarga por SINPE Móvil</strong>
<p style="font-size: 0.75rem; color: #15803d;">Número de la Soda: <strong>8888-SODA (7632)</strong></p>
<!-- RECARGA SINPE MÓVIL (MONTO ESCRITO Y ACCESOS RÁPIDOS) -->
<div style="background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 14px; padding: 14px; margin-bottom: 16px;">
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;">
<div style="display: flex; align-items: center; gap: 8px;">
<span style="font-size: 1.4rem;">📱</span>
<div>
<strong style="color: #166534; font-size: 0.95rem;">Recarga por SINPE Móvil</strong>
<p style="font-size: 0.74rem; color: #15803d;">Número de la Soda: <strong>8888-SODA (7632)</strong></p>
</div>
</div>
<span style="font-size: 0.7rem; color: #166534; background: #dcfce7; font-weight: 800; padding: 2px 8px; border-radius: 6px;">Acreditación Inmediata</span>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;">
<button onclick="quickSinpeRecharge(2000)" style="padding: 8px; background: white; border: 1px solid #86efac; border-radius: 8px; font-weight: 700; color: #166534; cursor: pointer;">+ ₡2.000</button>
<button onclick="quickSinpeRecharge(5000)" style="padding: 8px; background: white; border: 1px solid #86efac; border-radius: 8px; font-weight: 700; color: #166534; cursor: pointer;">+ ₡5.000</button>
<label style="display: block; font-size: 0.78rem; font-weight: 800; color: #166534; margin-bottom: 4px;">
Escribe el monto a recargar:
</label>
<div style="position: relative; margin-bottom: 8px;">
<span style="position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 900; color: #166534; font-size: 1.1rem;">₡</span>
<input type="tel" inputmode="numeric" pattern="[0-9]*" id="inputCustomSinpe" placeholder="Ej: 3000" style="width: 100%; padding: 10px 10px 10px 30px; border-radius: 10px; border: 1.5px solid #86efac; font-size: 1.15rem; font-weight: 900; color: #166534; background: white;">
</div>
<div style="display: flex; gap: 6px;">
<input type="tel" inputmode="numeric" pattern="[0-9]*" id="inputCustomSinpe" placeholder="Otro monto (₡)" style="flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #cbd5e1; font-weight: 600;">
<button onclick="customSinpeRecharge()" style="padding: 8px 14px; background: #166534; color: white; border: none; border-radius: 8px; font-weight: 700; cursor: pointer;">Recargar</button>
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px;">
<button type="button" onclick="setWrittenRechargeAmount(1000)" style="padding: 7px 4px; background: white; border: 1px solid #86efac; border-radius: 8px; font-weight: 800; font-size: 0.76rem; color: #166534; cursor: pointer;">₡1.000</button>
<button type="button" onclick="setWrittenRechargeAmount(2000)" style="padding: 7px 4px; background: white; border: 1px solid #86efac; border-radius: 8px; font-weight: 800; font-size: 0.76rem; color: #166534; cursor: pointer;">₡2.000</button>
<button type="button" onclick="setWrittenRechargeAmount(5000)" style="padding: 7px 4px; background: white; border: 1px solid #86efac; border-radius: 8px; font-weight: 800; font-size: 0.76rem; color: #166534; cursor: pointer;">₡5.000</button>
<button type="button" onclick="setWrittenRechargeAmount(10000)" style="padding: 7px 4px; background: white; border: 1px solid #86efac; border-radius: 8px; font-weight: 800; font-size: 0.76rem; color: #166534; cursor: pointer;">₡10.000</button>
</div>
<button type="button" onclick="customSinpeRecharge()" style="width: 100%; padding: 12px; background: linear-gradient(135deg, #16a34a, #15803d); color: white; border: none; border-radius: 10px; font-weight: 900; font-size: 0.95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);">
<span>📲</span> Aplicar Recarga de Saldo
</button>
</div>
<!-- CONFIGURACIÓN DE LÍMITE DIARIO -->
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; margin-bottom: 16px;">
<label style="display: block; font-size: 0.85rem; font-weight: 800; color: #1e293b; margin-bottom: 6px;">
Límite de Gasto Máximo Diario: <span id="lblParentDailyLimit" style="color: #0284c7; font-weight: 900;">₡3.000</span>
<!-- CONFIGURACIÓN DE LÍMITE DIARIO (ESCRITO Y DESLIZABLE) -->
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; margin-bottom: 16px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
<div>
<strong style="font-size: 0.88rem; color: #0f172a; display: block;">🛡️ Límite de Gasto Máximo Diario</strong>
<span style="font-size: 0.72rem; color: #64748b;">Monto máximo que el alumno puede gastar por día</span>
</div>
<span id="lblParentDailyLimit" style="font-size: 1rem; color: #0284c7; font-weight: 900; background: #e0f2fe; padding: 3px 8px; border-radius: 8px;">₡3.000</span>
</div>
<label style="display: block; font-size: 0.76rem; font-weight: 800; color: #334155; margin-bottom: 4px;">
Escribe el monto del límite diario:
</label>
<input type="range" id="rangeDailyLimit" min="1000" max="6000" step="500" value="3000" oninput="onDailyLimitSlider(this.value)" style="width: 100%;">
<div style="display: flex; justify-content: space-between; font-size: 0.72rem; color: #64748b; margin-top: 4px;">
<span>₡1.000 / día</span>
<span>₡3.500</span>
<span>₡6.000 / día</span>
<div style="display: flex; gap: 6px; margin-bottom: 10px;">
<div style="position: relative; flex: 1;">
<span style="position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-weight: 900; color: #0284c7; font-size: 1rem;">₡</span>
<input type="tel" inputmode="numeric" pattern="[0-9]*" id="inputCustomDailyLimit" placeholder="Ej: 3000" oninput="onCustomDailyLimitInput(this.value)" style="width: 100%; padding: 9px 10px 9px 28px; border-radius: 8px; border: 1.5px solid #cbd5e1; font-size: 1rem; font-weight: 800; color: #0f172a; background: white;">
</div>
<button type="button" onclick="saveCustomDailyLimit()" style="padding: 9px 14px; background: #0284c7; color: white; border: none; border-radius: 8px; font-weight: 800; font-size: 0.8rem; cursor: pointer; white-space: nowrap;">
💾 Guardar
</button>
</div>
<!-- ACCESOS RÁPIDOS DE LÍMITES COMUNES -->
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px;">
<button type="button" onclick="setWrittenDailyLimit(1500)" style="padding: 5px 2px; background: white; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.72rem; font-weight: 700; color: #334155; cursor: pointer;">₡1.500</button>
<button type="button" onclick="setWrittenDailyLimit(2500)" style="padding: 5px 2px; background: white; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.72rem; font-weight: 700; color: #334155; cursor: pointer;">₡2.500</button>
<button type="button" onclick="setWrittenDailyLimit(3500)" style="padding: 5px 2px; background: white; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.72rem; font-weight: 700; color: #334155; cursor: pointer;">₡3.500</button>
<button type="button" onclick="setWrittenDailyLimit(5000)" style="padding: 5px 2px; background: white; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.72rem; font-weight: 700; color: #334155; cursor: pointer;">₡5.000</button>
</div>
<input type="range" id="rangeDailyLimit" min="1000" max="10000" step="500" value="3000" oninput="onDailyLimitSlider(this.value)" style="width: 100%;">
<div style="display: flex; justify-content: space-between; font-size: 0.7rem; color: #64748b; margin-top: 2px;">
<span>₡1.000 min</span>
<span>Deslizar para ajustar</span>
<span>₡10.000 max</span>
</div>
</div>