feat(catalog): fotos reales verificadas especificamente para cada alimento y bebida tica
This commit is contained in:
+12
-4
@@ -796,11 +796,15 @@ function renderProducts() {
|
||||
const hasAlergenos = prod.alergenos &&
|
||||
!['ninguno', 'ninguno conocido', 'no', 'ninguno.', 'sin alérgenos', 'sin alergenos', 'n/a'].includes(String(prod.alergenos).trim().toLowerCase());
|
||||
|
||||
const mediaHtml = prod.imagen_url
|
||||
? `<div style="width: 100%; height: 130px; border-radius: 12px; overflow: hidden; margin-bottom: 10px; background: #f8fafc; border: 1px solid var(--border, #e2e8f0); position: relative; box-shadow: 0 2px 6px rgba(0,0,0,0.03);">
|
||||
<img src="${prod.imagen_url}" alt="${prod.nombre}" style="width: 100%; height: 100%; object-fit: cover; display: block;" onerror="this.onerror=null; this.parentElement.innerHTML=\`${iconHtml}\`;">
|
||||
</div>`
|
||||
: `<div style="display: flex; justify-content: center; align-items: center; margin-bottom: 8px;">${iconHtml}</div>`;
|
||||
|
||||
return `
|
||||
<div class="product-card ${isOutOfStock ? 'out-of-stock' : ''}">
|
||||
<div style="display: flex; justify-content: center; align-items: center; margin-bottom: 8px;">
|
||||
${iconHtml}
|
||||
</div>
|
||||
${mediaHtml}
|
||||
<div>
|
||||
<div style="display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px;">
|
||||
${prod.cumple_mep ? '<span class="badge-mep">MEP Saludable</span>' : ''}
|
||||
@@ -3268,12 +3272,16 @@ function renderAdminInventory(list) {
|
||||
? window.SiboPayIcons.getFoodIconBadge(p.icono, p.nombre, 'badge')
|
||||
: `<div style="font-size: 1.8rem; text-align: center; flex-shrink: 0; min-width: 40px;">${p.icono || '🥪'}</div>`;
|
||||
|
||||
const mediaBadge = p.imagen_url
|
||||
? `<img src="${p.imagen_url}" alt="${p.nombre}" style="width: 42px; height: 42px; border-radius: 9px; object-fit: cover; border: 1.2px solid var(--border, #e2e8f0); display: block;" onerror="this.onerror=null; this.parentElement.innerHTML=\`${iconBadge}\`;">`
|
||||
: iconBadge;
|
||||
|
||||
return `
|
||||
<div class="inventory-item-row" style="${isOutOfStock ? 'background: #fff1f2;' : ''}">
|
||||
<div class="inventory-item-top" style="display: flex; align-items: center; justify-content: space-between; gap: 10px;">
|
||||
<div style="display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;">
|
||||
<div style="flex-shrink: 0; display: flex; align-items: center; justify-content: center;">
|
||||
${iconBadge}
|
||||
${mediaBadge}
|
||||
</div>
|
||||
<div style="flex: 1; min-width: 0;">
|
||||
<div style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap;">
|
||||
|
||||
+9
-1
@@ -340,12 +340,20 @@ function renderPosProducts(catId) {
|
||||
const isOutOfStock = prod.disponible === 0 || (prod.control_stock === 1 && prod.stock <= 0);
|
||||
const isFirstMatch = hasSearch && idx === 0 && !isOutOfStock;
|
||||
|
||||
const iconBadge = window.SiboPayIcons ? window.SiboPayIcons.getFoodIconBadge(prod.icono, prod.nombre, 'card') : `<div style="font-size: 2.2rem; text-align: center; margin-bottom: 6px;">${prod.icono || '🥪'}</div>`;
|
||||
|
||||
const mediaHtml = prod.imagen_url
|
||||
? `<div style="width: 100%; height: 95px; border-radius: 9px; overflow: hidden; margin-bottom: 8px; background: #f8fafc; border: 1px solid #e2e8f0; position: relative;">
|
||||
<img src="${prod.imagen_url}" alt="${prod.nombre}" style="width: 100%; height: 100%; object-fit: cover; display: block;" onerror="this.onerror=null; this.parentElement.innerHTML=\`${iconBadge}\`;">
|
||||
</div>`
|
||||
: iconBadge;
|
||||
|
||||
return `
|
||||
<div class="pos-prod-card ${isOutOfStock ? 'out-of-stock-pos' : ''} ${isFirstMatch ? 'search-match-first' : ''}"
|
||||
title="${isFirstMatch ? 'Primer resultado coincidente (pulsa Enter para cobrar)' : ''}"
|
||||
onclick="${isOutOfStock ? `alert('El producto \\'${prod.nombre.replace(/'/g, "\\'")}\\' se encuentra bloqueado o agotado.')` : `addToPosCart(${prod.id})`}">
|
||||
${isOutOfStock ? '<div style="position: absolute; top: 10px; right: 10px;"><span class="saas-status-badge saas-status-blocked"><span class="saas-dot"></span>BLOQUEADO</span></div>' : (isFirstMatch ? '<div style="position: absolute; top: 8px; right: 8px;"><span class="saas-status-badge saas-status-active" style="font-size: 0.65rem; padding: 2px 6px;">Enter ↵</span></div>' : '')}
|
||||
${window.SiboPayIcons ? window.SiboPayIcons.getFoodIconBadge(prod.icono, prod.nombre, 'card') : `<div style="font-size: 2.2rem; text-align: center; margin-bottom: 6px;">${prod.icono || '🥪'}</div>`}
|
||||
${mediaHtml}
|
||||
<div>
|
||||
<div class="prod-title">${prod.nombre}</div>
|
||||
${prod.cumple_mep ? '<span style="font-size: 0.68rem; color: #166534; font-weight: 700; margin-top: 3px; display: inline-flex; align-items: center; gap: 3px;">🌿 MEP Saludable</span>' : ''}
|
||||
|
||||
Reference in New Issue
Block a user