Add large image action to AI recommendations

This commit is contained in:
Jacky Ser
2026-08-11 16:28:39 +08:00
parent 7eed023539
commit e8759531b7
2 changed files with 15 additions and 9 deletions

View File

@@ -838,14 +838,19 @@ export default function Home() {
<div className="recommendation-grid">
{topMatches.map((match, index) => (
<article className={`recommendation-card ${index === 0 ? "is-primary" : ""}`} key={match.product.id}>
<div className="recommendation-image-wrap">
<button
type="button"
className="recommendation-image-wrap"
onClick={() => setSelectedCatalogProduct(match.product)}
aria-label={`查看${match.product.name}大图`}
>
<img src={match.product.image} alt={match.product.name} />
<span className="match-badge">
{index === 0 ? (match.coreCompatible ? "首选推荐" : "待复核候选") : `${match.confidence}% 匹配`}
</span>
</div>
<span className="recommendation-zoom-hint"></span>
</button>
<div className="recommendation-content">
<div className="match-score"><span></span><strong>{match.confidence}%</strong></div>
<p className="product-code">{match.product.code}</p>
<h3>{match.product.name}</h3>
<p className="product-subtitle">{match.product.category} · {match.product.size || "尺寸待复核"}</p>