WOde.html 21 KB

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