feat: add product encyclopedia and whole house smart pages

This commit is contained in:
shenghuo2
2025-06-21 10:06:03 +08:00
parent 8af49d63b8
commit 0568cd5b55
5 changed files with 944 additions and 7 deletions

View File

@ -0,0 +1,309 @@
/* 产品百科页面样式 */
#product-encyclopedia-page {
background: #f8f9fa;
min-height: 100vh;
padding-bottom: 20px;
}
/* 页面头部 */
.page-header {
background: white;
padding: 12px 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 100;
}
.header-content {
display: flex;
align-items: center;
padding: 0 16px;
max-width: 414px;
margin: 0 auto;
}
.back-btn {
background: none;
border: none;
font-size: 18px;
color: #333;
padding: 8px;
margin-right: 12px;
cursor: pointer;
border-radius: 50%;
transition: background-color 0.2s;
}
.back-btn:hover {
background-color: #f5f5f5;
}
.page-title {
font-size: 18px;
font-weight: 600;
color: #333;
margin: 0;
flex: 1;
text-align: center;
margin-right: 32px;
}
/* 搜索区域 */
.search-section {
padding: 16px;
background: white;
margin-bottom: 8px;
}
.search-box {
position: relative;
background: #f5f5f5;
border-radius: 20px;
padding: 12px 16px;
display: flex;
align-items: center;
}
.search-box i {
color: #999;
margin-right: 8px;
font-size: 14px;
}
.search-input {
border: none;
background: none;
outline: none;
flex: 1;
font-size: 14px;
color: #333;
}
.search-input::placeholder {
color: #999;
}
/* 分类导航 */
.category-nav {
display: flex;
justify-content: space-around;
background: white;
padding: 16px 8px;
margin-bottom: 8px;
}
.category-item {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
transition: all 0.2s;
padding: 8px;
border-radius: 8px;
}
.category-item:hover {
background-color: #f5f5f5;
}
.category-item.active .category-icon {
background: linear-gradient(135deg, #4ECDC4, #44A08D);
color: white;
}
.category-icon {
width: 40px;
height: 40px;
border-radius: 8px;
background: #f5f5f5;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4px;
transition: all 0.2s;
}
.category-icon i {
font-size: 16px;
color: #666;
}
.category-item.active .category-icon i {
color: white;
}
.category-item span {
font-size: 12px;
color: #666;
text-align: center;
}
.category-item.active span {
color: #4ECDC4;
font-weight: 500;
}
/* 产品区域 */
.section {
background: white;
margin-bottom: 8px;
padding: 16px;
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.section-header h2 {
font-size: 16px;
font-weight: 600;
color: #333;
margin: 0;
}
.section-header i {
color: #999;
font-size: 14px;
}
/* 产品列表 */
.product-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.product-item {
display: flex;
align-items: center;
padding: 12px;
background: #f8f9fa;
border-radius: 12px;
transition: all 0.2s;
cursor: pointer;
}
.product-item:hover {
background: #f0f0f0;
transform: translateY(-1px);
}
.product-image {
width: 60px;
height: 60px;
border-radius: 8px;
overflow: hidden;
margin-right: 12px;
background: white;
display: flex;
align-items: center;
justify-content: center;
}
.product-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.product-info {
flex: 1;
}
.product-info h3 {
font-size: 14px;
font-weight: 500;
color: #333;
margin: 0 0 4px 0;
line-height: 1.4;
}
.product-brand {
font-size: 12px;
color: #999;
margin: 0;
}
/* 响应式设计 */
@media (max-width: 375px) {
.category-nav {
padding: 12px 4px;
}
.category-item {
padding: 4px;
}
.category-icon {
width: 36px;
height: 36px;
}
.category-icon i {
font-size: 14px;
}
.category-item span {
font-size: 11px;
}
}
/* 动画效果 */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.section {
animation: fadeInUp 0.3s ease-out;
}
.product-item {
animation: fadeInUp 0.3s ease-out;
}
.product-item:nth-child(2) {
animation-delay: 0.1s;
}
.product-item:nth-child(3) {
animation-delay: 0.2s;
}
/* 加载状态 */
.loading {
display: flex;
justify-content: center;
align-items: center;
padding: 40px;
color: #999;
}
.loading::after {
content: '';
width: 20px;
height: 20px;
border: 2px solid #f3f3f3;
border-top: 2px solid #4ECDC4;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-left: 8px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}