style: 添加平台标签显示,优化商品卡片布局
This commit is contained in:
+7
-3
@@ -85,7 +85,11 @@
|
||||
.product-img img { width: 100%; height: 100%; object-fit: cover; }
|
||||
.product-info { flex: 1; min-width: 0; }
|
||||
.product-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.product-shop { font-size: 11px; color: var(--text-light); margin-bottom: 6px; }
|
||||
.product-shop { font-size: 11px; color: var(--text-light); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
|
||||
.platform-badge { display: inline-block; padding: 1px 4px; border-radius: 3px; font-size: 10px; font-weight: 600; color: white; }
|
||||
.platform-badge.taobao { background: #ff5000; }
|
||||
.platform-badge.jd { background: #c00; }
|
||||
.platform-badge.pinduoduo { background: #c00; }
|
||||
.product-bottom { display: flex; align-items: center; justify-content: space-between; }
|
||||
.product-price { color: #ef4444; font-weight: 700; font-size: 15px; }
|
||||
.product-coupon { background: var(--primary); color: white; font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 600; }
|
||||
@@ -263,7 +267,7 @@
|
||||
dealsGrid.innerHTML = deals.map(deal => `
|
||||
<div class="deal-card" onclick='openDeal(${JSON.stringify(deal)})'>
|
||||
<div class="deal-img"><img src="https://picsum.photos/seed/${deal.id}/200/200" alt="${deal.title}" loading="lazy" onerror="this.style.display='none'"></div>
|
||||
<div class="deal-title">${deal.title}</div>
|
||||
<div class="deal-title" style="margin-top:4px;"><span class="platform-badge ${deal.platform}" style="font-size:9px;margin-right:4px;">${PLATFORM_NAME[deal.platform] || deal.platform}</span>${deal.title}</div>
|
||||
<div class="deal-price">¥${deal.price}<span>¥${deal.originalPrice}</span><span class="deal-tag">${deal.discount}</span></div>
|
||||
<div class="deal-commission">🎁 预估返 ¥${deal.commission || 0}</div>
|
||||
</div>
|
||||
@@ -328,7 +332,7 @@
|
||||
<div class="product-img"><img src="https://picsum.photos/seed/${p.id}/200/200" alt="${p.title}" loading="lazy" onerror="this.parentElement.innerHTML='🏷️'"></div>
|
||||
<div class="product-info">
|
||||
<div class="product-title">${p.title}</div>
|
||||
<div class="product-shop">🏪 ${p.shop}</div>
|
||||
<div class="product-shop"><span class="platform-badge ${p.platform}">${PLATFORM_NAME[p.platform] || p.platform}</span> ${p.shop}</div>
|
||||
<div class="product-bottom">
|
||||
<span class="product-price">¥${p.price}</span>
|
||||
<span class="product-coupon">-¥${p.coupon}券</span>
|
||||
|
||||
Reference in New Issue
Block a user