2026-02-13 17:34:32 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="mobile-container">
|
|
|
|
|
|
|
|
|
|
<!-- 头部区域 -->
|
|
|
|
|
<header class="header">
|
|
|
|
|
<!-- 用户信息区域 -->
|
|
|
|
|
<div class="user-info" @click="handleUserClick">
|
|
|
|
|
<div class="avatar">
|
2026-03-02 10:13:20 +08:00
|
|
|
<a-avatar :size="40" :src="userInfo?.avatar || 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'" />
|
2026-02-13 17:34:32 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="welcome">
|
|
|
|
|
<p class="greeting">Hello!</p>
|
2026-03-02 10:13:20 +08:00
|
|
|
<p class="username">{{ userInfo?.nickname || '用户' }}</p>
|
2026-02-13 17:34:32 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 通知按钮 -->
|
|
|
|
|
<div class="actions">
|
|
|
|
|
<a-badge :count="3" :offset="[-5, 5]">
|
|
|
|
|
<BellOutlined class="notification-icon" @click="handleNotificationClick" />
|
|
|
|
|
</a-badge>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<!-- 搜索区域 -->
|
|
|
|
|
<div class="search-section">
|
|
|
|
|
<a-input
|
|
|
|
|
v-model:value="searchQuery"
|
|
|
|
|
placeholder="搜索商品..."
|
|
|
|
|
size="large"
|
|
|
|
|
@input="handleSearch"
|
|
|
|
|
>
|
|
|
|
|
<template #prefix>
|
|
|
|
|
<SearchOutlined style="color: #999" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-input>
|
|
|
|
|
<a-button class="filter-btn" type="primary" shape="circle" @click="handleFilterClick">
|
|
|
|
|
<FilterOutlined />
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Banner 区域 -->
|
|
|
|
|
<div class="banner" @click="handleBannerClick">
|
|
|
|
|
<div class="banner-content">
|
|
|
|
|
<a-tag color="red" class="banner-tag">限时优惠</a-tag>
|
|
|
|
|
<h3>Get Winter Discount</h3>
|
|
|
|
|
<h2>20% Off</h2>
|
|
|
|
|
<p>For Children</p>
|
|
|
|
|
<a-button type="primary" size="small" class="banner-btn">立即购买</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="banner-image">
|
|
|
|
|
<div class="img-placeholder">Banner</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 精选商品区域 -->
|
|
|
|
|
<section class="section">
|
|
|
|
|
<div class="section-header">
|
|
|
|
|
<h3>精选商品</h3>
|
|
|
|
|
<a class="see-all" @click="handleSeeAll('featured')">查看全部 <RightOutlined /></a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="horizontal-scroll">
|
|
|
|
|
<a-card
|
|
|
|
|
v-for="item in featuredItems"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
class="product-card"
|
|
|
|
|
:body-style="{ padding: '12px' }"
|
|
|
|
|
hoverable
|
|
|
|
|
@click="handleProductClick(item)"
|
|
|
|
|
>
|
|
|
|
|
<div class="product-img" :style="{ backgroundColor: item.bgColor }">
|
|
|
|
|
<span>{{ item.name[0] }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="product-info">
|
|
|
|
|
<p class="name">{{ item.name }}</p>
|
|
|
|
|
<p class="price">${{ item.price }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<!-- 热门商品区域 -->
|
|
|
|
|
<section class="section popular-section">
|
|
|
|
|
<div class="section-header">
|
|
|
|
|
<h3>热门商品</h3>
|
|
|
|
|
<a class="see-all" @click="handleSeeAll('popular')">查看全部 <RightOutlined /></a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="product-grid">
|
|
|
|
|
<a-card
|
|
|
|
|
v-for="item in popularItems"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
class="product-card grid-item"
|
|
|
|
|
:body-style="{ padding: '12px' }"
|
|
|
|
|
hoverable
|
|
|
|
|
@click="handleProductClick(item)"
|
|
|
|
|
>
|
|
|
|
|
<div class="product-img" :style="{ backgroundColor: item.bgColor }">
|
|
|
|
|
<span>{{ item.name[0] }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="product-info">
|
|
|
|
|
<p class="name">{{ item.name }}</p>
|
|
|
|
|
<p class="price">${{ item.price }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
2026-02-28 14:32:28 +08:00
|
|
|
<!-- 加载状态 -->
|
|
|
|
|
<div v-if="loading" class="loading-more">
|
|
|
|
|
<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>
|
2026-02-13 17:34:32 +08:00
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-02-28 14:32:28 +08:00
|
|
|
import { ref, onMounted, onUnmounted } from 'vue'
|
2026-02-13 17:34:32 +08:00
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import {
|
|
|
|
|
BellOutlined,
|
|
|
|
|
SearchOutlined,
|
2026-02-24 10:57:00 +08:00
|
|
|
FilterOutlined,
|
2026-02-13 17:34:32 +08:00
|
|
|
RightOutlined
|
|
|
|
|
} from '@ant-design/icons-vue'
|
2026-02-28 14:32:28 +08:00
|
|
|
import { userApi, type UserVO } from '../api/user'
|
|
|
|
|
import { productApi } from '../api/product'
|
2026-02-13 17:34:32 +08:00
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
2026-02-28 14:32:28 +08:00
|
|
|
// 用户信息
|
|
|
|
|
const userInfo = ref<UserVO>({
|
|
|
|
|
id: 0,
|
|
|
|
|
nickname: '',
|
|
|
|
|
account: '',
|
|
|
|
|
avatar: '',
|
2026-03-02 10:13:20 +08:00
|
|
|
type: 0,
|
|
|
|
|
status: 0,
|
2026-02-28 14:32:28 +08:00
|
|
|
createTime: '',
|
|
|
|
|
updateTime: ''
|
|
|
|
|
})
|
|
|
|
|
|
2026-02-13 17:34:32 +08:00
|
|
|
// 搜索关键词
|
|
|
|
|
const searchQuery = ref('')
|
|
|
|
|
|
|
|
|
|
// 精选商品数据
|
2026-02-28 14:32:28 +08:00
|
|
|
const featuredItems = ref<any[]>([])
|
2026-02-13 17:34:32 +08:00
|
|
|
|
|
|
|
|
// 热门商品数据
|
2026-02-28 14:32:28 +08:00
|
|
|
const popularItems = ref<any[]>([])
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const hasMore = ref(true)
|
|
|
|
|
const page = ref(1)
|
|
|
|
|
const pageSize = ref(10)
|
|
|
|
|
|
|
|
|
|
// 加载用户信息
|
|
|
|
|
const loadUserInfo = async () => {
|
|
|
|
|
try {
|
2026-03-02 10:13:20 +08:00
|
|
|
const response = await userApi.getUserInfo() as any
|
|
|
|
|
userInfo.value = response || {}
|
2026-02-28 14:32:28 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取用户信息失败:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 加载精选商品
|
|
|
|
|
const loadFeaturedProducts = async () => {
|
|
|
|
|
try {
|
2026-03-02 10:13:20 +08:00
|
|
|
const response = await productApi.getProductsByTag('精选') as any
|
|
|
|
|
const data = response || []
|
|
|
|
|
const productList = Array.isArray(data) ? data : []
|
|
|
|
|
const shuffled = productList.sort(() => 0.5 - Math.random())
|
|
|
|
|
featuredItems.value = shuffled.slice(0, 5).map((item: any) => ({
|
2026-02-28 14:32:28 +08:00
|
|
|
id: item.id,
|
|
|
|
|
name: item.name,
|
|
|
|
|
price: item.price,
|
|
|
|
|
bgColor: getRandomColor()
|
|
|
|
|
}))
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取精选商品失败:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 加载热门商品
|
|
|
|
|
const loadPopularProducts = async (loadMore = false) => {
|
|
|
|
|
if (loading.value || !hasMore.value) return
|
|
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
2026-03-02 10:13:20 +08:00
|
|
|
const response = await productApi.getProductsByTag('热门') as any
|
|
|
|
|
const data = response || []
|
|
|
|
|
const productList = Array.isArray(data) ? data : []
|
2026-02-28 14:32:28 +08:00
|
|
|
|
|
|
|
|
if (loadMore) {
|
|
|
|
|
const start = (page.value - 1) * pageSize.value
|
|
|
|
|
const end = start + pageSize.value
|
2026-03-02 10:13:20 +08:00
|
|
|
const newItems = productList.slice(start, end)
|
2026-02-28 14:32:28 +08:00
|
|
|
|
|
|
|
|
if (newItems.length < pageSize.value) {
|
|
|
|
|
hasMore.value = false
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 10:13:20 +08:00
|
|
|
popularItems.value = [...popularItems.value, ...newItems.map((item: any) => ({
|
2026-02-28 14:32:28 +08:00
|
|
|
id: item.id,
|
|
|
|
|
name: item.name,
|
|
|
|
|
price: item.price,
|
|
|
|
|
bgColor: getRandomColor()
|
|
|
|
|
}))]
|
|
|
|
|
} else {
|
2026-03-02 10:13:20 +08:00
|
|
|
popularItems.value = productList.slice(0, pageSize.value).map((item: any) => ({
|
2026-02-28 14:32:28 +08:00
|
|
|
id: item.id,
|
|
|
|
|
name: item.name,
|
|
|
|
|
price: item.price,
|
|
|
|
|
bgColor: getRandomColor()
|
|
|
|
|
}))
|
|
|
|
|
|
2026-03-02 10:13:20 +08:00
|
|
|
if (productList.length <= pageSize.value) {
|
2026-02-28 14:32:28 +08:00
|
|
|
hasMore.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取热门商品失败:', error)
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理滚动事件,实现懒加载
|
|
|
|
|
const handleScroll = () => {
|
|
|
|
|
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop
|
|
|
|
|
const scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight
|
|
|
|
|
const clientHeight = document.documentElement.clientHeight
|
|
|
|
|
|
|
|
|
|
if (scrollTop + clientHeight >= scrollHeight - 100 && !loading.value && hasMore.value) {
|
|
|
|
|
page.value++
|
|
|
|
|
loadPopularProducts(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 添加滚动监听
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
loadUserInfo()
|
|
|
|
|
loadFeaturedProducts()
|
|
|
|
|
loadPopularProducts()
|
|
|
|
|
window.addEventListener('scroll', handleScroll)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 移除滚动监听
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
window.removeEventListener('scroll', handleScroll)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 生成随机颜色
|
|
|
|
|
const getRandomColor = () => {
|
|
|
|
|
const colors = ['#ffe4d6', '#d6eaff', '#e2ffd6', '#fff2d6', '#d6ffe4', '#e4d6ff']
|
|
|
|
|
return colors[Math.floor(Math.random() * colors.length)]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 页面加载时获取数据
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
loadUserInfo()
|
|
|
|
|
loadFeaturedProducts()
|
|
|
|
|
loadPopularProducts()
|
|
|
|
|
})
|
2026-02-13 17:34:32 +08:00
|
|
|
|
|
|
|
|
// 处理用户头像点击
|
|
|
|
|
const handleUserClick = () => {
|
|
|
|
|
console.log('用户头像被点击')
|
|
|
|
|
router.push('/profile')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理通知图标点击
|
|
|
|
|
const handleNotificationClick = () => {
|
|
|
|
|
console.log('通知图标被点击')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理搜索输入
|
2026-03-02 10:13:20 +08:00
|
|
|
const handleSearch = (e: any) => {
|
|
|
|
|
console.log('搜索内容改变:', e.target.value)
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理筛选按钮点击
|
|
|
|
|
const handleFilterClick = () => {
|
|
|
|
|
console.log('筛选按钮被点击')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理 Banner 点击
|
|
|
|
|
const handleBannerClick = () => {
|
|
|
|
|
console.log('Banner被点击')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理查看全部点击
|
|
|
|
|
const handleSeeAll = (type: string) => {
|
|
|
|
|
console.log(`查看全部: ${type}`)
|
|
|
|
|
router.push('/products')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 处理商品卡片点击
|
|
|
|
|
const handleProductClick = (item: any) => {
|
|
|
|
|
console.log('商品被点击:', item.name)
|
|
|
|
|
router.push(`/product/${item.id}`)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 15px 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: transform 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-info:hover {
|
|
|
|
|
transform: scale(1.02);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.greeting {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #999;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.username {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.notification-icon {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
color: #333;
|
|
|
|
|
transition: color 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.notification-icon:hover {
|
|
|
|
|
color: #1890ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-section {
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 10px 20px;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-section :deep(.ant-input) {
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
height: 44px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn {
|
|
|
|
|
width: 44px;
|
|
|
|
|
height: 44px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner {
|
|
|
|
|
margin: 15px 20px;
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
height: 160px;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
color: white;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
position: relative;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: transform 0.3s, box-shadow 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner:hover {
|
|
|
|
|
transform: translateY(-4px);
|
|
|
|
|
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner-tag {
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
border: none;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner-content h3 {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
margin: 0 0 4px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner-content h2 {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
margin: 4px 0;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner-content p {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
margin: 4px 0 12px 0;
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner-btn {
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.banner-image {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.img-placeholder {
|
|
|
|
|
width: 100px;
|
|
|
|
|
height: 100px;
|
|
|
|
|
background: rgba(255,255,255,0.2);
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
backdrop-filter: blur(10px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section {
|
|
|
|
|
padding: 15px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 0 20px 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section-header h3 {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.see-all {
|
|
|
|
|
color: #1890ff;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
transition: color 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.see-all:hover {
|
|
|
|
|
color: #40a9ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.horizontal-scroll {
|
|
|
|
|
display: flex;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.horizontal-scroll::-webkit-scrollbar {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.product-card {
|
|
|
|
|
width: 140px;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: transform 0.3s, box-shadow 0.3s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.product-card:hover {
|
|
|
|
|
transform: translateY(-4px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.product-card :deep(.ant-card-body) {
|
|
|
|
|
padding: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.product-img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
aspect-ratio: 1;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 40px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: rgba(0,0,0,0.1);
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.product-info {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.name {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
margin: 0 0 4px 0;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.price {
|
|
|
|
|
color: #ff4d4f;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.product-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.grid-item {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.popular-section {
|
|
|
|
|
padding-bottom: 20px;
|
|
|
|
|
}
|
2026-02-28 14:32:28 +08:00
|
|
|
|
|
|
|
|
.loading-more {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
color: #999;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.no-more {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
color: #999;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.no-products {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 40px 0;
|
|
|
|
|
color: #999;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
2026-02-24 10:57:00 +08:00
|
|
|
</style>
|