替换商品为作品

This commit is contained in:
xiaowang
2026-03-05 16:08:27 +08:00
parent 0cae87e957
commit 6cbd3bc076
16 changed files with 98 additions and 98 deletions
+16 -16
View File
@@ -25,7 +25,7 @@
<div class="search-section">
<a-input
v-model:value="searchQuery"
placeholder="搜索商品..."
placeholder="搜索作品..."
size="large"
@input="handleSearch"
>
@@ -61,10 +61,10 @@
</div>
</div>
<!-- 精选商品区域 -->
<!-- 精选作品区域 -->
<section class="section">
<div class="section-header">
<h3>精选商品</h3>
<h3>精选作品</h3>
<a class="see-all" @click="handleSeeAll('featured')">查看全部 <RightOutlined /></a>
</div>
<div class="horizontal-scroll">
@@ -87,10 +87,10 @@
</div>
</section>
<!-- 热门商品区域 -->
<!-- 热门作品区域 -->
<section class="section popular-section">
<div class="section-header">
<h3>热门商品</h3>
<h3>热门作品</h3>
<a class="see-all" @click="handleSeeAll('popular')">查看全部 <RightOutlined /></a>
</div>
<div class="product-grid">
@@ -116,13 +116,13 @@
<a-spin size="small" />
<span style="margin-left: 8px;">加载中...</span>
</div>
<!-- 暂无更多商品 -->
<!-- 暂无更多作品 -->
<div v-else-if="!hasMore && popularItems.length > 0" class="no-more">
暂无更多商品推荐
暂无更多作品推荐
</div>
<!-- 无商品时的提示 -->
<!-- 无作品时的提示 -->
<div v-else-if="popularItems.length === 0 && !loading" class="no-products">
暂无热门商品
暂无热门作品
</div>
</section>
</div>
@@ -162,10 +162,10 @@ const searchQuery = ref('')
// Banner图片数据
const bannerImages = ref<string[]>([])
// 精选商品数据
// 精选作品数据
const featuredItems = ref<any[]>([])
// 热门商品数据
// 热门作品数据
const popularItems = ref<any[]>([])
const loading = ref(false)
const hasMore = ref(true)
@@ -224,7 +224,7 @@ const loadBannerImages = async () => {
}
}
// 加载精选商品
// 加载精选作品
const loadFeaturedProducts = async () => {
try {
const response = await productApi.getProductsByTag('精选') as any
@@ -238,11 +238,11 @@ const loadFeaturedProducts = async () => {
bgColor: getRandomColor()
}))
} catch (error) {
console.error('获取精选商品失败:', error)
console.error('获取精选作品失败:', error)
}
}
// 加载热门商品
// 加载热门作品
const loadPopularProducts = async (loadMore = false) => {
if (loading.value || !hasMore.value) return
@@ -280,7 +280,7 @@ const loadPopularProducts = async (loadMore = false) => {
}
}
} catch (error) {
console.error('获取热门商品失败:', error)
console.error('获取热门作品失败:', error)
} finally {
loading.value = false
}
@@ -344,7 +344,7 @@ const handleSeeAll = (type: string) => {
router.push('/products')
}
// 处理商品卡片点击
// 处理作品卡片点击
const handleProductClick = (item: any) => {
router.push(`/product/${item.id}`)
}