feat: 챗봇 관련 제품에 분류 뱃지 추가 (내부구충제, 심장사상충약 등)

This commit is contained in:
thug0bin
2026-02-28 12:32:03 +09:00
parent a42af23038
commit 4c93ee038a
2 changed files with 19 additions and 9 deletions

View File

@@ -987,7 +987,7 @@
imgContainer.innerHTML = '<div style="width:40px;height:40px;background:#f1f5f9;border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:20px;">💊</div>';
}
// 텍스트 (약국/도매 재고)
// 텍스트 (카테고리 뱃지 + 약국/도매 재고)
const textDiv = document.createElement('div');
const pharmacyStock = p.stock || 0;
const wholesalerStock = p.wholesaler_stock || 0;
@@ -995,7 +995,13 @@
const pharmacyText = (pharmacyStock > 0) ? `약국 ${pharmacyStock}` : '품절';
const wholesalerText = (wholesalerStock > 0) ? `도매 ${wholesalerStock}` : '';
const stockDisplay = wholesalerText ? `${pharmacyText} / ${wholesalerText}` : pharmacyText;
textDiv.innerHTML = `<div style="font-size:13px;font-weight:500;color:#334155;">${p.name}</div><div style="font-size:12px;"><span style="color:#10b981;">${formatPrice(p.price)}</span> <span style="color:${stockColor};margin-left:6px;">${stockDisplay}</span></div>`;
// 카테고리 뱃지
const categoryBadge = p.category
? `<span style="display:inline-block;background:#8b5cf6;color:#fff;font-size:10px;padding:2px 5px;border-radius:3px;margin-left:4px;">${p.category}</span>`
: '';
textDiv.innerHTML = `<div style="font-size:13px;font-weight:500;color:#334155;">${p.name}${categoryBadge}</div><div style="font-size:12px;"><span style="color:#10b981;">${formatPrice(p.price)}</span> <span style="color:${stockColor};margin-left:6px;">${stockDisplay}</span></div>`;
card.appendChild(imgContainer);
card.appendChild(textDiv);