功能:完善多店铺登录与首次部署SQL
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div class="mobile-container">
|
||||
|
||||
<!-- 头部区域 -->
|
||||
<header class="header">
|
||||
<a-button class="back-btn" type="text" @click="handleBackClick">
|
||||
<LeftOutlined :style="{ fontSize: '20px' }" />
|
||||
@@ -12,8 +10,8 @@
|
||||
v-model:value="searchKeyword"
|
||||
placeholder="搜索作品"
|
||||
class="search-input"
|
||||
@search="handleSearch"
|
||||
enter-button
|
||||
@search="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<a-button class="search-btn" type="text" @click="toggleSearch">
|
||||
@@ -21,12 +19,10 @@
|
||||
</a-button>
|
||||
</header>
|
||||
|
||||
<!-- 主内容区域 -->
|
||||
<div class="main-content">
|
||||
<!-- 左侧分类边栏 -->
|
||||
<div class="category-sidebar">
|
||||
<div
|
||||
v-for="category in categories"
|
||||
<div
|
||||
v-for="category in categories"
|
||||
:key="category"
|
||||
class="category-item"
|
||||
:class="{ active: selectedCategory === category }"
|
||||
@@ -36,9 +32,15 @@
|
||||
</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"
|
||||
@@ -48,85 +50,53 @@
|
||||
hoverable
|
||||
@click="handleProductClick(item)"
|
||||
>
|
||||
<!-- 作品图片 -->
|
||||
<div class="product-img">
|
||||
<img
|
||||
v-if="getProductImages(item) && getProductImages(item).length > 0"
|
||||
:src="getProductImages(item)[0]"
|
||||
<img
|
||||
v-if="getProductImages(item).length > 0"
|
||||
:src="getProductImages(item)[0]"
|
||||
:alt="item.title || item.name"
|
||||
class="product-image"
|
||||
/>
|
||||
<div v-else class="product-img-placeholder">
|
||||
<span>{{ (item.title || item.name) ? (item.title || item.name)[0] : '商' }}</span>
|
||||
<span>{{ (item.title || item.name)?.[0] || '作' }}</span>
|
||||
</div>
|
||||
<a-badge
|
||||
v-if="item.category"
|
||||
:text="item.category"
|
||||
color="#ff4d4f"
|
||||
class="product-tag"
|
||||
/>
|
||||
</div>
|
||||
<!-- 作品信息 -->
|
||||
|
||||
<div class="product-info">
|
||||
<p class="name">{{ item.title || item.name }}</p>
|
||||
<div class="product-meta">
|
||||
<span class="duration">{{ item.approximateDuration || '0分钟' }}</span>
|
||||
<span class="duration">{{ item.approximateDuration || '时长待定' }}</span>
|
||||
<div class="stats">
|
||||
<span class="like-count">{{ item.likeCount || 0 }} 赞</span>
|
||||
<span class="collect-count">{{ item.collectCount || 0 }} 收藏</span>
|
||||
<span>{{ item.likeCount || 0 }} 点赞</span>
|
||||
<span>{{ item.collectCount || 0 }} 收藏</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 标签展示 -->
|
||||
|
||||
<div class="product-tags">
|
||||
<template v-if="item.tagInfos && item.tagInfos.length > 0">
|
||||
<a-tag
|
||||
<template v-if="item.tagInfos?.length">
|
||||
<a-tag
|
||||
v-for="tag in item.tagInfos"
|
||||
:key="tag.id"
|
||||
size="small"
|
||||
:style="{
|
||||
marginRight: '4px',
|
||||
marginRight: '4px',
|
||||
marginBottom: '4px',
|
||||
fontSize: '9px',
|
||||
padding: '1px 6px',
|
||||
color: tag.textColor || '#333333',
|
||||
backgroundColor: tag.bgColor || '#F0F0F0',
|
||||
borderColor: tag.borderColor || '#F0F0F0',
|
||||
borderWidth: '1px',
|
||||
borderStyle: 'solid',
|
||||
borderRadius: '8px'
|
||||
color: tag.textColor || '#333',
|
||||
backgroundColor: tag.bgColor || '#f0f0f0',
|
||||
borderColor: tag.borderColor || '#f0f0f0'
|
||||
}"
|
||||
>
|
||||
{{ tag.tagName }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-else-if="item.category">
|
||||
<a-tag
|
||||
size="small"
|
||||
:style="{
|
||||
marginRight: '4px',
|
||||
marginBottom: '4px',
|
||||
fontSize: '9px',
|
||||
padding: '1px 6px',
|
||||
color: '#333333',
|
||||
backgroundColor: '#F0F0F0',
|
||||
borderColor: '#F0F0F0',
|
||||
borderWidth: '1px',
|
||||
borderStyle: 'solid',
|
||||
borderRadius: '8px'
|
||||
}"
|
||||
>
|
||||
{{ item.category }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<a-tag v-else size="small" color="gray" style="font-size: 10px; padding: 2px 6px">
|
||||
无标签
|
||||
</a-tag>
|
||||
<a-tag v-else size="small" color="default">暂无标签</a-tag>
|
||||
</div>
|
||||
|
||||
<div class="price-row">
|
||||
<p class="price">¥{{ item.price }}</p>
|
||||
<a-button
|
||||
type="primary"
|
||||
size="small"
|
||||
<p class="price">¥{{ Number(item.price || 0).toFixed(2) }}</p>
|
||||
<a-button
|
||||
type="primary"
|
||||
size="small"
|
||||
shape="circle"
|
||||
@click.stop="handleAddToCart(item)"
|
||||
>
|
||||
@@ -137,17 +107,14 @@
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<div v-if="products.length === 0 && !loading" class="empty-state">
|
||||
<a-typography-text type="secondary">商家暂未上架更多作品</a-typography-text>
|
||||
<a-empty description="暂时没有匹配的作品">
|
||||
<a-button type="primary" @click="resetFilters">查看全部作品</a-button>
|
||||
</a-empty>
|
||||
</div>
|
||||
|
||||
<!-- 加载更多 -->
|
||||
<div v-else-if="products.length > 0" class="load-more">
|
||||
<a-button v-if="hasMore" type="link" @click="handleLoadMore">
|
||||
加载更多 <DownOutlined />
|
||||
</a-button>
|
||||
<a-typography-text v-else type="secondary">没有更多作品了</a-typography-text>
|
||||
<div v-if="loading" class="loading-state">
|
||||
<a-spin />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,198 +122,192 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, inject } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
LeftOutlined,
|
||||
SearchOutlined,
|
||||
ShoppingCartOutlined,
|
||||
DownOutlined
|
||||
} from '@ant-design/icons-vue'
|
||||
import { onMounted, ref, watch, inject, computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { LeftOutlined, SearchOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { productApi, type ProductVO } from '@/api/product'
|
||||
import { tagApi, type TagVO } from '@/api/tag'
|
||||
import { cartApi } from '@/api/cart'
|
||||
import { fileApi } from '@/api/file'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
// 标签列表
|
||||
const allTags = ref<TagVO[]>([])
|
||||
|
||||
// 当前选中的分类
|
||||
const selectedCategory = ref('全部')
|
||||
|
||||
// 分类列表(动态从标签获取)
|
||||
const categories = ref<string[]>(['全部'])
|
||||
|
||||
// 作品数据
|
||||
const selectedCategory = ref('全部')
|
||||
const products = ref<ProductVO[]>([])
|
||||
|
||||
// 是否还有更多数据
|
||||
const hasMore = ref(true)
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(false)
|
||||
|
||||
// 搜索相关状态
|
||||
const showSearch = ref(false)
|
||||
const searchKeyword = ref('')
|
||||
const isSearching = ref(false)
|
||||
|
||||
// 图片ID缓存
|
||||
const imageIdCache = ref<Record<string, string>>({})
|
||||
const imageUrls = ref<Record<number, string[]>>({})
|
||||
const DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aW0dPSJodHRwOi8vd3d3Lm9yZy8yMDAwL3N2ZyI+Pjwvc3ZnPg=='
|
||||
|
||||
// 从后端获取标签列表
|
||||
const isLoggedIn = computed(() => Boolean(localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken')))
|
||||
const activeBannerText = computed(() => {
|
||||
if (searchKeyword.value.trim()) {
|
||||
return `当前显示“${searchKeyword.value.trim()}”的搜索结果`
|
||||
}
|
||||
if (selectedCategory.value !== '全部') {
|
||||
return `当前按标签“${selectedCategory.value}”筛选`
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
const DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCBmaWxsPSIjZjVmNWY1IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIvPjx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBmaWxsPSIjYmZiZmJmIiBmb250LXNpemU9IjI0IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+YWFhPC90ZXh0Pjwvc3ZnPg=='
|
||||
|
||||
const ensureLoginForAction = (actionText: string) => {
|
||||
if (isLoggedIn.value) {
|
||||
return true
|
||||
}
|
||||
message.info(`${actionText}前请先登录账号`)
|
||||
router.push('/')
|
||||
return false
|
||||
}
|
||||
|
||||
const loadImageUrls = async (productList: ProductVO[]) => {
|
||||
for (const product of productList) {
|
||||
if (!product.imageFileIds) {
|
||||
imageUrls.value[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]) {
|
||||
imageIdCache.value[id] = await fileApi.getSignedUrl(Number(id)) as unknown as string
|
||||
}
|
||||
if (imageIdCache.value[id]) {
|
||||
urls.push(imageIdCache.value[id])
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取作品图片失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
imageUrls.value[product.id] = urls.length ? urls : [DEFAULT_PRODUCT_IMAGE]
|
||||
}
|
||||
}
|
||||
|
||||
const getProductImages = (product: ProductVO): string[] => imageUrls.value[product.id] || [DEFAULT_PRODUCT_IMAGE]
|
||||
|
||||
const fetchTags = async () => {
|
||||
try {
|
||||
const response = await tagApi.getAllTags() as any
|
||||
allTags.value = response || []
|
||||
const response = await tagApi.getAllTags() as unknown as TagVO[]
|
||||
allTags.value = Array.isArray(response) ? response : []
|
||||
categories.value = ['全部', ...allTags.value.map(tag => tag.tagName)]
|
||||
} catch (error) {
|
||||
console.error('获取标签失败:', error)
|
||||
categories.value = ['全部']
|
||||
}
|
||||
}
|
||||
|
||||
// 加载作品列表
|
||||
const loadImageUrls = async (productList: ProductVO[]) => {
|
||||
for (const product of productList) {
|
||||
if (product.imageFileIds) {
|
||||
const ids = product.imageFileIds.split(',')
|
||||
const urls: string[] = []
|
||||
|
||||
for (const id of ids) {
|
||||
if (id) {
|
||||
try {
|
||||
if (!imageIdCache.value[id]) {
|
||||
const response = await fileApi.getSignedUrl(Number(id)) as any
|
||||
imageIdCache.value[id] = response
|
||||
}
|
||||
if (imageIdCache.value[id]) {
|
||||
urls.push(imageIdCache.value[id] as string)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取签名链接失败:', error)
|
||||
urls.push(DEFAULT_PRODUCT_IMAGE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
imageUrls.value[product.id] = urls
|
||||
} else {
|
||||
imageUrls.value[product.id] = [DEFAULT_PRODUCT_IMAGE]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getProductImages = (product: ProductVO): string[] => {
|
||||
return imageUrls.value[product.id] || [DEFAULT_PRODUCT_IMAGE]
|
||||
}
|
||||
|
||||
// 从后端获取作品数据
|
||||
const fetchProducts = async () => {
|
||||
if (loading.value) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
let response: any
|
||||
|
||||
if (selectedCategory.value === '全部') {
|
||||
response = await productApi.getAllProducts() as any
|
||||
let response: ProductVO[] = []
|
||||
const keyword = searchKeyword.value.trim()
|
||||
|
||||
if (keyword) {
|
||||
response = await productApi.searchProducts(keyword)
|
||||
} else if (selectedCategory.value === '全部') {
|
||||
response = await productApi.getAllProducts()
|
||||
} else {
|
||||
response = await productApi.getProductsByTag(selectedCategory.value) as any
|
||||
response = await productApi.getProductsByTag(selectedCategory.value)
|
||||
}
|
||||
|
||||
products.value = response || []
|
||||
|
||||
|
||||
products.value = Array.isArray(response) ? response : []
|
||||
await loadImageUrls(products.value)
|
||||
|
||||
hasMore.value = false
|
||||
} catch (error) {
|
||||
message.error('未登录,请先登录')
|
||||
console.error('获取作品列表失败:', error)
|
||||
message.error('加载作品列表失败,请稍后重试')
|
||||
products.value = []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const syncRouteFilters = async () => {
|
||||
const keyword = typeof route.query.keyword === 'string' ? route.query.keyword.trim() : ''
|
||||
const tag = typeof route.query.tag === 'string' ? route.query.tag.trim() : ''
|
||||
|
||||
searchKeyword.value = keyword
|
||||
showSearch.value = Boolean(keyword)
|
||||
selectedCategory.value = tag && categories.value.includes(tag) ? tag : '全部'
|
||||
await fetchProducts()
|
||||
}
|
||||
|
||||
// 处理返回按钮点击
|
||||
const handleBackClick = () => {
|
||||
router.push('/')
|
||||
router.push('/home')
|
||||
}
|
||||
|
||||
// 处理分类点击
|
||||
const handleCategoryClick = (category: string) => {
|
||||
selectedCategory.value = category
|
||||
showSearch.value = false
|
||||
searchKeyword.value = ''
|
||||
isSearching.value = false
|
||||
fetchProducts()
|
||||
showSearch.value = false
|
||||
router.replace({
|
||||
path: '/products',
|
||||
query: category === '全部' ? {} : { tag: category }
|
||||
})
|
||||
}
|
||||
|
||||
// 处理作品卡片点击
|
||||
const handleProductClick = (item: any) => {
|
||||
const handleProductClick = (item: ProductVO) => {
|
||||
router.push(`/product/${item.id}`)
|
||||
}
|
||||
|
||||
// 处理添加到购物车
|
||||
const handleAddToCart = async (item: any) => {
|
||||
const handleAddToCart = async (item: ProductVO) => {
|
||||
if (!ensureLoginForAction('加入购物车')) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await cartApi.addToCart({ productId: item.id, quantity: 1 })
|
||||
await updateCartCount()
|
||||
message.success(`已将 ${item.title || item.name || '作品'} 添加到购物车`)
|
||||
message.success(`已将 ${item.title || item.name || '作品'} 加入购物车`)
|
||||
} catch (error) {
|
||||
message.error('添加到购物车失败,请重试')
|
||||
console.error('加入购物车失败:', error)
|
||||
message.error('加入购物车失败,请稍后重试')
|
||||
}
|
||||
}
|
||||
|
||||
// 处理加载更多
|
||||
const handleLoadMore = () => {
|
||||
// 这里可以添加加载更多逻辑
|
||||
hasMore.value = false
|
||||
const handleSearch = () => {
|
||||
const keyword = searchKeyword.value.trim()
|
||||
router.replace({
|
||||
path: '/products',
|
||||
query: keyword ? { keyword } : {}
|
||||
})
|
||||
}
|
||||
|
||||
// 切换搜索框显示/隐藏
|
||||
const toggleSearch = () => {
|
||||
showSearch.value = !showSearch.value
|
||||
if (!showSearch.value) {
|
||||
searchKeyword.value = ''
|
||||
isSearching.value = false
|
||||
fetchProducts() // 重置为默认作品列表
|
||||
router.replace({ path: '/products', query: selectedCategory.value === '全部' ? {} : { tag: selectedCategory.value } })
|
||||
}
|
||||
}
|
||||
|
||||
// 处理搜索操作
|
||||
const handleSearch = async () => {
|
||||
if (!searchKeyword.value.trim()) {
|
||||
message.info('请输入搜索关键词')
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const response = await productApi.searchProducts(searchKeyword.value.trim()) as any
|
||||
products.value = response || []
|
||||
await loadImageUrls(products.value)
|
||||
hasMore.value = false
|
||||
isSearching.value = true
|
||||
} catch (error) {
|
||||
message.error('搜索失败,请重试')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
const resetFilters = () => {
|
||||
selectedCategory.value = '全部'
|
||||
searchKeyword.value = ''
|
||||
showSearch.value = false
|
||||
router.replace('/products')
|
||||
}
|
||||
|
||||
// 页面挂载时获取标签和作品数据
|
||||
watch(
|
||||
() => route.query,
|
||||
async () => {
|
||||
await syncRouteFilters()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchTags()
|
||||
fetchProducts()
|
||||
await syncRouteFilters()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -373,9 +334,9 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.back-btn,
|
||||
@@ -392,23 +353,16 @@ onMounted(async () => {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 主内容区域 */
|
||||
.main-content {
|
||||
display: flex;
|
||||
height: calc(100vh - 60px);
|
||||
overflow: hidden;
|
||||
min-height: calc(100vh - 60px);
|
||||
}
|
||||
|
||||
/* 左侧分类边栏 */
|
||||
.category-sidebar {
|
||||
width: 90px;
|
||||
background: #f8f8f8;
|
||||
width: 92px;
|
||||
background: #fafafa;
|
||||
border-right: 1px solid #ececec;
|
||||
overflow-y: auto;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
@@ -417,60 +371,44 @@ onMounted(async () => {
|
||||
color: #666;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
transition: all 0.2s ease;
|
||||
border-left: 3px solid transparent;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.category-item:hover {
|
||||
background: #e8e8e8;
|
||||
color: #1890ff;
|
||||
}
|
||||
|
||||
.category-item.active {
|
||||
color: #1677ff;
|
||||
background: white;
|
||||
color: #1890ff;
|
||||
border-left-color: #1890ff;
|
||||
font-weight: 600;
|
||||
border-left-color: #1677ff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* 右侧作品区域 */
|
||||
.product-section {
|
||||
flex: 1;
|
||||
padding: 16px;
|
||||
overflow-y: auto;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.page-banner {
|
||||
margin-bottom: 16px;
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
padding: 0 20px;
|
||||
gap: 15px;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.product-card {
|
||||
cursor: pointer;
|
||||
transition: transform 0.3s, box-shadow 0.3s;
|
||||
}
|
||||
|
||||
.product-card:hover {
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
|
||||
.product-card :deep(.ant-card-body) {
|
||||
padding: 12px;
|
||||
border-radius: 18px;
|
||||
}
|
||||
|
||||
.product-img {
|
||||
width: 100%;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 12px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
background: #f8f8f8;
|
||||
border-radius: 14px;
|
||||
background: #eef3ff;
|
||||
}
|
||||
|
||||
.product-image {
|
||||
@@ -483,48 +421,37 @@ onMounted(async () => {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.product-tag {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 8px;
|
||||
font-size: 11px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.product-info {
|
||||
padding: 0;
|
||||
font-weight: 700;
|
||||
color: rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.name {
|
||||
margin: 12px 0 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin: 0 0 4px 0;
|
||||
font-weight: 700;
|
||||
color: #1f1f1f;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.product-meta {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 6px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 12px;
|
||||
color: #8b8b9a;
|
||||
}
|
||||
|
||||
.duration {
|
||||
background: #f0f0f0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
border-radius: 999px;
|
||||
background: #f4f6fb;
|
||||
}
|
||||
|
||||
.stats {
|
||||
@@ -532,10 +459,9 @@ onMounted(async () => {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.like-count,
|
||||
.collect-count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.product-tags {
|
||||
margin: 10px 0;
|
||||
min-height: 26px;
|
||||
}
|
||||
|
||||
.price-row {
|
||||
@@ -545,51 +471,33 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #ff4d4f;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
.product-tags {
|
||||
margin: 8px 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.load-more {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 60px 20px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
.empty-state,
|
||||
.loading-state {
|
||||
padding: 56px 0;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.main-content {
|
||||
min-height: calc(100vh - 60px);
|
||||
height: auto;
|
||||
max-width: var(--frontend-content-max-width);
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.category-sidebar {
|
||||
width: 128px;
|
||||
border-radius: 20px 0 0 20px;
|
||||
}
|
||||
|
||||
.product-section {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.product-grid {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user