.container { width: 100%; padding: 20rpx; box-sizing: border-box; background-color: #f5f5f5; min-height: 100vh; } .page-title { font-size: 36rpx; font-weight: bold; color: #333; text-align: center; margin: 20rpx 0 30rpx; } /* 搜索框样式 */ .search-container { margin-bottom: 20rpx; } .search-box { position: relative; display: flex; align-items: center; background-color: white; border-radius: 40rpx; padding: 0 20rpx; box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); } /* 筛选样式 */ .filter-container { margin: 0 auto 24rpx; padding: 0 30rpx; box-sizing: border-box; width: 100%; } .filter-buttons { display: flex; background-color: white; border-radius: 50rpx; overflow: hidden; box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1); border: 2rpx solid transparent; transition: all 0.3s ease; } .filter-btn { flex: 1; text-align: center; padding: 18rpx 0; font-size: 28rpx; color: #666; background-color: transparent; border: none; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; font-weight: 500; } .filter-btn.active { color: #1677ff; font-weight: bold; background: linear-gradient(135deg, #e6f0ff 0%, #f0f7ff 100%); box-shadow: inset 0 2rpx 8rpx rgba(22, 119, 255, 0.15); } .filter-btn::after { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 2rpx; height: 48rpx; background: linear-gradient(180deg, transparent 0%, #e8e8e8 50%, transparent 100%); } .filter-btn:last-child::after { display: none; } .filter-btn:active { opacity: 0.8; transform: scale(0.98); } /* 第一个和最后一个按钮特殊样式 */ .filter-btn:first-child { border-radius: 50rpx 0 0 50rpx; } .filter-btn:last-child { border-radius: 0 50rpx 50rpx 0; } /* 激活状态下的按钮动画效果 */ .filter-btn.active::before { content: ''; position: absolute; top: 10rpx; left: 50%; transform: translateX(-50%); width: 12rpx; height: 6rpx; background: #1677ff; border-radius: 3rpx; animation: pulse 1.5s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); } 50% { opacity: 0.7; transform: translateX(-50%) scale(1.1); } } .search-input { flex: 1; height: 80rpx; font-size: 28rpx; color: #333; padding: 0 20rpx; box-sizing: border-box; } .search-input::placeholder { color: #999; } .clear-icon { font-size: 30rpx; color: #999; padding: 10rpx; cursor: pointer; } /* 加载中样式 */ .loading-container { text-align: center; padding: 60rpx 0; } .loading-text { font-size: 28rpx; color: #999; } /* 货源列表样式 - 网格布局 */ .goods-section { width: 100%; margin-top: 20rpx; height: calc(100vh - 300rpx); /* 设置容器高度,确保scroll-view能正常滚动 */ } /* 滚动视图样式 */ .goods-list { height: 100%; /* 设置scroll-view高度为100%,确保能正常滚动 */ overflow: hidden; } .goods-list-container { width: 100%; padding: 0 10rpx; box-sizing: border-box; } /* 网格容器 */ .grid-container { display: flex; flex-wrap: wrap; gap: 20rpx; width: 100%; box-sizing: border-box; } /* 网格商品项 */ .grid-item { width: calc((100% - 20rpx) / 2); box-sizing: border-box; } /* 商品卡片样式 */ .product-card { background-color: white; border: 2rpx solid #e0e0e0; border-radius: 16rpx; overflow: hidden; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); transition: all 0.3s ease; padding: 16rpx; box-sizing: border-box; } .product-card:active { transform: scale(0.98); box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1); } /* 商品图片区域 */ .product-image-wrapper { position: relative; width: 100%; height: 200rpx; background: #f5f5f5; border-radius: 12rpx; overflow: hidden; margin-bottom: 16rpx; } .product-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; background-color: #f5f5f5; } /* 促销标签 */ .promo-tag { position: absolute; top: 0; left: 0; padding: 6rpx 12rpx; font-size: 20rpx; color: #fff; border-radius: 0 0 12rpx 0; z-index: 1; font-weight: 600; } .promo-tag.presale { background: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%); box-shadow: 0 2rpx 8rpx rgba(255, 107, 0, 0.3); } .promo-tag.in-stock { background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%); box-shadow: 0 2rpx 8rpx rgba(82, 196, 26, 0.3); } /* 商品信息区域 */ .product-info { padding: 0; display: flex; flex-direction: column; gap: 8rpx; } /* 商品标题行 - 包含商品名称和库存 */ .product-title-row { display: flex; justify-content: flex-start; align-items: center; width: 100%; flex-wrap: wrap; gap: 8rpx; } /* 商品标题 */ .product-title { font-size: 26rpx; color: #000000; line-height: 1.4; height: auto; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; font-weight: 700; flex: 1; margin-right: 0; } /* 库存计数 */ .stock-count { font-size: 20rpx; padding: 2rpx 10rpx; border-radius: 12rpx; background: rgba(82, 196, 26, 0.15); color: #389e0d; border: 1rpx solid rgba(82, 196, 26, 0.5); font-weight: 600; align-self: center; margin-top: 0; flex-shrink: 0; } /* 商品规格 */ .product-spec { font-size: 22rpx; color: #333333; height: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; margin-bottom: 2rpx; margin-top: 2rpx; } /* 商品元信息 */ .product-meta { display: flex; justify-content: space-between; align-items: center; margin: 2rpx 0 4rpx; padding: 0; } .product-price { font-size: 28rpx; color: #ff4d4f; font-weight: bold; } .product-location { font-size: 20rpx; color: #666; } /* 商品描述 */ .product-description { font-size: 22rpx; color: #666; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 6rpx 0; background: #fafafa; padding: 6rpx; border-radius: 8rpx; border: 1rpx solid #f0f0f0; width: 100%; box-sizing: border-box; min-height: 50rpx; display: flex; align-items: center; } /* 创建人信息 */ .creator-info { display: flex; justify-content: space-between; align-items: center; margin-top: 8rpx; padding-top: 12rpx; border-top: 1rpx solid #f0f0f0; font-size: 20rpx; } /* 加载更多样式 */ .loading-more { display: flex; justify-content: center; align-items: center; padding: 40rpx 0; width: 100%; } .loading-spinner { width: 32rpx; height: 32rpx; border: 3rpx solid #e5e5e5; border-top-color: #1677ff; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 12rpx; } .loading-text { font-size: 26rpx; color: #999; } @keyframes spin { to { transform: rotate(360deg); } } /* 无更多数据 */ .no-more-data { display: flex; align-items: center; justify-content: center; padding: 40rpx 0; color: #999; font-size: 26rpx; gap: 20rpx; } .no-more-data::before, .no-more-data::after { content: ''; flex: 1; height: 1rpx; background: #e5e5e5; max-width: 80rpx; } /* 空状态样式 */ .empty-container { text-align: center; padding: 100rpx 0; color: #999; font-size: 28rpx; } /* 骨架屏样式 */ .skeleton-container { padding: 20rpx 0; } .skeleton-grid { display: flex; flex-wrap: wrap; gap: 20rpx; width: 100%; padding: 0 10rpx; box-sizing: border-box; } .skeleton-grid-item { width: calc((100% - 20rpx) / 2); background: #fff; border-radius: 16rpx; overflow: hidden; padding: 16rpx; box-sizing: border-box; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); } .skeleton-image { width: 100%; height: 200rpx; background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 12rpx; margin-bottom: 16rpx; } .skeleton-title { height: 32rpx; margin-bottom: 12rpx; background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 8rpx; } .skeleton-title.short { width: 60%; height: 24rpx; margin-bottom: 16rpx; } .skeleton-footer { display: flex; justify-content: space-between; } .skeleton-price { width: 80rpx; height: 28rpx; background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 8rpx; } @keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }