<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>优品商城 - 发现好物</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdn.tailwindcss.com"></script>
<style type="text/tailwindcss">
@layer utilities {
.animate-pulse-border {
animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 101, 0.7); }
50% { box-shadow: 0 0 0 4px rgba(255, 138, 101, 0); }
}
.slide-in-right {
animation: slide-in-right 0.5s forwards;
}
@keyframes slide-in-right {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
}
</style>
</head>
<body class="bg-gray-50 font-sans antialiased text-gray-800">
<!-- 顶部导航栏 -->
<header class="sticky top-0 z-50 bg-white shadow-sm">
<!-- 顶部广告条 -->
<div class="bg-gradient-to-r from-blue-100 to-orange-100 px-4 py-2 flex justify-between items-center">
<span class="text-xs font-medium text-orange-600">🔥 限时全场满299减50</span>
<button class="text-gray-500 hover:text-gray-700 transition">
<i class="fas fa-times text-sm"></i>
</button>
</div>
<div class="container mx-auto px-4 py-3 flex items-center justify-between">
<div class="flex items-center space-x-2">
<i class="fas fa-store text-2xl text-blue-500"></i>
<span class="text-xl font-bold text-blue-600">优品商城</span>
</div>
<div class="relative flex-1 max-w-md mx-4">
<input type="text" placeholder="搜索商品..." class="w-full py-2 px-4 rounded-full border border-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-300 focus:border-transparent transition">
<button class="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-blue-500 transition">
<i class="fas fa-search"></i>
</button>
</div>
<div class="flex items-center space-x-4">
<button class="relative text-gray-600 hover:text-blue-500 transition">
<i class="fas fa-user text-xl"></i>
</button>
<button class="relative text-gray-600 hover:text-blue-500 transition">
<i class="fas fa-heart text-xl"></i>
</button>
<button class="relative text-gray-600 hover:text-blue-500 transition">
<i class="fas fa-shopping-cart text-xl"></i>
<span class="absolute -top-2 -right-2 bg-orange-500 text-white text-xs w-5 h-5 flex items-center justify-center rounded-full">3</span>
</button>
</div>
</div>
</header>
<main class="pb-20">
<!-- 英雄轮播区域 -->
<section class="relative overflow-hidden bg-white rounded-b-lg shadow-sm">
<div class="flex transition-transform duration-500">
<div class="min-w-full">
<img src="https://placehold.co/1200x400/E1F5FE/FF8A65?text=夏季新品上市" alt="促销活动" class="w-full h-auto">
</div>
</div>
<div class="absolute bottom-4 left-0 right-0 flex justify-center space-x-2">
<button class="w-2 h-2 rounded-full bg-white opacity-50"></button>
<button class="w-2 h-2 rounded-full bg-white"></button>
<button class="w-2 h-2 rounded-full bg-white opacity-50"></button>
</div>
</section>
<!-- 分类快捷入口 -->
<section class="container mx-auto px-4 py-6">
<div class="grid grid-cols-5 gap-4">
<a href="#" class="group flex flex-col items-center p-3 rounded-xl hover:bg-blue-50 transition">
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-blue-500 group-hover:bg-blue-200 transition mb-2">
<i class="fas fa-mobile-alt text-xl"></i>
</div>
<span class="text-sm font-medium text-gray-700">手机数码</span>
</a>
<a href="#" class="group flex flex-col items-center p-3 rounded-xl hover:bg-blue-50 transition">
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-blue-500 group-hover:bg-blue-200 transition mb-2">
<i class="fas fa-tshirt text-xl"></i>
</div>
<span class="text-sm font-medium text-gray-700">服饰鞋包</span>
</a>
<a href="#" class="group flex flex-col items-center p-3 rounded-xl hover:bg-blue-50 transition">
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-blue-500 group-hover:bg-blue-200 transition mb-2">
<i class="fas fa-home text-xl"></i>
</div>
<span class="text-sm font-medium text-gray-700">家居家装</span>
</a>
<a href="#" class="group flex flex-col items-center p-3 rounded-xl hover:bg-blue-50 transition">
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-blue-500 group-hover:bg-blue-200 transition mb-2">
<i class="fas fa-utensils text-xl"></i>
</div>
<span class="text-sm font-medium text-gray-700">美食生鲜</span>
</a>
<a href="#" class="group flex flex-col items-center p-3 rounded-xl hover:bg-blue-50 transition">
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-blue-500 group-hover:bg-blue-200 transition mb-2">
<i class="fas fa-baby text-xl"></i>
</div>
<span class="text-sm font-medium text-gray-700">母婴用品</span>
</a>
</div>
</section>
<!-- 中部广告卡 -->
<section class="container mx-auto px-4 mb-6">
<div class="bg-gradient-to-r from-blue-50 to-orange-50 rounded-xl p-4 flex items-center animate-pulse-border">
<div class="flex-1">
<span class="text-xs bg-orange-500 text-white px-2 py-1 rounded">限时特惠</span>
<h3 class="text-lg font-bold mt-2">会员专享 全场8折</h3>
<p class="text-sm text-gray-600 mt-1">新用户注册即送100元优惠券</p>
<button class="mt-3 bg-orange-500 hover:bg-orange-600 text-white px-4 py-2 rounded-full text-sm font-medium transition">立即领取</button>
</div>
<div class="w-1/3 flex justify-center">
<img src="https://placehold.co/200x120/E1F5FE/FF8A65?text=会员专享" alt="会员广告" class="h-24 object-contain">
</div>
</div>
</section>
<!-- 精选商品区 -->
<section class="container mx-auto px-4 mb-8">
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-bold text-gray-800">热销商品</h2>
<a href="#" class="text-sm text-blue-500 hover:text-blue-600 flex items-center transition">
查看更多 <i class="fas fa-chevron-right ml-1 text-xs"></i>
</a>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">
<!-- 商品卡片1 -->
<div class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=商品1" alt="商品图片" class="absolute top-0 left-0 w-full h-full object-cover">
<button class="absolute top-2 right-2 bg-white bg-opacity-80 rounded-full w-8 h-8 flex items-center justify-center text-gray-600 hover:text-red-500 transition">
<i class="far fa-heart"></i>
</button>
</div>
<div class="p-3">
<h3 class="text-sm font-medium text-gray-800 line-clamp-2">Apple iPhone 14 Pro Max 256GB 暗紫色</h3>
<div class="flex items-center mt-1">
<div class="flex text-yellow-400 text-xs">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<span class="text-xs text-gray-500 ml-1">4.8</span>
</div>
<div class="mt-2">
<span class="text-red-500 font-bold">¥8999</span>
<span class="text-xs text-gray-500 line-through ml-1">¥9999</span>
</div>
</div>
</div>
<!-- 商品卡片2 -->
<div class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=商品2" alt="商品图片" class="absolute top-0 left-0 w-full h-full object-cover">
<button class="absolute top-2 right-2 bg-white bg-opacity-80 rounded-full w-8 h-8 flex items-center justify-center text-gray-600 hover:text-red-500 transition">
<i class="far fa-heart"></i>
</button>
</div>
<div class="p-3">
<h3 class="text-sm font-medium text-gray-800 line-clamp-2">Bose QuietComfort 45 无线消噪耳机</h3>
<div class="flex items-center mt-1">
<div class="flex text-yellow-400 text-xs">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
<span class="text-xs text-gray-500 ml-1">5.0</span>
</div>
<div class="mt-2">
<span class="text-red-500 font-bold">¥2299</span>
<span class="text-xs text-gray-500 line-through ml-1">¥2599</span>
</div>
</div>
</div>
<!-- 商品插播广告 -->
<div class="bg-white rounded-lg overflow-hidden shadow-sm col-span-2 md:col-span-3 lg:col-span-5">
<div class="relative h-32">
<img src="https://placehold.co/600x200/E1F5FE/FF8A65?text=品牌合作广告" alt="品牌广告" class="w-full h-full object-cover">
<div class="absolute top-2 left-2 bg-black bg-opacity-50 text-white text-xs px-2 py-1 rounded">广告</div>
<button class="absolute top-2 right-2 bg-white bg-opacity-80 rounded-full w-8 h-8 flex items-center justify-center text-gray-600 hover:text-gray-800 transition">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<!-- 商品卡片3-5 -->
<div class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=商品3" alt="商品图片" class="absolute top-0 left-0 w-full h-full object-cover">
<button class="absolute top-2 right-2 bg-white bg-opacity-80 rounded-full w-8 h-8 flex items-center justify-center text-gray-600 hover:text-red-500 transition">
<i class="far fa-heart"></i>
</button>
</div>
<div class="p-3">
<h3 class="text-sm font-medium text-gray-800 line-clamp-2">戴尔XPS 13 9310 13.4英寸轻薄本</h3>
<div class="flex items-center mt-1">
<div class="flex text-yellow-400 text-xs">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
</div>
<span class="text-xs text-gray-500 ml-1">4.0</span>
</div>
<div class="mt-2">
<span class="text-red-500 font-bold">¥8999</span>
<span class="text-xs text-gray-500 line-through ml-1">¥9999</span>
</div>
</div>
</div>
<div class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=商品4" alt="商品图片" class="absolute top-0 left-0 w-full h-full object-cover">
<button class="absolute top-2 right-2 bg-white bg-opacity-80 rounded-full w-8 h-8 flex items-center justify-center text-gray-600 hover:text-red-500 transition">
<i class="far fa-heart"></i>
</button>
</div>
<div class="p-3">
<h3 class="text-sm font-medium text-gray-800 line-clamp-2">飞利浦电动牙刷HX6730/02</h3>
<div class="flex items-center mt-1">
<div class="flex text-yellow-400 text-xs">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<span class="text-xs text-gray-500 ml-1">4.7</span>
</div>
<div class="mt-2">
<span class="text-red-500 font-bold">¥399</span>
<span class="text-xs text-gray-500 line-through ml-1">¥599</span>
</div>
</div>
</div>
<div class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=商品5" alt="商品图片" class="absolute top-0 left-0 w-full h-full object-cover">
<button class="absolute top-2 right-2 bg-white bg-opacity-80 rounded-full w-8 h-8 flex items-center justify-center text-gray-600 hover:text-red-500 transition">
<i class="far fa-heart"></i>
</button>
</div>
<div class="p-3">
<h3 class="text-sm font-medium text-gray-800 line-clamp-2">小米手环7 Pro 智能手环</h3>
<div class="flex items-center mt-1">
<div class="flex text-yellow-400 text-xs">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
</div>
<span class="text-xs text-gray-500 ml-1">4.0</span>
</div>
<div class="mt-2">
<span class="text-red-500 font-bold">¥399</span>
<span class="text-xs text-gray-500 line-through ml-1">¥499</span>
</div>
</div>
</div>
</div>
</section>
<!-- 促销专区 -->
<section class="container mx-auto px-4 mb-8">
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-bold text-gray-800">限时秒杀</h2>
<div class="flex items-center">
<span class="text-sm text-gray-600 mr-2">距结束</span>
<div class="bg-gray-800 text-white text-sm px-2 py-1 rounded">12</div>
<span class="mx-1 text-gray-500">:</span>
<div class="bg-gray-800 text-white text-sm px-2 py-1 rounded">34</div>
<span class="mx-1 text-gray-500">:</span>
<div class="bg-gray-800 text-white text-sm px-2 py-1 rounded">56</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm overflow-hidden">
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 p-4">
<!-- 促销商品1 -->
<a href="#" class="group">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=秒杀1" alt="促销商品" class="absolute top-0 left-0 w-full h-full object-cover">
<div class="absolute bottom-0 left-0 right-0 bg-red-500 text-white text-xs text-center py-1">秒杀价</div>
</div>
<div class="mt-2">
<h3 class="text-sm font-medium text-gray-800 group-hover:text-red-500 transition">美的电饭煲4L</h3>
<div class="flex items-center justify-between mt-1">
<span class="text-red-500 font-bold">¥199</span>
<span class="text-xs text-gray-500 line-through">¥399</span>
</div>
</div>
</a>
<!-- 促销商品2 -->
<a href="#" class="group">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=秒杀2" alt="促销商品" class="absolute top-0 left-0 w-full h-full object-cover">
<div class="absolute bottom-0 left-0 right-0 bg-red-500 text-white text-xs text-center py-1">秒杀价</div>
</div>
<div class="mt-2">
<h3 class="text-sm font-medium text-gray-800 group-hover:text-red-500 transition">欧莱雅男士护肤套装</h3>
<div class="flex items-center justify-between mt-1">
<span class="text-red-500 font-bold">¥129</span>
<span class="text-xs text-gray-500 line-through">¥259</span>
</div>
</div>
</a>
<!-- 促销商品3 -->
<a href="#" class="group">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=秒杀3" alt="促销商品" class="absolute top-0 left-0 w-full h-full object-cover">
<div class="absolute bottom-0 left-0 right-0 bg-red-500 text-white text-xs text-center py-1">秒杀价</div>
</div>
<div class="mt-2">
<h3 class="text-sm font-medium text-gray-800 group-hover:text-red-500 transition">乐高积木城市系列</h3>
<div class="flex items-center justify-between mt-1">
<span class="text-red-500 font-bold">¥299</span>
<span class="text-xs text-gray-500 line-through">¥599</span>
</div>
</div>
</a>
<!-- 促销商品4 -->
<a href="#" class="group">
<div class="relative pt-[100%]">
<img src="https://placehold.co/300x300/E1F5FE/FF8A65?text=秒杀4" alt="促销商品" class="absolute top-0 left-0 w-full h-full object-cover">
<div class="absolute bottom-0 left-0 right-0 bg-red-500 text-white text-xs text-center py-1">秒杀价</div>
</div>
<div class="mt-2">
<h3 class="text-sm font-medium text-gray-800 group-hover:text-red-500 transition">飞利浦空气炸锅</h3>
<div class="flex items-center justify-between mt-1">
<span class="text-red-500 font-bold">¥499</span>
<span class="text-xs text-gray-500 line-through">¥799</span>
</div>
</div>
</a>
</div>
</div>
</section>
<!-- 侧边悬浮广告 (仅桌面端显示) -->
<div class="hidden lg:block fixed right-4 bottom-20 z-40">
<div class="relative group">
<button class="w-12 h-12 bg-orange-500 rounded-full flex items-center justify-center text-white shadow-lg hover:bg-orange-600 transition">
<i class="fas fa-gift text-xl"></i>
</button>
<div class="absolute right-14 bottom-0 w-64 bg-white rounded-lg shadow-xl p-4 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 slide-in-right">
<div class="flex items-start">
<img src="https://placehold.co/80x80/E1F5FE/FF8A65?text=新人礼" alt="新人礼包" class="w-16 h-16 object-cover rounded">
<div class="ml-3">
<h4 class="text-sm font-bold text-gray-800">新人专享礼包</h4>
<p class="text-xs text-gray-600 mt-1">注册即领¥100优惠券</p>
<button class="mt-2 bg-orange-500 hover:bg-orange-600 text-white px-3 py-1 rounded-full text-xs font-medium transition">立即领取</button>
</div>
</div>
<button class="absolute top-2 right-2 text-gray-400 hover:text-gray-600 transition">
<i class="fas fa-times text-sm"></i>
</button>
</div>
</div>
</div>
</main>
<!-- 底部导航 -->
<footer class="fixed bottom-0 left-0 right-0 bg-white shadow-lg z-40 border-t border-gray-100">
<div class="container mx-auto px-4">
<div class="grid grid-cols-5 py-2">
<a href="#" class="flex flex-col items-center text-blue-500">
<i class="fas fa-home text-xl"></i>
<span class="text-xs mt-1">首页</span>
</a>
<a href="#" class="flex flex-col items-center text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-th-large text-xl"></i>
<span class="text-xs mt-1">分类</span>
</a>
<a href="#" class="flex flex-col items-center text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-search text-xl"></i>
<span class="text-xs mt-1">发现</span>
</a>
<a href="#" class="flex flex-col items-center text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-shopping-cart text-xl"></i>
<span class="text-xs mt-1">购物车</span>
</a>
<a href="#" class="flex flex-col items-center text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-user text-xl"></i>
<span class="text-xs mt-1">我的</span>
</a>
</div>
</div>
</footer>
</body>
</html>这个电商App页面包含以下特点:
完整的广告系统:
- 顶部横幅广告条
- 中部促销广告卡(带脉冲边框动画)
- 商品列表中的插播广告
- 桌面端侧边悬浮广告(hover展开)
核心电商功能区域:
- 响应式顶部导航栏(带搜索功能)
- 商品轮播展示区
- 分类快捷入口(带悬停效果)
- 热销商品网格(带收藏按钮)
- 限时秒杀专区(带倒计时显示)
精细的交互设计:
- 所有可点击元素都有悬停状态
- 商品卡片阴影和过渡效果
- 侧边广告的滑动出现动画
- 促销广告的脉冲边框效果
移动端优化:
- 底部固定导航栏
- 响应式网格布局
- 触摸友好的按钮尺寸
视觉风格:
- 蓝橙配色方案
- 清晰的字体层次
- 统一的圆角设计
- 适当的留白和间距
页面完全使用CSS实现交互效果,无需JavaScript即可展示核心功能。
需支付 5元 阅读剩余内容