Actualizar asignados.html
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
<input type="hidden" id="detId">
|
||||
<input type="hidden" id="detPhoneRaw">
|
||||
<div id="phoneSelectorRow" class="hidden flex items-center gap-2 mb-3 overflow-x-auto no-scrollbar"></div>
|
||||
<div class="grid grid-cols-2 gap-3 mb-6">
|
||||
<div class="grid grid-cols-3 gap-3 mb-6">
|
||||
<button onclick="callClient()" class="bg-blue-50 border border-blue-100 text-blue-600 font-black py-3 rounded-2xl flex items-center justify-center gap-2 active:scale-95 transition-transform shadow-sm">
|
||||
<i data-lucide="phone" class="w-5 h-5"></i>
|
||||
<span class="text-[10px] uppercase tracking-widest">Llamar</span>
|
||||
@@ -131,6 +131,10 @@
|
||||
<i data-lucide="message-circle" class="w-5 h-5"></i>
|
||||
<span class="text-[10px] uppercase tracking-widest">WhatsApp</span>
|
||||
</button>
|
||||
<button onclick="sendInstagramPromo()" class="bg-pink-50 border border-pink-100 text-pink-600 font-black py-3 rounded-2xl flex items-center justify-center gap-2 active:scale-95 transition-transform shadow-sm">
|
||||
<i data-lucide="instagram" class="w-5 h-5"></i>
|
||||
<span class="text-[10px] uppercase tracking-widest">Instagram</span>
|
||||
</button>
|
||||
</div>
|
||||
<hr class="border-slate-100 mb-6">
|
||||
<div class="bg-white border border-slate-200 rounded-[1.5rem] p-5 shadow-sm space-y-5">
|
||||
@@ -959,6 +963,22 @@ function renderServices(servicesToRender = localServices) {
|
||||
if (phone) window.open(`https://wa.me/34${phone}`, '_blank');
|
||||
else alert("No hay un teléfono válido guardado.");
|
||||
}
|
||||
async function sendInstagramPromo() {
|
||||
const id = document.getElementById('detId').value;
|
||||
if (!id) return;
|
||||
try {
|
||||
const res = await fetch(`${API_URL}/services/${id}/send-instagram`, {
|
||||
method: 'POST',
|
||||
headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` }
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.ok) alert("¡Mensaje de Instagram enviado! 📸");
|
||||
else alert(data.error || "No se pudo enviar el mensaje de Instagram.");
|
||||
} catch (e) {
|
||||
alert("Error de conexión al enviar el mensaje de Instagram.");
|
||||
}
|
||||
}
|
||||
|
||||
// 📞 Cuando el servicio trae más de un teléfono (típico de HomeServe), pintamos un
|
||||
// selector de chips para que el operario elija cuál usar antes de Llamar/WhatsApp.
|
||||
// Con un solo teléfono no mostramos nada (para no añadir ruido visual de más).
|
||||
|
||||
Reference in New Issue
Block a user