diff --git a/modules/turnero/views/chat.php b/modules/turnero/views/chat.php new file mode 100644 index 0000000..7f67583 --- /dev/null +++ b/modules/turnero/views/chat.php @@ -0,0 +1,573 @@ + + + +
+ + +Selecciona un contacto para ver la conversación
+Sin turno activo
@@ -508,6 +517,7 @@ async function seleccionarSinLlamar(turnoId) { await cargarFichaSolicitud(t.id); clearInterval(pollingConsentId); pollingConsentId = setInterval(() => actualizarConsentimientos(turnoActivo?.id), 5000); + mostrarFichaMobile(); } async function rellamarDesdeCard(turnoId) { @@ -580,6 +590,7 @@ async function abrirFicha(turno) { // Iniciar polling de consentimientos clearInterval(pollingConsentId); pollingConsentId = setInterval(() => actualizarConsentimientos(turnoActivo?.id), 5000); + mostrarFichaMobile(); } // ── Cargar datos de la solicitud del turno ──────────────────── @@ -823,6 +834,19 @@ function resetFicha() { document.getElementById('btn-iniciar').disabled = false; document.getElementById('btn-finalizar').classList.add('d-none'); document.getElementById('btn-regresar').classList.add('d-none'); + + volverACola(); +} + +function esMobile() { return window.innerWidth <= 860; } +function mostrarFichaMobile() { + if (!esMobile()) return; + document.getElementById('lugar-ficha').classList.add('mobile-visible'); + document.querySelector('.lugar-cola').classList.add('mobile-oculta'); +} +function volverACola() { + document.getElementById('lugar-ficha').classList.remove('mobile-visible'); + document.querySelector('.lugar-cola').classList.remove('mobile-oculta'); } // ── Helpers ─────────────────────────────────────────────────── diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index 0a1ef17..c36b2ec 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -88,8 +88,12 @@ $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user'][' overflow: hidden; } @media (max-width: 900px) { - .rec-layout { grid-template-columns: 1fr; } - .rec-cola { max-height: 260px; } + .rec-layout { grid-template-columns: 1fr; position: relative; overflow: hidden; } + .rec-cola { transition: transform .2s ease; } + .rec-cola.mobile-oculta { transform: translateX(-100%); position: absolute; inset: 0; pointer-events: none; } + .rec-ficha { position: absolute; inset: 0; background: #fff; z-index: 10; transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; } + .rec-ficha.mobile-visible { transform: translateX(0); } + .btn-volver-cola { display: inline-flex !important; align-items: center; gap: 6px; } } /* ── Columna cola ── */ @@ -347,6 +351,11 @@ document.addEventListener('DOMContentLoaded', function() {Sin turno activo
@@ -1038,6 +1047,7 @@ function abrirFicha(turno) { // Cargar consentimientos del desk actual para este turno if (DESK_ID) cargarConsentimientosDesk(turno.id); + mostrarFichaMobile(); } // ── Cargar consentimientos del desk para el turno ───────────── @@ -1637,6 +1647,7 @@ async function marcarAusente() { document.getElementById('ficha-placeholder').classList.remove('d-none'); document.getElementById('badge-turno-activo').classList.add('d-none'); cargarCola(); + volverACola(); } // ── Soltar turno ────────────────────────────────────────────── @@ -1657,6 +1668,7 @@ async function soltarTurno() { document.getElementById('badge-turno-activo').classList.add('d-none'); mostrarToast('Turno liberado', 'success'); cargarCola(); + volverACola(); } // ── Helpers ─────────────────────────────────────────────────── @@ -1691,6 +1703,18 @@ function resetPlaceholder() {Sin turno activo
Haga clic en "Llamar siguiente" o en de un turno de la cola`; + volverACola(); +} + +function esMobile() { return window.innerWidth <= 900; } +function mostrarFichaMobile() { + if (!esMobile()) return; + document.getElementById('rec-ficha').classList.add('mobile-visible'); + document.querySelector('.rec-cola').classList.add('mobile-oculta'); +} +function volverACola() { + document.getElementById('rec-ficha').classList.remove('mobile-visible'); + document.querySelector('.rec-cola').classList.remove('mobile-oculta'); } function mostrarError(msg) { diff --git a/shared/components/sidebar.php b/shared/components/sidebar.php index a64111b..8223758 100644 --- a/shared/components/sidebar.php +++ b/shared/components/sidebar.php @@ -188,7 +188,8 @@ if (class_exists('ModuleRegistry', false)) { $active = $_isActive($lnk['route']); ?>