WOde.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <link rel="stylesheet" href="path/to/Common.css">
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  7. <title>我的 - 饰品商城</title>
  8. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
  9. <style>
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. box-sizing: border-box;
  14. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  15. }
  16. body {
  17. background-color: #f5f5f5;
  18. color: #333;
  19. font-size: 14px;
  20. padding-bottom: 60px; /* 为底部tab栏留出空间 */
  21. }
  22. /* 顶部标签栏 */
  23. .header {
  24. position: fixed;
  25. top: 0;
  26. left: 0;
  27. right: 0;
  28. background-color: #fff;
  29. z-index: 100;
  30. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  31. }
  32. .tab-container {
  33. display: flex;
  34. align-items: center;
  35. padding: 10px 0;
  36. border-bottom: 1px solid #eee;
  37. }
  38. .tabs {
  39. flex: 1;
  40. overflow-x: auto;
  41. white-space: nowrap;
  42. scrollbar-width: none; /* Firefox */
  43. -ms-overflow-style: none; /* IE and Edge */
  44. }
  45. .tabs::-webkit-scrollbar {
  46. display: none; /* Chrome, Safari, Opera */
  47. }
  48. .tab {
  49. display: inline-block;
  50. padding: 5px 12px;
  51. margin: 0 5px;
  52. border-radius: 15px;
  53. font-size: 14px;
  54. color: #666;
  55. }
  56. .tab.active {
  57. background-color: #1890ff;
  58. color: white;
  59. }
  60. .action-buttons {
  61. display: flex;
  62. padding: 0 10px;
  63. }
  64. .action-btn {
  65. padding: 5px;
  66. color: #666;
  67. font-size: 16px;
  68. }
  69. /* 内容区域 */
  70. .content {
  71. margin-top: 50px; /* 顶部标签栏高度 */
  72. padding: 10px;
  73. }
  74. /* 用户信息卡片 */
  75. .user-card {
  76. background-color: white;
  77. border-radius: 10px;
  78. padding: 15px;
  79. margin-bottom: 15px;
  80. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  81. display: flex;
  82. align-items: center;
  83. }
  84. .user-avatar {
  85. width: 60px;
  86. height: 60px;
  87. border-radius: 50%;
  88. background-color: #f0f0f0;
  89. margin-right: 15px;
  90. overflow: hidden;
  91. position: relative;
  92. }
  93. .user-avatar img {
  94. position: absolute;
  95. top: 0;
  96. left: 0;
  97. width: 100%;
  98. height: 100%;
  99. object-fit: cover;
  100. }
  101. .user-info {
  102. flex: 1;
  103. }
  104. .user-name {
  105. font-size: 16px;
  106. font-weight: bold;
  107. margin-bottom: 5px;
  108. }
  109. .user-id {
  110. font-size: 12px;
  111. color: #999;
  112. margin-bottom: 5px;
  113. }
  114. .user-balance {
  115. font-size: 14px;
  116. color: #1890ff;
  117. font-weight: bold;
  118. }
  119. .edit-btn {
  120. width: 30px;
  121. height: 30px;
  122. border-radius: 50%;
  123. background-color: #f5f5f5;
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. color: #666;
  128. }
  129. /* 功能入口 */
  130. .function-grid {
  131. display: grid;
  132. grid-template-columns: repeat(4, 1fr);
  133. gap: 10px;
  134. margin-bottom: 15px;
  135. }
  136. .function-item {
  137. background-color: white;
  138. border-radius: 8px;
  139. padding: 10px 5px;
  140. display: flex;
  141. flex-direction: column;
  142. align-items: center;
  143. justify-content: center;
  144. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  145. }
  146. .function-item i {
  147. font-size: 20px;
  148. margin-bottom: 5px;
  149. color: #1890ff;
  150. }
  151. .function-item span {
  152. font-size: 12px;
  153. }
  154. /* 订单状态 */
  155. .order-status {
  156. background-color: white;
  157. border-radius: 10px;
  158. padding: 15px;
  159. margin-bottom: 15px;
  160. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  161. }
  162. .order-title {
  163. font-size: 14px;
  164. font-weight: bold;
  165. margin-bottom: 15px;
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. }
  170. .order-title a {
  171. font-size: 12px;
  172. color: #1890ff;
  173. font-weight: normal;
  174. }
  175. .order-steps {
  176. display: flex;
  177. justify-content: space-between;
  178. padding: 0 10px;
  179. }
  180. .order-step {
  181. display: flex;
  182. flex-direction: column;
  183. align-items: center;
  184. position: relative;
  185. }
  186. .order-step:not(:last-child):after {
  187. content: "";
  188. position: absolute;
  189. top: 12px;
  190. left: 30px;
  191. right: -30px;
  192. height: 1px;
  193. background-color: #eee;
  194. z-index: 1;
  195. }
  196. .step-icon {
  197. width: 24px;
  198. height: 24px;
  199. border-radius: 50%;
  200. background-color: #f5f5f5;
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. margin-bottom: 5px;
  205. z-index: 2;
  206. }
  207. .step-icon.active {
  208. background-color: #1890ff;
  209. color: white;
  210. }
  211. .step-text {
  212. font-size: 12px;
  213. color: #666;
  214. }
  215. .step-text.active {
  216. color: #1890ff;
  217. font-weight: bold;
  218. }
  219. /* 我的收藏 */
  220. .favorite-section {
  221. background-color: white;
  222. border-radius: 10px;
  223. padding: 15px;
  224. margin-bottom: 15px;
  225. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  226. }
  227. .section-title {
  228. font-size: 14px;
  229. font-weight: bold;
  230. margin-bottom: 15px;
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. }
  235. .section-title a {
  236. font-size: 12px;
  237. color: #1890ff;
  238. font-weight: normal;
  239. }
  240. .favorite-list {
  241. display: flex;
  242. overflow-x: auto;
  243. scrollbar-width: none; /* Firefox */
  244. -ms-overflow-style: none; /* IE and Edge */
  245. }
  246. .favorite-list::-webkit-scrollbar {
  247. display: none; /* Chrome, Safari, Opera */
  248. }
  249. .favorite-item {
  250. flex: 0 0 auto;
  251. width: 80px;
  252. margin-right: 10px;
  253. }
  254. .favorite-image {
  255. width: 80px;
  256. height: 80px;
  257. border-radius: 8px;
  258. background-color: #f0f0f0;
  259. overflow: hidden;
  260. position: relative;
  261. margin-bottom: 5px;
  262. }
  263. .favorite-image img {
  264. position: absolute;
  265. top: 0;
  266. left: 0;
  267. width: 100%;
  268. height: 100%;
  269. object-fit: cover;
  270. }
  271. .favorite-name {
  272. font-size: 12px;
  273. white-space: nowrap;
  274. overflow: hidden;
  275. text-overflow: ellipsis;
  276. text-align: center;
  277. }
  278. /* 底部Tab栏 */
  279. .tab-bar {
  280. position: fixed;
  281. bottom: 0;
  282. left: 0;
  283. right: 0;
  284. display: flex;
  285. background-color: white;
  286. border-top: 1px solid #eee;
  287. z-index: 100;
  288. }
  289. .tab-item {
  290. flex: 1;
  291. display: flex;
  292. flex-direction: column;
  293. align-items: center;
  294. justify-content: center;
  295. padding: 8px 0;
  296. color: #666;
  297. }
  298. .tab-item.active {
  299. color: #1890ff;
  300. }
  301. .tab-item i {
  302. font-size: 20px;
  303. margin-bottom: 2px;
  304. }
  305. .tab-item span {
  306. font-size: 12px;
  307. }
  308. </style>
  309. </head>
  310. <body>
  311. <!-- 顶部标签栏 -->
  312. <div class="header">
  313. <div class="tab-container">
  314. <div class="tabs">
  315. <span class="tab">我的主页</span>
  316. <span class="tab">我的订单</span>
  317. <span class="tab active">个人中心</span>
  318. <span class="tab">账户设置</span>
  319. </div>
  320. <div class="action-buttons">
  321. <div class="action-btn"><i class="bi bi-gear"></i></div>
  322. </div>
  323. </div>
  324. </div>
  325. <!-- 内容区域 -->
  326. <div class="content">
  327. <!-- 用户信息卡片 -->
  328. <div class="user-card">
  329. <div class="user-avatar">
  330. <img src="images/avatar.jpg" alt="用户头像">
  331. </div>
  332. <div class="user-info">
  333. <div class="user-name">饰品收藏家</div>
  334. <div class="user-id">ID: CSGO123456</div>
  335. <div class="user-balance">余额: ¥ 1,234.56</div>
  336. </div>
  337. <div class="edit-btn">
  338. <i class="bi bi-pencil"></i>
  339. </div>
  340. </div>
  341. <!-- 功能入口 -->
  342. <div class="function-grid">
  343. <div class="function-item">
  344. <i class="bi bi-wallet2"></i>
  345. <span>我的钱包</span>
  346. </div>
  347. <div class="function-item">
  348. <i class="bi bi-heart"></i>
  349. <span>我的收藏</span>
  350. </div>
  351. <div class="function-item">
  352. <i class="bi bi-cart"></i>
  353. <span>购物车</span>
  354. </div>
  355. <div class="function-item">
  356. <i class="bi bi-ticket-perforated"></i>
  357. <span>优惠券</span>
  358. </div>
  359. <div class="function-item">
  360. <i class="bi bi-shield-check"></i>
  361. <span>安全中心</span>
  362. </div>
  363. <div class="function-item">
  364. <i class="bi bi-chat-left-text"></i>
  365. <span>消息中心</span>
  366. </div>
  367. <div class="function-item">
  368. <i class="bi bi-question-circle"></i>
  369. <span>帮助中心</span>
  370. </div>
  371. <div class="function-item">
  372. <i class="bi bi-box-arrow-right"></i>
  373. <span>退出登录</span>
  374. </div>
  375. </div>
  376. <!-- 订单状态 -->
  377. <div class="order-status">
  378. <div class="order-title">
  379. <span>我的订单</span>
  380. <a href="#">查看全部 <i class="bi bi-chevron-right"></i></a>
  381. </div>
  382. <div class="order-steps">
  383. <div class="order-step">
  384. <div class="step-icon active">
  385. <i class="bi bi-cart"></i>
  386. </div>
  387. <div class="step-text active">待付款</div>
  388. </div>
  389. <div class="order-step">
  390. <div class="step-icon">
  391. <i class="bi bi-truck"></i>
  392. </div>
  393. <div class="step-text">待发货</div>
  394. </div>
  395. <div class="order-step">
  396. <div class="step-icon">
  397. <i class="bi bi-box-seam"></i>
  398. </div>
  399. <div class="step-text">待收货</div>
  400. </div>
  401. <div class="order-step">
  402. <div class="step-icon">
  403. <i class="bi bi-star"></i>
  404. </div>
  405. <div class="step-text">待评价</div>
  406. </div>
  407. <div class="order-step">
  408. <div class="step-icon">
  409. <i class="bi bi-arrow-left-right"></i>
  410. </div>
  411. <div class="step-text">退换货</div>
  412. </div>
  413. </div>
  414. </div>
  415. <!-- 我的收藏 -->
  416. <div class="favorite-section">
  417. <div class="section-title">
  418. <span>我的收藏</span>
  419. <a href="#">查看全部 <i class="bi bi-chevron-right"></i></a>
  420. </div>
  421. <div class="favorite-list">
  422. <div class="favorite-item">
  423. <div class="favorite-image">
  424. <img src="images/AWP.jpg" alt="收藏饰品">
  425. </div>
  426. <div class="favorite-name">AWP | 二西莫夫</div>
  427. </div>
  428. <div class="favorite-item">
  429. <div class="favorite-image">
  430. <img src="images/Knife.jpg" alt="收藏饰品">
  431. </div>
  432. <div class="favorite-name">蝴蝶刀</div>
  433. </div>
  434. <div class="favorite-item">
  435. <div class="favorite-image">
  436. <img src="images/AK2.jpg" alt="收藏饰品">
  437. </div>
  438. <div class="favorite-name">AK-47</div>
  439. </div>
  440. <div class="favorite-item">
  441. <div class="favorite-image">
  442. <img src="images/Glove.jpg" alt="收藏饰品">
  443. </div>
  444. <div class="favorite-name">手套</div>
  445. </div>
  446. <div class="favorite-item">
  447. <div class="favorite-image">
  448. <img src="images/Degou.jpg" alt="收藏饰品">
  449. </div>
  450. <div class="favorite-name">沙漠之鹰</div>
  451. </div>
  452. </div>
  453. </div>
  454. <!-- 最近浏览 -->
  455. <div class="favorite-section">
  456. <div class="section-title">
  457. <span>最近浏览</span>
  458. <a href="#">查看全部 <i class="bi bi-chevron-right"></i></a>
  459. </div>
  460. <div class="favorite-list">
  461. <div class="favorite-item">
  462. <div class="favorite-image">
  463. <img src="images/A4.jpg" alt="浏览饰品">
  464. </div>
  465. <div class="favorite-name">M4A4 | 二西莫夫</div>
  466. </div>
  467. <div class="favorite-item">
  468. <div class="favorite-image">
  469. <img src="images/AK2.jpg" alt="浏览饰品">
  470. </div>
  471. <div class="favorite-name">AK-47</div>
  472. </div>
  473. <div class="favorite-item">
  474. <div class="favorite-image">
  475. <img src="images/Knife.jpg" alt="浏览饰品">
  476. </div>
  477. <div class="favorite-name">蝴蝶刀</div>
  478. </div>
  479. <div class="favorite-item">
  480. <div class="favorite-image">
  481. <img src="images/Degou.jpg" alt="浏览饰品">
  482. </div>
  483. <div class="favorite-name">沙漠之鹰</div>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. <!-- 底部Tab栏 -->
  489. <div class="tab-bar">
  490. <div class="tab-item ">
  491. <a href="home.html">
  492. <i class="bi bi-house"></i>
  493. <span>首页</span>
  494. </a>
  495. </div>
  496. <div class="tab-item">
  497. <a href="discover.html">
  498. <i class="bi bi-compass"></i>
  499. <span>发现</span>
  500. </a>
  501. </div>
  502. <div class="tab-item">
  503. <a href="Kucun.html">
  504. <i class="bi bi-bag"></i>
  505. <span>库存</span>
  506. </a>
  507. </div>
  508. <div class="tab-item">
  509. <a href="Dianpu.html">
  510. <i class="bi bi-shop"></i>
  511. <span>店铺</span>
  512. </a>
  513. </div>
  514. <div class="tab-item active">
  515. <a href="WOde.html">
  516. <i class="bi bi-person"></i>
  517. <span>我</span>
  518. </a>
  519. </div>
  520. </div>
  521. <script>
  522. // 简单的交互逻辑
  523. document.addEventListener('DOMContentLoaded', function(){
  524. // 切换标签
  525. const tabs = document.querySelectorAll('.tab');
  526. tabs.forEach(tab => {
  527. tab.addEventListener('click', function() {
  528. tabs.forEach(t => t.classList.remove('active'));
  529. this.classList.add('active');
  530. });
  531. });
  532. // 切换底部Tab
  533. const tabItems = document.querySelectorAll('.tab-item');
  534. tabItems.forEach(item => {
  535. item.addEventListener('click', function() {
  536. tabItems.forEach(i => i.classList.remove('active'));
  537. this.classList.add('active');
  538. });
  539. });
  540. // 顶部标签栏滚动效果 (优化版)
  541. const tabsContainer = document.querySelector('.tabs');
  542. let isDown = false;
  543. let startX;
  544. let scrollLeft;
  545. let velocity = 0;
  546. let lastTime = 0;
  547. // 惯性滚动参数
  548. const DECELERATION = 0.92;
  549. const FRAME_DURATION =16;
  550. // 通用按下事件处理
  551. function handlePointerDown(e) {
  552. isDown = true;
  553. const clientX = e.type.includes('touch') ? e.touches[0].clientX : e.clientX;
  554. startX = clientX - tabsContainer.getBoundingClientRect().left;
  555. scrollLeft = tabsContainer.scrollLeft;
  556. lastTime = performance.now();
  557. velocity = 0;
  558. }
  559. // 通用移动事件处理
  560. function handlePointerMove(e) {
  561. if (!isDown) return;
  562. const clientX = e.type.includes('touch') ? e.touches[0].clientX : e.clientX;
  563. const x = clientX - tabsContainer.getBoundingClientRect().left;
  564. const walk = (x - startX) * 1.5; // 调整滚动系数
  565. // 记录速度用于惯性滚动
  566. const now = performance.now();
  567. const deltaTime = now - lastTime;
  568. if (deltaTime > 0) {
  569. velocity = (walk - (tabsContainer.scrollLeft - scrollLeft)) / deltaTime;
  570. }
  571. lastTime = now;
  572. tabsContainer.scrollLeft = scrollLeft - walk;
  573. }
  574. // 惯性滚动函数
  575. function inertialScroll() {
  576. if (!isDown && Math.abs(velocity) > 0.1) {
  577. velocity *= DECELERATION;
  578. tabsContainer.scrollLeft += velocity * FRAME_DURATION;
  579. requestAnimationFrame(inertialScroll);
  580. } else {
  581. velocity = 0;
  582. }
  583. }
  584. // 事件监听优化
  585. tabsContainer.addEventListener('mousedown', handlePointerDown);
  586. tabsContainer.addEventListener('touchstart', handlePointerDown);
  587. document.addEventListener('mousemove', handlePointerMove);
  588. document.addEventListener('touchmove', (e) => {
  589. handlePointerMove(e);
  590. e.preventDefault(); // 阻止默认滚动行为
  591. }, { passive: false });
  592. document.addEventListener('mouseup', () => {
  593. isDown = false;
  594. requestAnimationFrame(inertialScroll);
  595. });
  596. document.addEventListener('touchend', () => {
  597. isDown = false;
  598. requestAnimationFrame(inertialScroll);
  599. });
  600. // 容器边界限制
  601. tabsContainer.addEventListener('scroll', () => {
  602. const maxScroll = tabsContainer.scrollWidth - tabsContainer.clientWidth;
  603. if (tabsContainer.scrollLeft < 0) {
  604. tabsContainer.scrollLeft = 0;
  605. } else if (tabsContainer.scrollLeft > maxScroll) {
  606. tabsContainer.scrollLeft = maxScroll;
  607. }
  608. });
  609. }); // 结束DOMContentLoaded
  610. </script>