Files
JayuCloud/YumiNail-Frontend/src/views/ProductListView.vue
T

786 lines
24 KiB
Vue
Raw Normal View History

<template>
<div class="mobile-container">
<header class="header">
<a-button class="back-btn" type="text" @click="handleBackClick">
<LeftOutlined :style="{ fontSize: '20px' }" />
</a-button>
2026-03-05 16:08:27 +08:00
<h1 v-if="!showSearch">作品列表</h1>
2026-03-05 16:02:34 +08:00
<div v-else class="search-input-container">
<a-input-search
v-model:value="searchKeyword"
placeholder="搜索标题、标签或描述"
2026-03-05 16:02:34 +08:00
class="search-input"
enter-button
@search="handleSearch"
2026-03-05 16:02:34 +08:00
/>
</div>
<a-button class="search-btn" type="text" @click="toggleSearch">
<SearchOutlined :style="{ fontSize: '20px' }" />
</a-button>
</header>
<div class="main-content">
<div class="category-sidebar">
<button
class="category-item"
:class="{ active: selectedCategory === '全部' }"
type="button"
@click="handleCategoryClick('全部')"
>
全部
</button>
<div v-for="group in filterGroups" :key="group.groupName" class="filter-group">
<span class="filter-group__title">{{ group.groupName }}</span>
<button
v-for="tag in group.tags"
:key="tag.id"
class="category-item"
:class="{ active: selectedTagId === String(tag.id) }"
type="button"
@click="handleTagClick(tag)"
>
{{ tag.displayName || tag.tagName }}
</button>
</div>
</div>
<div class="product-section">
<a-alert
v-if="activeBannerText"
class="page-banner"
type="info"
show-icon
:message="activeBannerText"
/>
<div class="product-grid">
<a-card
v-for="item in products"
:key="item.id"
class="product-card"
:body-style="{ padding: '12px' }"
hoverable
@click="handleProductClick(item)"
>
2026-02-24 09:59:22 +08:00
<div class="product-img">
<img
v-if="getProductImages(item).length > 0"
:src="getProductImages(item)[0]"
:alt="item.title || item.name"
2026-02-24 09:59:22 +08:00
class="product-image"
/>
<div v-else class="product-img-placeholder">
<span>{{ (item.title || item.name)?.[0] || '作' }}</span>
2026-02-24 09:59:22 +08:00
</div>
</div>
2026-02-24 09:59:22 +08:00
<div class="product-info">
<p class="name">{{ item.title || item.name }}</p>
<p v-if="item.shopName" class="shop-name">所属店铺:{{ item.shopName }}</p>
2026-02-24 09:59:22 +08:00
<div class="product-meta">
<span class="duration">{{ item.approximateDuration || '时长待定' }}</span>
2026-02-24 09:59:22 +08:00
<div class="stats">
<span>{{ item.likeCount || 0 }} 点赞</span>
<span>{{ item.collectCount || 0 }} 收藏</span>
2026-02-24 09:59:22 +08:00
</div>
</div>
2026-02-24 09:59:22 +08:00
<div class="product-tags">
<template v-if="item.tagInfos?.length">
<a-tag
v-for="tag in item.tagInfos"
:key="tag.id"
size="small"
:style="{
marginRight: '4px',
marginBottom: '4px',
color: tag.textColor || '#333',
backgroundColor: tag.bgColor || '#f0f0f0',
borderColor: tag.borderColor || '#f0f0f0'
}"
>
{{ tag.tagName }}
</a-tag>
</template>
<a-tag v-else size="small" color="default">暂无标签</a-tag>
2026-02-24 09:59:22 +08:00
</div>
2026-02-24 09:59:22 +08:00
<div class="price-row">
<p class="price">¥{{ Number(item.price || 0).toFixed(2) }}</p>
<div class="cart-action">
<span v-if="item.inCart" class="cart-note">购物车已有</span>
<a-button
:type="item.inCart ? 'default' : 'primary'"
size="small"
shape="circle"
class="cart-btn"
:class="{ 'cart-btn-in-cart': item.inCart }"
@click.stop="handleAddToCart(item)"
>
<CheckOutlined v-if="item.inCart" />
<ShoppingCartOutlined v-else />
</a-button>
</div>
2026-02-24 09:59:22 +08:00
</div>
</div>
</a-card>
</div>
2026-02-24 09:59:22 +08:00
<div v-if="products.length === 0 && !loading" class="empty-state">
<a-empty description="暂时没有匹配的作品">
<a-button type="primary" @click="resetFilters">查看全部作品</a-button>
</a-empty>
2026-02-24 09:59:22 +08:00
</div>
<div v-if="loading" class="loading-state">
<a-spin />
2026-02-24 09:59:22 +08:00
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
/**
* ProductListView page script.
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
*/
import { onMounted, ref, watch, inject, computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { CheckOutlined, LeftOutlined, SearchOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
2026-05-23 18:44:57 +08:00
/**
* Purpose: ProductVO supports ProductListView.vue by holding or executing the product vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
2026-02-24 09:59:22 +08:00
import { productApi, type ProductVO } from '@/api/product'
2026-05-23 18:44:57 +08:00
/**
* Purpose: TagVO supports ProductListView.vue by holding or executing the tag vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { tagApi, type TagFilterGroupVO, type TagVO } from '@/api/tag'
import { cartApi } from '@/api/cart'
import { fileApi } from '@/api/file'
import { runWithGlobalLoading } from '@/utils/action-loading'
import { fetchCartProductIdSet, hasCartProduct, withAddedCartProduct } from '@/utils/cart-state'
2026-05-23 18:44:57 +08:00
/**
* Purpose: ProductListItem supports ProductListView.vue by holding or executing the product list item page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
type ProductListItem = ProductVO & {
inCart?: boolean
}
2026-05-23 18:44:57 +08:00
/**
* Purpose: router supports ProductListView.vue by holding or executing the router page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const router = useRouter()
2026-05-23 18:44:57 +08:00
/**
* Purpose: route supports ProductListView.vue by holding or executing the route page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const route = useRoute()
2026-05-23 18:44:57 +08:00
/**
* Purpose: updateCartCount supports ProductListView.vue by holding or executing the update cart count page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
2026-03-19 20:51:07 +08:00
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
2026-03-05 16:28:05 +08:00
/** filterGroups stores scene-based tag filters shown above the product grid. */
const filterGroups = ref<TagFilterGroupVO[]>([])
/** allTags flattens filter groups for route/query lookup. */
const allTags = computed(() => filterGroups.value.flatMap(group => group.tags || []))
/** selectedCategory is a reactive state variable used by the template and event handlers. */
const selectedCategory = ref('全部')
/** selectedTagId tracks the grouped filter id sent to the backend. */
const selectedTagId = ref('')
2026-05-23 18:44:57 +08:00
/**
* Purpose: products supports ProductListView.vue by holding or executing the products page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const products = ref<ProductListItem[]>([])
/** loading is a reactive state variable used by the template and event handlers. */
2026-02-24 09:59:22 +08:00
const loading = ref(false)
/** showSearch is a reactive state variable used by the template and event handlers. */
2026-03-05 16:02:34 +08:00
const showSearch = ref(false)
/** searchKeyword is a reactive state variable used by the template and event handlers. */
2026-03-05 16:02:34 +08:00
const searchKeyword = ref('')
2026-05-23 18:44:57 +08:00
/**
* Purpose: imageIdCache supports ProductListView.vue by holding or executing the image id cache page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const imageIdCache = ref<Record<string, string>>({})
2026-05-23 18:44:57 +08:00
/**
* Purpose: imageUrls supports ProductListView.vue by holding or executing the image urls page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
2026-03-27 14:55:41 +08:00
const imageUrls = ref<Record<string, string[]>>({})
/** cartProductIdSet is a reactive state variable used by the template and event handlers. */
const cartProductIdSet = ref(new Set<string>())
2026-05-23 18:44:57 +08:00
/**
* Purpose: useGlobalLoadingForNextRouteSync supports ProductListView.vue by holding or executing the use global loading for next route sync page or API role.
* Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow.
*/
let useGlobalLoadingForNextRouteSync = false
2026-02-26 11:16:24 +08:00
/** isLoggedIn is a reactive state variable used by the template and event handlers. */
const isLoggedIn = computed(() => Boolean(localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken')))
/** activeBannerText is a reactive state variable used by the template and event handlers. */
const activeBannerText = computed(() => {
if (searchKeyword.value.trim()) {
return `当前显示“${searchKeyword.value.trim()}”的匹配结果`
}
if (selectedCategory.value !== '全部') {
return `当前按场景“${selectedCategory.value}”筛选`
}
return ''
})
2026-05-23 18:44:57 +08:00
/**
* Purpose: DEFAULT_PRODUCT_IMAGE supports ProductListView.vue by holding or executing the default product image page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCBmaWxsPSIjZjVmNWY1IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIvPjx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBmaWxsPSIjYmZiZmJmIiBmb250LXNpemU9IjI0IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+YWFhPC90ZXh0Pjwvc3ZnPg=='
/** ensureLoginForAction is a local helper used by this page script. */
const ensureLoginForAction = (actionText: string) => {
if (isLoggedIn.value) {
return true
}
message.info(`${actionText}前请先登录账号`)
router.push('/')
return false
}
/** loadImageUrls is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const loadImageUrls = async (productList: ProductVO[]) => {
for (const product of productList) {
if (!product.imageFileIds) {
2026-03-27 14:55:41 +08:00
imageUrls.value[String(product.id)] = [DEFAULT_PRODUCT_IMAGE]
continue
}
const ids = product.imageFileIds.split(',').map(id => id.trim()).filter(Boolean)
const urls: string[] = []
for (const id of ids) {
try {
if (!imageIdCache.value[id]) {
2026-03-27 14:55:41 +08:00
imageIdCache.value[id] = await fileApi.getSignedUrl(id) as unknown as string
}
if (imageIdCache.value[id]) {
urls.push(imageIdCache.value[id])
}
} catch (error) {
console.error('获取作品图片失败:', error)
}
}
2026-03-27 14:55:41 +08:00
imageUrls.value[String(product.id)] = urls.length ? urls : [DEFAULT_PRODUCT_IMAGE]
}
}
/** getProductImages is a local helper used by this page script. */
2026-03-27 14:55:41 +08:00
const getProductImages = (product: ProductVO): string[] => imageUrls.value[String(product.id)] || [DEFAULT_PRODUCT_IMAGE]
/** markProductsInCart is a local helper used by this page script. */
const markProductsInCart = (productList: ProductVO[]) => {
return (Array.isArray(productList) ? productList : []).map(item => ({
...item,
inCart: hasCartProduct(cartProductIdSet.value, item.id)
}))
}
/** syncCartProductState is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const syncCartProductState = async () => {
if (!isLoggedIn.value) {
cartProductIdSet.value = new Set()
return
}
cartProductIdSet.value = await fetchCartProductIdSet()
}
/** fetchTags is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
2026-02-24 09:59:22 +08:00
const fetchTags = async () => {
try {
const response = await tagApi.getFilterOptions() as unknown as TagFilterGroupVO[]
filterGroups.value = Array.isArray(response) ? response : []
} catch (error: any) {
2026-02-24 09:59:22 +08:00
console.error('获取标签失败:', error)
filterGroups.value = []
2026-02-24 09:59:22 +08:00
}
}
/** fetchProducts is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
2026-02-24 09:59:22 +08:00
const fetchProducts = async () => {
loading.value = true
try {
let response: ProductVO[] = []
const keyword = searchKeyword.value.trim()
if (keyword) {
response = await productApi.searchProducts(keyword)
} else if (!selectedTagId.value) {
response = await productApi.getAllProducts()
2026-02-24 09:59:22 +08:00
} else {
const pageResult = await productApi.getProductPage({
page: 1,
size: 200,
tagIds: selectedTagId.value
})
response = pageResult.list || []
2026-02-24 09:59:22 +08:00
}
products.value = markProductsInCart(Array.isArray(response) ? response : [])
await loadImageUrls(products.value)
} catch (error: any) {
console.error('获取作品列表失败:', error)
message.error(error?.message || '加载作品列表失败,请稍后重试')
products.value = []
2026-02-24 09:59:22 +08:00
} finally {
loading.value = false
}
2026-02-26 11:16:24 +08:00
}
/** syncRouteFilters is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const syncRouteFilters = async () => {
await syncCartProductState()
const keyword = typeof route.query.keyword === 'string' ? route.query.keyword.trim() : ''
const tag = typeof route.query.tag === 'string' ? route.query.tag.trim() : ''
const tagId = typeof route.query.tagId === 'string' ? route.query.tagId.trim() : ''
const matchedTag = tagId
? allTags.value.find(item => String(item.id) === tagId)
: allTags.value.find(item => item.tagName === tag || item.displayName === tag)
2026-02-26 11:16:24 +08:00
searchKeyword.value = keyword
showSearch.value = Boolean(keyword)
selectedTagId.value = matchedTag ? String(matchedTag.id) : ''
selectedCategory.value = matchedTag ? (matchedTag.displayName || matchedTag.tagName) : '全部'
if (useGlobalLoadingForNextRouteSync) {
useGlobalLoadingForNextRouteSync = false
await runWithGlobalLoading(() => fetchProducts())
return
}
await fetchProducts()
}
2026-02-24 09:59:22 +08:00
/** handleBackClick is a local helper used by this page script. */
const handleBackClick = () => {
router.push('/home')
}
/** handleCategoryClick is a local helper used by this page script. */
const handleCategoryClick = (category: string) => {
selectedCategory.value = category
selectedTagId.value = ''
searchKeyword.value = ''
showSearch.value = false
useGlobalLoadingForNextRouteSync = true
router.replace({ path: '/products', query: {} })
}
/** handleTagClick is a local helper used by grouped scene-filter chips. */
const handleTagClick = (tag: TagVO) => {
selectedCategory.value = tag.displayName || tag.tagName
selectedTagId.value = String(tag.id)
2026-03-05 16:02:34 +08:00
searchKeyword.value = ''
showSearch.value = false
useGlobalLoadingForNextRouteSync = true
router.replace({
path: '/products',
query: { tag: tag.displayName || tag.tagName, tagId: String(tag.id) }
})
}
/** handleProductClick is a local helper used by this page script. */
const handleProductClick = (item: ProductVO) => {
router.push(`/product/${item.id}`)
}
/** handleAddToCart is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const handleAddToCart = async (item: ProductListItem) => {
if (!ensureLoginForAction('加入购物车')) {
return
}
if (hasCartProduct(cartProductIdSet.value, item.id)) {
message.info('购物车已有')
return
}
try {
await runWithGlobalLoading(() => cartApi.addToCart({ productId: item.id, quantity: 1 }))
cartProductIdSet.value = withAddedCartProduct(cartProductIdSet.value, item.id)
products.value = markProductsInCart(products.value)
2026-03-19 20:51:07 +08:00
await updateCartCount()
message.success(`已将 ${item.title || item.name || '作品'} 加入购物车`)
} catch (error: any) {
console.error('加入购物车失败:', error)
message.error(error?.message || '加入购物车失败,请稍后重试')
}
}
/** handleSearch is a local helper used by this page script. */
const handleSearch = () => {
const keyword = searchKeyword.value.trim()
useGlobalLoadingForNextRouteSync = true
router.replace({
path: '/products',
query: keyword ? { keyword } : {}
})
}
2026-02-24 09:59:22 +08:00
/** toggleSearch is a local helper used by this page script. */
2026-03-05 16:02:34 +08:00
const toggleSearch = () => {
showSearch.value = !showSearch.value
if (!showSearch.value) {
searchKeyword.value = ''
useGlobalLoadingForNextRouteSync = true
router.replace({
path: '/products',
query: selectedTagId.value ? { tag: selectedCategory.value, tagId: selectedTagId.value } : {}
})
2026-03-05 16:02:34 +08:00
}
}
/** resetFilters is a local helper used by this page script. */
const resetFilters = () => {
selectedCategory.value = '全部'
selectedTagId.value = ''
searchKeyword.value = ''
showSearch.value = false
useGlobalLoadingForNextRouteSync = true
router.replace('/products')
2026-03-05 16:02:34 +08:00
}
watch(
() => route.query,
async () => {
await syncRouteFilters()
},
{ deep: true }
)
2026-02-24 11:34:25 +08:00
onMounted(async () => {
await fetchTags()
await syncRouteFilters()
2026-02-24 09:59:22 +08:00
})
</script>
<style scoped>
.mobile-container {
padding-top: 58px;
min-height: 100vh;
color: var(--text-primary);
background:
linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.92)),
var(--theme-background-image),
var(--theme-page-bg);
background-size: cover, cover, auto;
background-position: center top;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
height: 58px;
padding: 9px 15px;
border-bottom: 1px solid var(--theme-border);
background: rgba(255, 255, 255, 0.94);
background: color-mix(in srgb, var(--theme-card-bg) 92%, transparent);
box-shadow: 0 10px 28px rgba(122, 67, 88, 0.08);
backdrop-filter: blur(16px);
}
.header h1 {
margin: 0;
font-size: 18px;
font-weight: 700;
color: var(--text-primary);
letter-spacing: 0;
}
.back-btn,
.search-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 999px;
color: var(--theme-primary);
background: var(--theme-primary-soft);
}
.back-btn:hover,
.search-btn:hover,
.back-btn:focus,
.search-btn:focus {
color: var(--theme-accent);
background: var(--theme-primary-soft);
}
2026-03-05 16:02:34 +08:00
.search-input-container {
flex: 1;
margin: 0;
}
.search-input :deep(.ant-input),
.search-input :deep(.ant-input-group-addon .ant-btn) {
height: 38px;
}
.search-input :deep(.ant-input) {
border-color: var(--theme-border);
color: var(--text-primary);
}
.search-input :deep(.ant-input:hover),
.search-input :deep(.ant-input:focus) {
border-color: var(--theme-primary);
box-shadow: var(--theme-focus-shadow);
}
.search-input :deep(.ant-input-group-addon .ant-btn) {
border-color: var(--theme-primary);
background: var(--theme-gradient);
box-shadow: none;
2026-03-05 16:02:34 +08:00
}
.main-content {
display: flex;
flex-direction: column;
min-height: calc(100vh - 58px);
}
.category-sidebar {
position: sticky;
top: 58px;
z-index: 20;
display: flex;
gap: 8px;
width: 100%;
padding: 10px 14px 11px;
overflow-x: auto;
overflow-y: hidden;
background: rgba(255, 255, 255, 0.88);
background: color-mix(in srgb, var(--theme-card-bg) 86%, transparent);
border-bottom: 1px solid var(--theme-border);
box-shadow: 0 8px 22px rgba(122, 67, 88, 0.06);
backdrop-filter: blur(16px);
scrollbar-width: none;
}
.category-sidebar::-webkit-scrollbar {
display: none;
}
.category-item {
flex: 0 0 auto;
padding: 8px 15px;
border-radius: 999px;
font-size: 13px;
font-weight: 600;
color: var(--theme-accent);
text-align: center;
cursor: pointer;
transition: all 0.2s ease;
background: var(--theme-primary-soft);
border: 1px solid var(--theme-border);
}
.filter-group {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
gap: 8px;
}
.filter-group__title {
flex: 0 0 auto;
color: var(--text-secondary);
font-size: 12px;
font-weight: 700;
}
.category-item:hover {
color: var(--theme-primary);
border-color: var(--theme-primary);
transform: translateY(-1px);
}
.category-item.active {
color: #ffffff;
background: var(--theme-gradient);
border-color: transparent;
font-weight: 700;
box-shadow: var(--theme-button-shadow);
}
.product-section {
flex: 1;
padding: 16px;
overflow-y: auto;
}
.page-banner {
margin-bottom: 16px;
border-radius: 14px;
}
.product-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
}
.product-card {
border-radius: 18px;
}
.product-img {
width: 100%;
aspect-ratio: 1;
2026-02-24 09:59:22 +08:00
overflow: hidden;
border-radius: 14px;
background: var(--theme-primary-soft);
2026-02-24 09:59:22 +08:00
}
.product-image {
width: 100%;
height: 100%;
object-fit: cover;
}
.product-img-placeholder {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
font-weight: 700;
color: rgba(0, 0, 0, 0.18);
}
.name {
margin: 12px 0 6px;
font-size: 14px;
font-weight: 700;
color: #1f1f1f;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.back-btn {
opacity: 0;
pointer-events: none;
}
.shop-name {
margin: 0 0 6px;
font-size: 12px;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
2026-02-24 09:59:22 +08:00
.product-meta {
display: flex;
justify-content: space-between;
gap: 8px;
font-size: 12px;
color: #8b8b9a;
2026-02-24 09:59:22 +08:00
}
.duration {
display: inline-flex;
align-items: center;
2026-02-24 09:59:22 +08:00
padding: 2px 8px;
border-radius: 999px;
background: var(--theme-primary-soft);
2026-02-24 09:59:22 +08:00
}
.stats {
display: flex;
gap: 8px;
}
.product-tags {
margin: 10px 0;
min-height: 26px;
2026-02-24 09:59:22 +08:00
}
.price-row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
}
.price {
margin: 0;
font-size: 18px;
font-weight: 700;
color: var(--theme-accent);
}
.cart-action {
display: inline-flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
}
.cart-note {
font-size: 12px;
color: #8c8c8c;
white-space: nowrap;
}
.cart-btn {
flex-shrink: 0;
}
.cart-btn-in-cart {
color: var(--theme-primary);
border-color: var(--theme-border);
background: var(--theme-primary-soft);
}
.empty-state,
.loading-state {
padding: 56px 0;
2026-02-24 09:59:22 +08:00
}
2026-03-24 09:50:55 +08:00
@media (min-width: 992px) {
.main-content {
max-width: var(--frontend-content-max-width);
margin: 0 auto;
width: 100%;
}
.category-sidebar {
width: 100%;
border-radius: 0;
}
.product-section {
padding: 24px;
}
.product-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
2026-03-24 09:50:55 +08:00
}
}
2026-03-19 20:51:07 +08:00
</style>