48 lines
2.7 KiB
PHP
48 lines
2.7 KiB
PHP
<!-- PC Card -->
|
|
<div class="glass-card p-3 product-card h-100 d-none d-lg-flex flex-column bg-white">
|
|
<div class="product-img-container mb-3">
|
|
<a href="product.php?id=<?php echo $product['id']; ?>">
|
|
<img src="<?php echo $product['image_url']; ?>" class="product-img" alt="<?php echo $product['name']; ?>">
|
|
<?php if (isset($product['is_hot']) && $product['is_hot']): ?>
|
|
<span class="badge-hot">HOT</span>
|
|
<?php endif; ?>
|
|
</a>
|
|
</div>
|
|
<div class="px-2 flex-grow-1 d-flex flex-column">
|
|
<span class="text-muted small"><?php echo $product['category_name'] ?? ''; ?></span>
|
|
<h5 class="text-dark mb-3">
|
|
<a href="product.php?id=<?php echo $product['id']; ?>" class="text-dark text-decoration-none hover-primary fw-bold">
|
|
<?php echo $product['name']; ?>
|
|
</a>
|
|
</h5>
|
|
<div class="mt-auto d-flex justify-content-between align-items-center">
|
|
<span class="price-tag"><?php echo $product['price_usdt']; ?> <small class="small">USDT</small></span>
|
|
<button class="btn btn-sm btn-outline-primary rounded-circle" onclick="addToCart(<?php echo $product['id']; ?>, '<?php echo addslashes($product['name']); ?>', <?php echo $product['price_usdt']; ?>, '<?php echo $product['image_url']; ?>')">
|
|
<i class="bi bi-cart-plus"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile Card (Taobao Style) -->
|
|
<div class="product-card-mobile d-lg-none">
|
|
<a href="product.php?id=<?php echo $product['id']; ?>" class="text-decoration-none">
|
|
<img src="<?php echo $product['image_url']; ?>" class="product-img-mobile" alt="<?php echo $product['name']; ?>">
|
|
</a>
|
|
<div class="product-info-mobile">
|
|
<a href="product.php?id=<?php echo $product['id']; ?>" class="text-decoration-none">
|
|
<div class="product-title-mobile">
|
|
<?php if (isset($product['is_hot']) && $product['is_hot']): ?>
|
|
<span class="product-tag-mobile">爆款</span>
|
|
<?php endif; ?>
|
|
<?php echo $product['name']; ?>
|
|
</div>
|
|
</a>
|
|
<div class="d-flex justify-content-between align-items-center mt-2">
|
|
<span class="product-price-mobile"><?php echo $product['price_usdt']; ?> <small style="font-size: 0.6rem;">USDT</small></span>
|
|
<button class="btn btn-sm p-0 text-primary" onclick="addToCart(<?php echo $product['id']; ?>, '<?php echo addslashes($product['name']); ?>', <?php echo $product['price_usdt']; ?>, '<?php echo $product['image_url']; ?>')">
|
|
<i class="bi bi-cart-plus-fill fs-5"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|