Actualizar index.html
This commit is contained in:
194
index.html
194
index.html
@@ -64,39 +64,12 @@
|
|||||||
|
|
||||||
<div class="px-5 flex-1 flex flex-col gap-6 fade-in" style="animation-delay: 0.2s;">
|
<div class="px-5 flex-1 flex flex-col gap-6 fade-in" style="animation-delay: 0.2s;">
|
||||||
|
|
||||||
<h2 class="text-3xl font-black text-slate-800 tracking-tight">Hola, <span id="clientName" class="text-blue-600">Cliente</span></h2>
|
<h2 class="text-4xl font-black text-slate-800 tracking-tight pl-2">Hola, <span id="clientName" class="text-blue-600">Cliente</span></h2>
|
||||||
|
|
||||||
<div id="mainServiceHeader" class="bg-white/80 backdrop-blur-xl p-6 rounded-[2rem] shadow-xl shadow-slate-200/40 border border-white space-y-5 hidden">
|
<div id="activeServicesContainer" class="space-y-6 mt-2">
|
||||||
<div>
|
|
||||||
<p class="text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1">Motivo de la Visita</p>
|
|
||||||
<h3 id="mainServiceDesc" class="font-black text-slate-800 text-sm leading-snug"></h3>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-3 pt-4 border-t border-slate-100">
|
<div id="noActiveServices" class="hidden text-center p-6 bg-white/80 backdrop-blur-xl rounded-[2.5rem] shadow-xl shadow-slate-200/40 border border-white">
|
||||||
<div class="flex items-center gap-3">
|
|
||||||
<div class="w-8 h-8 bg-slate-50 rounded-full flex items-center justify-center text-slate-400 shrink-0 shadow-sm border border-slate-100"><i data-lucide="map-pin" class="w-4 h-4"></i></div>
|
|
||||||
<p id="mainServiceAddress" class="text-xs font-bold text-slate-600 leading-tight uppercase"></p>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-3">
|
|
||||||
<div class="w-8 h-8 bg-slate-50 rounded-full flex items-center justify-center text-slate-400 shrink-0 shadow-sm border border-slate-100"><i data-lucide="phone" class="w-4 h-4"></i></div>
|
|
||||||
<p id="mainServicePhone" class="text-xs font-bold text-slate-600"></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="contactButtons" class="grid grid-cols-2 gap-3 pt-4 border-t border-slate-100 hidden">
|
|
||||||
<button onclick="alert('Llamando al técnico (Próximamente conectaremos su número)')" class="bg-blue-50 border border-blue-100 text-blue-600 font-black py-3 rounded-xl hover:bg-blue-100 flex items-center justify-center gap-2 transition-all active:scale-95 shadow-sm">
|
|
||||||
<i data-lucide="phone" class="w-4 h-4"></i> <span class="text-[10px] uppercase tracking-widest">Llamar</span>
|
|
||||||
</button>
|
|
||||||
<button onclick="alert('Abriendo WhatsApp del técnico (Próximamente conectaremos su número)')" class="bg-emerald-50 border border-emerald-100 text-emerald-600 font-black py-3 rounded-xl hover:bg-emerald-100 flex items-center justify-center gap-2 transition-all active:scale-95 shadow-sm">
|
|
||||||
<i data-lucide="message-circle" class="w-4 h-4"></i> <span class="text-[10px] uppercase tracking-widest">WhatsApp</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="activeServicesContainer" class="space-y-6">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="noActiveServices" class="hidden text-center mt-2 p-6 bg-white/80 backdrop-blur-xl rounded-[2.5rem] shadow-xl shadow-slate-200/40 border border-white">
|
|
||||||
<div class="w-16 h-16 bg-slate-100 text-slate-400 rounded-full flex items-center justify-center mx-auto mb-4">
|
<div class="w-16 h-16 bg-slate-100 text-slate-400 rounded-full flex items-center justify-center mx-auto mb-4">
|
||||||
<i data-lucide="check-circle" class="w-8 h-8"></i>
|
<i data-lucide="check-circle" class="w-8 h-8"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -214,42 +187,28 @@
|
|||||||
document.getElementById('companyLogo').src = company.logo;
|
document.getElementById('companyLogo').src = company.logo;
|
||||||
document.getElementById('companyLogoContainer').classList.remove('hidden');
|
document.getElementById('companyLogoContainer').classList.remove('hidden');
|
||||||
}
|
}
|
||||||
document.getElementById('clientName').innerText = client.name.split(' ')[0];
|
document.getElementById('clientName').innerText = client.name.split(' ')[0].toUpperCase();
|
||||||
|
|
||||||
const activeContainer = document.getElementById('activeServicesContainer');
|
const activeContainer = document.getElementById('activeServicesContainer');
|
||||||
const historyContainer = document.getElementById('historyServicesContainer');
|
const historyContainer = document.getElementById('historyServicesContainer');
|
||||||
const historyWrapper = document.getElementById('historyContainerWrapper');
|
const historyWrapper = document.getElementById('historyContainerWrapper');
|
||||||
const noActiveDiv = document.getElementById('noActiveServices');
|
const noActiveDiv = document.getElementById('noActiveServices');
|
||||||
const headerCard = document.getElementById('mainServiceHeader');
|
|
||||||
|
|
||||||
activeContainer.innerHTML = '';
|
activeContainer.innerHTML = '';
|
||||||
historyContainer.innerHTML = '';
|
historyContainer.innerHTML = '';
|
||||||
|
|
||||||
let hasActive = false;
|
let hasActive = false;
|
||||||
let hasHistory = false;
|
let hasHistory = false;
|
||||||
let firstActiveRendered = false;
|
|
||||||
|
|
||||||
allServices.forEach(srv => {
|
allServices.forEach(srv => {
|
||||||
const isFinalized = srv.status_name === 'Terminado';
|
const isFinalized = srv.status_name === 'Terminado';
|
||||||
const isPendingWorker = (!srv.assigned_worker || srv.assigned_worker === 'Pendiente');
|
const isPendingWorker = (!srv.assigned_worker || srv.assigned_worker === 'Pendiente');
|
||||||
|
|
||||||
|
// Procesamos la descripción con la "mini-IA"
|
||||||
const descLimpia = summarizeDescription(srv.description);
|
const descLimpia = summarizeDescription(srv.description);
|
||||||
|
|
||||||
let statusHtml = '';
|
let statusHtml = '';
|
||||||
|
|
||||||
// SI ES EL PRIMER SERVICIO ACTIVO, RELLENAMOS LA FICHA SUPERIOR
|
|
||||||
if (!isFinalized && !firstActiveRendered) {
|
|
||||||
headerCard.classList.remove('hidden');
|
|
||||||
document.getElementById('mainServiceDesc').innerText = descLimpia;
|
|
||||||
document.getElementById('mainServiceAddress').innerText = client.addresses[0] || "Dirección no especificada";
|
|
||||||
document.getElementById('mainServicePhone').innerText = client.phone;
|
|
||||||
|
|
||||||
if (!isPendingWorker) {
|
|
||||||
document.getElementById('contactButtons').classList.remove('hidden');
|
|
||||||
} else {
|
|
||||||
document.getElementById('contactButtons').classList.add('hidden');
|
|
||||||
}
|
|
||||||
firstActiveRendered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isFinalized) {
|
if (isFinalized) {
|
||||||
// MODO HISTORIAL (Gris y apagado)
|
// MODO HISTORIAL (Gris y apagado)
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
@@ -261,57 +220,60 @@
|
|||||||
} else if (isPendingWorker) {
|
} else if (isPendingWorker) {
|
||||||
// MODO 1: AÚN NO HAY TÉCNICO (Botón de agendar bloqueado)
|
// MODO 1: AÚN NO HAY TÉCNICO (Botón de agendar bloqueado)
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-blue-50/50 border border-blue-100 p-6 rounded-3xl text-center">
|
<div class="bg-slate-100 border border-slate-200 p-6 rounded-3xl text-center">
|
||||||
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center mx-auto mb-3 relative">
|
<div class="w-12 h-12 bg-slate-200 text-slate-500 rounded-full flex items-center justify-center mx-auto mb-3 relative">
|
||||||
<span class="absolute inset-0 bg-blue-200 rounded-full animate-ping opacity-50"></span>
|
<span class="absolute inset-0 bg-slate-300 rounded-full animate-ping opacity-30"></span>
|
||||||
<i data-lucide="search" class="w-6 h-6 relative z-10"></i>
|
<i data-lucide="search" class="w-6 h-6 relative z-10"></i>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="font-black text-slate-800 uppercase text-base leading-tight tracking-tight">Buscando Técnico</h4>
|
<h4 class="font-black text-slate-700 uppercase text-sm mb-1 tracking-tight">Buscando Técnico</h4>
|
||||||
<p class="text-[10px] text-slate-500 font-medium mt-2 mb-2 px-2">Estamos asignando al técnico más cercano a tu domicilio para esta reparación.</p>
|
<p class="text-[10px] text-slate-500 font-bold leading-tight px-4 mt-2">Estamos asignando al técnico más cercano a tu domicilio.</p>
|
||||||
<p class="text-[10px] text-blue-600 font-bold leading-tight px-4 mt-2">En cuanto esté asignado, se habilitará la opción de agendar la visita aquí mismo.</p>
|
<p class="text-[10px] text-blue-600 font-bold leading-tight px-4 mt-2">En cuanto esté asignado, se habilitará la opción de agendar la visita aquí mismo.</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} else if (srv.appointment_status === 'pending') {
|
} else if (srv.appointment_status === 'pending') {
|
||||||
// MODO 2: PENDIENTE DE ACEPTACIÓN POR LA OFICINA
|
// MODO 2: PENDIENTE DE ACEPTACIÓN POR LA OFICINA
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-amber-50 border border-amber-200 p-5 rounded-3xl text-center shadow-inner">
|
<div class="bg-amber-50 border border-amber-200 p-6 rounded-3xl text-center shadow-inner">
|
||||||
<div class="w-10 h-10 bg-amber-100 text-amber-600 rounded-full flex items-center justify-center mx-auto mb-3 relative">
|
<div class="w-12 h-12 bg-amber-100 text-amber-600 rounded-full flex items-center justify-center mx-auto mb-3 relative">
|
||||||
<span class="absolute inset-0 bg-amber-200 rounded-full animate-ping opacity-50"></span>
|
<span class="absolute inset-0 bg-amber-200 rounded-full animate-ping opacity-50"></span>
|
||||||
<i data-lucide="clock" class="w-5 h-5 relative z-10"></i>
|
<i data-lucide="clock" class="w-6 h-6 relative z-10"></i>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="font-black text-amber-800 uppercase text-sm mb-1 tracking-tight">Pendiente de Confirmación</h4>
|
<h4 class="font-black text-amber-800 uppercase text-sm mb-1 tracking-tight">Pendiente de Confirmación</h4>
|
||||||
<p class="text-[10px] text-amber-700 font-bold leading-tight px-2 mt-2">Tu solicitud de fecha ha sido enviada. El técnico debe confirmarla en breve.</p>
|
<p class="text-[10px] text-amber-700 font-bold leading-tight px-2 mt-2">Tu solicitud de fecha ha sido enviada. El técnico debe confirmarla en breve.</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} else if (srv.status_name === 'Visita Agendada' || (srv.scheduled_date && srv.scheduled_time)) {
|
} else if (srv.status_name === 'Visita Agendada' || (srv.scheduled_date && srv.scheduled_time)) {
|
||||||
// MODO 3: CITA CONFIRMADA
|
// MODO 3: CITA CONFIRMADA (FRANJA DE 1 HORA)
|
||||||
const endT = addOneHour(srv.scheduled_time);
|
const endT = addOneHour(srv.scheduled_time);
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-gradient-to-br from-emerald-400 to-emerald-600 p-5 rounded-3xl flex items-center gap-4 text-white shadow-lg shadow-emerald-500/30 relative overflow-hidden">
|
<div class="bg-gradient-to-br from-emerald-400 to-emerald-600 p-6 rounded-3xl flex items-center gap-5 text-white shadow-lg shadow-emerald-500/30 relative overflow-hidden">
|
||||||
<div class="w-12 h-12 bg-white/20 rounded-2xl flex items-center justify-center backdrop-blur-md border border-white/30 shrink-0 relative z-10">
|
<div class="absolute -right-4 -top-4 opacity-10">
|
||||||
<i data-lucide="calendar-check" class="w-6 h-6 text-white"></i>
|
<i data-lucide="calendar-check" class="w-32 h-32"></i>
|
||||||
|
</div>
|
||||||
|
<div class="w-14 h-14 bg-white/20 rounded-2xl flex items-center justify-center backdrop-blur-md border border-white/30 shrink-0 relative z-10">
|
||||||
|
<i data-lucide="calendar-check" class="w-7 h-7 text-white"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative z-10">
|
<div class="relative z-10">
|
||||||
<p class="text-[8px] font-black uppercase tracking-widest text-emerald-100 mb-0.5">Visita Confirmada</p>
|
<p class="text-[9px] font-black uppercase tracking-widest text-emerald-100 mb-0.5">Visita Confirmada</p>
|
||||||
<p class="font-black uppercase text-base leading-tight mb-1">${formatDate(srv.scheduled_date)}</p>
|
<p class="font-black uppercase text-lg leading-none mb-1.5">${formatDate(srv.scheduled_date)}</p>
|
||||||
<p class="text-xs font-bold text-emerald-50 flex items-center gap-1"><i data-lucide="clock" class="w-3 h-3"></i> Llegada aprox: ${srv.scheduled_time} - ${endT}</p>
|
<p class="text-sm font-bold text-emerald-50 flex items-center gap-1.5"><i data-lucide="clock" class="w-4 h-4"></i> Llegada aprox: ${srv.scheduled_time} - ${endT}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} else if (srv.status_name === 'Técnico de Camino') {
|
} else if (srv.status_name === 'Técnico de Camino') {
|
||||||
// MODO 5: DE CAMINO
|
// MODO 5: DE CAMINO
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-indigo-50 border border-indigo-200 p-5 rounded-3xl relative overflow-hidden shadow-inner">
|
<div class="bg-indigo-50 border border-indigo-200 p-6 rounded-3xl relative overflow-hidden shadow-inner">
|
||||||
<div class="flex items-center gap-3 mb-4 relative z-10">
|
<div class="flex items-center gap-4 mb-5 relative z-10">
|
||||||
<div class="w-10 h-10 bg-indigo-500 text-white rounded-full flex items-center justify-center shadow-md animate-bounce">
|
<div class="w-12 h-12 bg-indigo-500 text-white rounded-full flex items-center justify-center shadow-md animate-bounce shrink-0">
|
||||||
<i data-lucide="truck" class="w-5 h-5"></i>
|
<i data-lucide="truck" class="w-6 h-6"></i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h4 class="font-black text-indigo-800 uppercase text-sm tracking-tight">¡Técnico en camino!</h4>
|
<h4 class="font-black text-indigo-800 uppercase text-base tracking-tight">¡Técnico en camino!</h4>
|
||||||
<p class="text-[10px] text-indigo-600 font-bold mt-1">Llegando en breves momentos a tu domicilio.</p>
|
<p class="text-[10px] text-indigo-600 font-bold mt-1">Llegando en breves momentos a tu domicilio.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full h-24 bg-indigo-100 rounded-2xl border border-indigo-200 border-dashed flex items-center justify-center text-indigo-300 relative z-10">
|
<div class="w-full h-24 bg-indigo-100/50 rounded-2xl border border-indigo-200 border-dashed flex items-center justify-center text-indigo-300 relative z-10">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<i data-lucide="map" class="w-6 h-6 mx-auto mb-1 opacity-50"></i>
|
<i data-lucide="map" class="w-6 h-6 mx-auto mb-1 opacity-50"></i>
|
||||||
<p class="text-[8px] font-black uppercase tracking-widest mt-1">Señal GPS Próximamente</p>
|
<p class="text-[8px] font-black uppercase tracking-widest mt-1">Señal GPS Próximamente</p>
|
||||||
@@ -322,26 +284,26 @@
|
|||||||
} else if (srv.status_name === 'En Reparación') {
|
} else if (srv.status_name === 'En Reparación') {
|
||||||
// MODO 8: TRABAJANDO
|
// MODO 8: TRABAJANDO
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-orange-50 border border-orange-200 p-5 rounded-3xl flex items-center gap-4 shadow-inner">
|
<div class="bg-orange-50 border border-orange-200 p-6 rounded-3xl flex items-center gap-5 shadow-inner">
|
||||||
<div class="w-12 h-12 bg-orange-500 text-white rounded-2xl flex items-center justify-center shadow-md shrink-0">
|
<div class="w-14 h-14 bg-orange-500 text-white rounded-2xl flex items-center justify-center shadow-md shrink-0">
|
||||||
<i data-lucide="hammer" class="w-6 h-6"></i>
|
<i data-lucide="hammer" class="w-7 h-7"></i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h4 class="font-black text-orange-800 uppercase text-sm tracking-tight">En Reparación</h4>
|
<h4 class="font-black text-orange-800 uppercase text-base tracking-tight">En Reparación</h4>
|
||||||
<p class="text-[10px] text-orange-600 font-bold mt-1">El técnico está trabajando en tu domicilio ahora mismo.</p>
|
<p class="text-[10px] text-orange-600 font-bold mt-1.5 leading-tight">El técnico está trabajando en tu domicilio ahora mismo.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} else if (srv.status_name === 'Pausado / Incidencia') {
|
} else if (srv.status_name === 'Pausado / Incidencia') {
|
||||||
// MODO 6: INCIDENCIA
|
// MODO 6: INCIDENCIA
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-red-50 border border-red-200 p-5 rounded-3xl flex items-center gap-4 shadow-inner">
|
<div class="bg-red-50 border border-red-200 p-6 rounded-3xl flex items-center gap-5 shadow-inner">
|
||||||
<div class="w-12 h-12 bg-red-500 text-white rounded-2xl flex items-center justify-center shadow-md shrink-0">
|
<div class="w-14 h-14 bg-red-500 text-white rounded-2xl flex items-center justify-center shadow-md shrink-0">
|
||||||
<i data-lucide="alert-triangle" class="w-6 h-6"></i>
|
<i data-lucide="alert-triangle" class="w-7 h-7"></i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h4 class="font-black text-red-800 uppercase text-sm tracking-tight">Incidencia / Pausado</h4>
|
<h4 class="font-black text-red-800 uppercase text-base tracking-tight">Incidencia / Pausado</h4>
|
||||||
<p class="text-[10px] text-red-600 font-bold mt-1">El servicio está pausado (ej: esperando pieza). Te avisaremos pronto.</p>
|
<p class="text-[10px] text-red-600 font-bold mt-1.5 leading-tight">El servicio está pausado temporalmente. Te avisaremos pronto.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@@ -349,37 +311,88 @@
|
|||||||
// MODO 4: PENDIENTE DE CITA NORMAL (Tiene técnico, no tiene cita)
|
// MODO 4: PENDIENTE DE CITA NORMAL (Tiene técnico, no tiene cita)
|
||||||
statusHtml = `
|
statusHtml = `
|
||||||
<div class="bg-blue-50/50 border border-blue-100 p-6 rounded-3xl text-center">
|
<div class="bg-blue-50/50 border border-blue-100 p-6 rounded-3xl text-center">
|
||||||
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center mx-auto mb-3 relative">
|
<div class="w-14 h-14 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center mx-auto mb-4 relative">
|
||||||
<span class="absolute inset-0 bg-blue-200 rounded-full animate-ping opacity-50"></span>
|
<span class="absolute inset-0 bg-blue-200 rounded-full animate-ping opacity-50"></span>
|
||||||
<i data-lucide="calendar-clock" class="w-6 h-6 relative z-10"></i>
|
<i data-lucide="calendar-clock" class="w-7 h-7 relative z-10"></i>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="font-black text-slate-800 uppercase text-base leading-tight tracking-tight">Pendiente de Cita</h4>
|
<h4 class="font-black text-slate-800 uppercase text-lg leading-tight tracking-tight">Pendiente de Cita</h4>
|
||||||
<p class="text-[10px] text-slate-500 font-medium mt-1 mb-4">El técnico necesita saber cuándo puede pasar por tu domicilio para la reparación.</p>
|
<p class="text-[10px] text-slate-500 font-medium mt-2 mb-5 px-2">El técnico necesita saber cuándo puede pasar por tu domicilio para la reparación.</p>
|
||||||
|
|
||||||
<button onclick="startBooking('${srv.id}')" class="w-full bg-blue-600 text-white font-black py-3.5 rounded-2xl shadow-lg shadow-blue-600/30 hover:bg-blue-700 transition-all active:scale-95 flex justify-center items-center gap-2 uppercase tracking-widest text-[10px]">
|
<button onclick="startBooking('${srv.id}')" class="w-full bg-blue-600 text-white font-black py-4 rounded-2xl shadow-xl shadow-blue-600/30 hover:bg-blue-700 transition-all active:scale-95 flex justify-center items-center gap-2 uppercase tracking-widest text-[11px]">
|
||||||
Agendar Visita Ahora <i data-lucide="arrow-right" class="w-3.5 h-3.5"></i>
|
Agendar Visita Ahora <i data-lucide="arrow-right" class="w-4 h-4"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ESTRUCTURA DE LA TARJETA DEL EXPEDIENTE (SOLO MUESTRA INFO DE GESTIÓN Y ESTADO)
|
// ESTRUCTURA DE LA TARJETA MAESTRA UNIFICADA
|
||||||
const cardHtml = `
|
let cardHtml = '';
|
||||||
<div class="bg-white/80 backdrop-blur-xl border ${isFinalized ? 'border-slate-100' : 'border-white shadow-xl shadow-slate-200/40'} rounded-[2.5rem] p-5 mb-4 relative overflow-hidden">
|
|
||||||
<div class="flex justify-between items-start mb-4">
|
if (isFinalized) {
|
||||||
|
// Historial compacto
|
||||||
|
cardHtml = `
|
||||||
|
<div class="bg-white/80 backdrop-blur-xl border border-slate-100 rounded-[2rem] p-5 mb-4 relative overflow-hidden">
|
||||||
|
<div class="flex justify-between items-start mb-3">
|
||||||
<div class="pr-2">
|
<div class="pr-2">
|
||||||
<span class="text-[9px] font-black text-slate-400 uppercase tracking-widest">Exp. #${srv.title.replace('Expediente #', '').replace('🚨 URGENTE: ', '')}</span>
|
<span class="text-[9px] font-black text-slate-400 uppercase tracking-widest">Exp. #${srv.title.replace('Expediente #', '').replace('🚨 URGENTE: ', '')}</span>
|
||||||
|
<h3 class="font-black text-slate-800 text-sm mt-0.5 leading-tight">${descLimpia}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
${statusHtml}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
} else {
|
||||||
|
// Tarjeta Principal Activa (La que te gusta pero ordenada para no ocultar el botón)
|
||||||
|
cardHtml = `
|
||||||
|
<div class="bg-white/80 backdrop-blur-xl border border-white shadow-xl shadow-slate-200/40 rounded-[2.5rem] p-6 mb-6 relative overflow-hidden">
|
||||||
|
|
||||||
|
<div class="flex justify-between items-start mb-5">
|
||||||
|
<div class="pr-2">
|
||||||
|
<span class="text-[10px] font-black text-slate-400 uppercase tracking-widest">Expediente #${srv.title.replace('Expediente #', '').replace('🚨 URGENTE: ', '')}</span>
|
||||||
</div>
|
</div>
|
||||||
${srv.assigned_worker && srv.assigned_worker !== 'Pendiente' ?
|
${srv.assigned_worker && srv.assigned_worker !== 'Pendiente' ?
|
||||||
`<div class="bg-slate-50 border border-slate-100 px-2 py-1 rounded-md text-center shrink-0">
|
`<div class="bg-slate-50 border border-slate-100 px-3 py-1.5 rounded-lg text-center shrink-0">
|
||||||
<p class="text-[8px] uppercase font-black text-slate-400 mb-0.5">Técnico</p>
|
<p class="text-[8px] uppercase font-black text-slate-400 mb-0.5">Técnico</p>
|
||||||
<p class="text-[10px] font-bold text-blue-600">${srv.assigned_worker.split(' ')[0]}</p>
|
<p class="text-[10px] font-bold text-blue-600">${srv.assigned_worker.split(' ')[0]}</p>
|
||||||
</div>` : ''
|
</div>` : ''
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-6">
|
||||||
${statusHtml}
|
${statusHtml}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="pt-5 border-t border-slate-100 space-y-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1.5">Motivo de la Visita</p>
|
||||||
|
<h3 class="font-black text-slate-800 text-sm leading-snug">${descLimpia}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-3">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-8 h-8 bg-slate-50 rounded-full flex items-center justify-center text-slate-400 shrink-0 shadow-sm border border-slate-100"><i data-lucide="map-pin" class="w-4 h-4"></i></div>
|
||||||
|
<p class="text-xs font-bold text-slate-600 leading-tight uppercase">${client.addresses[0] || "Dirección no especificada"}</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-8 h-8 bg-slate-50 rounded-full flex items-center justify-center text-slate-400 shrink-0 shadow-sm border border-slate-100"><i data-lucide="phone" class="w-4 h-4"></i></div>
|
||||||
|
<p class="text-xs font-bold text-slate-600">${client.phone}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
${!isPendingWorker ? `
|
||||||
|
<div class="grid grid-cols-2 gap-3 pt-5 mt-5 border-t border-slate-100">
|
||||||
|
<button onclick="alert('Funcionalidad de llamada al técnico próximamente.')" class="bg-blue-50 border border-blue-100 text-blue-600 font-black py-3 rounded-xl hover:bg-blue-100 flex items-center justify-center gap-2 transition-all active:scale-95 shadow-sm">
|
||||||
|
<i data-lucide="phone" class="w-4 h-4"></i> <span class="text-[10px] uppercase tracking-widest">Llamar</span>
|
||||||
|
</button>
|
||||||
|
<button onclick="alert('Funcionalidad de WhatsApp al técnico próximamente.')" class="bg-emerald-50 border border-emerald-100 text-emerald-600 font-black py-3 rounded-xl hover:bg-emerald-100 flex items-center justify-center gap-2 transition-all active:scale-95 shadow-sm">
|
||||||
|
<i data-lucide="message-circle" class="w-4 h-4"></i> <span class="text-[10px] uppercase tracking-widest">WhatsApp</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
` : ''}
|
||||||
|
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
if (isFinalized) {
|
if (isFinalized) {
|
||||||
historyContainer.innerHTML += cardHtml;
|
historyContainer.innerHTML += cardHtml;
|
||||||
@@ -393,7 +406,6 @@
|
|||||||
// GESTIÓN DE VISIBILIDAD DE CONTENEDORES
|
// GESTIÓN DE VISIBILIDAD DE CONTENEDORES
|
||||||
if (!hasActive) {
|
if (!hasActive) {
|
||||||
activeContainer.classList.add('hidden');
|
activeContainer.classList.add('hidden');
|
||||||
headerCard.classList.add('hidden');
|
|
||||||
noActiveDiv.classList.remove('hidden');
|
noActiveDiv.classList.remove('hidden');
|
||||||
} else {
|
} else {
|
||||||
activeContainer.classList.remove('hidden');
|
activeContainer.classList.remove('hidden');
|
||||||
|
|||||||
Reference in New Issue
Block a user