123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <link rel="stylesheet" href="path/to/Common.css">
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <title>我的 - 饰品商城</title>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
- }
- body {
- background-color: #f5f5f5;
- color: #333;
- font-size: 14px;
- padding-bottom: 60px; /* 为底部tab栏留出空间 */
- }
- /* 顶部标签栏 */
- .header {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- z-index: 100;
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
- }
- .tab-container {
- display: flex;
- align-items: center;
- padding: 10px 0;
- border-bottom: 1px solid #eee;
- }
- .tabs {
- flex: 1;
- overflow-x: auto;
- white-space: nowrap;
- scrollbar-width: none; /* Firefox */
- -ms-overflow-style: none; /* IE and Edge */
- }
- .tabs::-webkit-scrollbar {
- display: none; /* Chrome, Safari, Opera */
- }
- .tab {
- display: inline-block;
- padding: 5px 12px;
- margin: 0 5px;
- border-radius: 15px;
- font-size: 14px;
- color: #666;
- }
- .tab.active {
- background-color: #1890ff;
- color: white;
- }
- .action-buttons {
- display: flex;
- padding: 0 10px;
- }
- .action-btn {
- padding: 5px;
- color: #666;
- font-size: 16px;
- }
- /* 内容区域 */
- .content {
- margin-top: 50px; /* 顶部标签栏高度 */
- padding: 10px;
- }
- /* 用户信息卡片 */
- .user-card {
- background-color: white;
- border-radius: 10px;
- padding: 15px;
- margin-bottom: 15px;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- display: flex;
- align-items: center;
- }
- .user-avatar {
- width: 60px;
- height: 60px;
- border-radius: 50%;
- background-color: #f0f0f0;
- margin-right: 15px;
- overflow: hidden;
- position: relative;
- }
- .user-avatar img {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .user-info {
- flex: 1;
- }
- .user-name {
- font-size: 16px;
- font-weight: bold;
- margin-bottom: 5px;
- }
- .user-id {
- font-size: 12px;
- color: #999;
- margin-bottom: 5px;
- }
- .user-balance {
- font-size: 14px;
- color: #1890ff;
- font-weight: bold;
- }
- .edit-btn {
- width: 30px;
- height: 30px;
- border-radius: 50%;
- background-color: #f5f5f5;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #666;
- }
- /* 功能入口 */
- .function-grid {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 10px;
- margin-bottom: 15px;
- }
- .function-item {
- background-color: white;
- border-radius: 8px;
- padding: 10px 5px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- }
- .function-item i {
- font-size: 20px;
- margin-bottom: 5px;
- color: #1890ff;
- }
- .function-item span {
- font-size: 12px;
- }
- /* 订单状态 */
- .order-status {
- background-color: white;
- border-radius: 10px;
- padding: 15px;
- margin-bottom: 15px;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- }
- .order-title {
- font-size: 14px;
- font-weight: bold;
- margin-bottom: 15px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .order-title a {
- font-size: 12px;
- color: #1890ff;
- font-weight: normal;
- }
- .order-steps {
- display: flex;
- justify-content: space-between;
- padding: 0 10px;
- }
- .order-step {
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- }
- .order-step:not(:last-child):after {
- content: "";
- position: absolute;
- top: 12px;
- left: 30px;
- right: -30px;
- height: 1px;
- background-color: #eee;
- z-index: 1;
- }
- .step-icon {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- background-color: #f5f5f5;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 5px;
- z-index: 2;
- }
- .step-icon.active {
- background-color: #1890ff;
- color: white;
- }
- .step-text {
- font-size: 12px;
- color: #666;
- }
- .step-text.active {
- color: #1890ff;
- font-weight: bold;
- }
- /* 我的收藏 */
- .favorite-section {
- background-color: white;
- border-radius: 10px;
- padding: 15px;
- margin-bottom: 15px;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- }
- .section-title {
- font-size: 14px;
- font-weight: bold;
- margin-bottom: 15px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .section-title a {
- font-size: 12px;
- color: #1890ff;
- font-weight: normal;
- }
- .favorite-list {
- display: flex;
- overflow-x: auto;
- scrollbar-width: none; /* Firefox */
- -ms-overflow-style: none; /* IE and Edge */
- }
- .favorite-list::-webkit-scrollbar {
- display: none; /* Chrome, Safari, Opera */
- }
- .favorite-item {
- flex: 0 0 auto;
- width: 80px;
- margin-right: 10px;
- }
- .favorite-image {
- width: 80px;
- height: 80px;
- border-radius: 8px;
- background-color: #f0f0f0;
- overflow: hidden;
- position: relative;
- margin-bottom: 5px;
- }
- .favorite-image img {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .favorite-name {
- font-size: 12px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- text-align: center;
- }
- /* 底部Tab栏 */
- .tab-bar {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- display: flex;
- background-color: white;
- border-top: 1px solid #eee;
- z-index: 100;
- }
- .tab-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 8px 0;
- color: #666;
- }
- .tab-item.active {
- color: #1890ff;
- }
- .tab-item i {
- font-size: 20px;
- margin-bottom: 2px;
- }
- .tab-item span {
- font-size: 12px;
- }
- </style>
- </head>
- <body>
- <!-- 顶部标签栏 -->
- <div class="header">
- <div class="tab-container">
- <div class="tabs">
- <span class="tab">我的主页</span>
- <span class="tab">我的订单</span>
- <span class="tab active">个人中心</span>
- <span class="tab">账户设置</span>
- </div>
- <div class="action-buttons">
- <div class="action-btn"><i class="bi bi-gear"></i></div>
- </div>
- </div>
- </div>
-
- <!-- 内容区域 -->
- <div class="content">
- <!-- 用户信息卡片 -->
- <div class="user-card">
- <div class="user-avatar">
- <img src="images/avatar.jpg" alt="用户头像">
- </div>
- <div class="user-info">
- <div class="user-name">饰品收藏家</div>
- <div class="user-id">ID: CSGO123456</div>
- <div class="user-balance">余额: ¥ 1,234.56</div>
- </div>
- <div class="edit-btn">
- <i class="bi bi-pencil"></i>
- </div>
- </div>
-
- <!-- 功能入口 -->
- <div class="function-grid">
- <div class="function-item">
- <i class="bi bi-wallet2"></i>
- <span>我的钱包</span>
- </div>
- <div class="function-item">
- <i class="bi bi-heart"></i>
- <span>我的收藏</span>
- </div>
- <div class="function-item">
- <i class="bi bi-cart"></i>
- <span>购物车</span>
- </div>
- <div class="function-item">
- <i class="bi bi-ticket-perforated"></i>
- <span>优惠券</span>
- </div>
- <div class="function-item">
- <i class="bi bi-shield-check"></i>
- <span>安全中心</span>
- </div>
- <div class="function-item">
- <i class="bi bi-chat-left-text"></i>
- <span>消息中心</span>
- </div>
- <div class="function-item">
- <i class="bi bi-question-circle"></i>
- <span>帮助中心</span>
- </div>
- <div class="function-item">
- <i class="bi bi-box-arrow-right"></i>
- <span>退出登录</span>
- </div>
- </div>
-
- <!-- 订单状态 -->
- <div class="order-status">
- <div class="order-title">
- <span>我的订单</span>
- <a href="#">查看全部 <i class="bi bi-chevron-right"></i></a>
- </div>
- <div class="order-steps">
- <div class="order-step">
- <div class="step-icon active">
- <i class="bi bi-cart"></i>
- </div>
- <div class="step-text active">待付款</div>
- </div>
- <div class="order-step">
- <div class="step-icon">
- <i class="bi bi-truck"></i>
- </div>
- <div class="step-text">待发货</div>
- </div>
- <div class="order-step">
- <div class="step-icon">
- <i class="bi bi-box-seam"></i>
- </div>
- <div class="step-text">待收货</div>
- </div>
- <div class="order-step">
- <div class="step-icon">
- <i class="bi bi-star"></i>
- </div>
- <div class="step-text">待评价</div>
- </div>
- <div class="order-step">
- <div class="step-icon">
- <i class="bi bi-arrow-left-right"></i>
- </div>
- <div class="step-text">退换货</div>
- </div>
- </div>
- </div>
-
- <!-- 我的收藏 -->
- <div class="favorite-section">
- <div class="section-title">
- <span>我的收藏</span>
- <a href="#">查看全部 <i class="bi bi-chevron-right"></i></a>
- </div>
- <div class="favorite-list">
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/AWP.jpg" alt="收藏饰品">
- </div>
- <div class="favorite-name">AWP | 二西莫夫</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/Knife.jpg" alt="收藏饰品">
- </div>
- <div class="favorite-name">蝴蝶刀</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/AK2.jpg" alt="收藏饰品">
- </div>
- <div class="favorite-name">AK-47</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/Glove.jpg" alt="收藏饰品">
- </div>
- <div class="favorite-name">手套</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/Degou.jpg" alt="收藏饰品">
- </div>
- <div class="favorite-name">沙漠之鹰</div>
- </div>
- </div>
- </div>
-
- <!-- 最近浏览 -->
- <div class="favorite-section">
- <div class="section-title">
- <span>最近浏览</span>
- <a href="#">查看全部 <i class="bi bi-chevron-right"></i></a>
- </div>
- <div class="favorite-list">
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/A4.jpg" alt="浏览饰品">
- </div>
- <div class="favorite-name">M4A4 | 二西莫夫</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/AK2.jpg" alt="浏览饰品">
- </div>
- <div class="favorite-name">AK-47</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/Knife.jpg" alt="浏览饰品">
- </div>
- <div class="favorite-name">蝴蝶刀</div>
- </div>
- <div class="favorite-item">
- <div class="favorite-image">
- <img src="images/Degou.jpg" alt="浏览饰品">
- </div>
- <div class="favorite-name">沙漠之鹰</div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 底部Tab栏 -->
- <div class="tab-bar">
- <div class="tab-item ">
- <a href="home.html">
- <i class="bi bi-house"></i>
- <span>首页</span>
- </a>
- </div>
- <div class="tab-item">
- <a href="discover.html">
- <i class="bi bi-compass"></i>
- <span>发现</span>
- </a>
- </div>
- <div class="tab-item">
- <a href="Kucun.html">
- <i class="bi bi-bag"></i>
- <span>库存</span>
- </a>
- </div>
- <div class="tab-item">
- <a href="Dianpu.html">
- <i class="bi bi-shop"></i>
- <span>店铺</span>
- </a>
- </div>
- <div class="tab-item active">
- <a href="WOde.html">
- <i class="bi bi-person"></i>
- <span>我</span>
- </a>
- </div>
- </div>
-
- <script>
- // 简单的交互逻辑
- document.addEventListener('DOMContentLoaded', function(){
- // 切换标签
- const tabs = document.querySelectorAll('.tab');
- tabs.forEach(tab => {
- tab.addEventListener('click', function() {
- tabs.forEach(t => t.classList.remove('active'));
- this.classList.add('active');
- });
- });
-
- // 切换底部Tab
- const tabItems = document.querySelectorAll('.tab-item');
- tabItems.forEach(item => {
- item.addEventListener('click', function() {
- tabItems.forEach(i => i.classList.remove('active'));
- this.classList.add('active');
- });
- });
-
- // 顶部标签栏滚动效果 (优化版)
- const tabsContainer = document.querySelector('.tabs');
- let isDown = false;
- let startX;
- let scrollLeft;
- let velocity = 0;
- let lastTime = 0;
-
- // 惯性滚动参数
- const DECELERATION = 0.92;
- const FRAME_DURATION =16;
-
- // 通用按下事件处理
- function handlePointerDown(e) {
- isDown = true;
- const clientX = e.type.includes('touch') ? e.touches[0].clientX : e.clientX;
- startX = clientX - tabsContainer.getBoundingClientRect().left;
- scrollLeft = tabsContainer.scrollLeft;
- lastTime = performance.now();
- velocity = 0;
- }
-
- // 通用移动事件处理
- function handlePointerMove(e) {
- if (!isDown) return;
- const clientX = e.type.includes('touch') ? e.touches[0].clientX : e.clientX;
- const x = clientX - tabsContainer.getBoundingClientRect().left;
- const walk = (x - startX) * 1.5; // 调整滚动系数
-
- // 记录速度用于惯性滚动
- const now = performance.now();
- const deltaTime = now - lastTime;
- if (deltaTime > 0) {
- velocity = (walk - (tabsContainer.scrollLeft - scrollLeft)) / deltaTime;
- }
- lastTime = now;
- tabsContainer.scrollLeft = scrollLeft - walk;
- }
-
- // 惯性滚动函数
- function inertialScroll() {
- if (!isDown && Math.abs(velocity) > 0.1) {
- velocity *= DECELERATION;
- tabsContainer.scrollLeft += velocity * FRAME_DURATION;
- requestAnimationFrame(inertialScroll);
- } else {
- velocity = 0;
- }
- }
-
- // 事件监听优化
- tabsContainer.addEventListener('mousedown', handlePointerDown);
- tabsContainer.addEventListener('touchstart', handlePointerDown);
- document.addEventListener('mousemove', handlePointerMove);
- document.addEventListener('touchmove', (e) => {
- handlePointerMove(e);
- e.preventDefault(); // 阻止默认滚动行为
- }, { passive: false });
-
- document.addEventListener('mouseup', () => {
- isDown = false;
- requestAnimationFrame(inertialScroll);
- });
- document.addEventListener('touchend', () => {
- isDown = false;
- requestAnimationFrame(inertialScroll);
- });
-
- // 容器边界限制
- tabsContainer.addEventListener('scroll', () => {
- const maxScroll = tabsContainer.scrollWidth - tabsContainer.clientWidth;
- if (tabsContainer.scrollLeft < 0) {
- tabsContainer.scrollLeft = 0;
- } else if (tabsContainer.scrollLeft > maxScroll) {
- tabsContainer.scrollLeft = maxScroll;
- }
- });
- }); // 结束DOMContentLoaded
- </script>
|