category.wxss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. /* pages/category/category.wxss */
  2. page {
  3. height: 100%;
  4. background: #E5F1FF;
  5. }
  6. .my-tabbar .tabbar{
  7. box-shadow: none!important;
  8. border-radius: 0!important;
  9. }
  10. .container {
  11. /* display: flex; */
  12. flex-direction: row;
  13. height: 100%;
  14. }
  15. .main {
  16. /* position: fixed; */
  17. display: flex;
  18. overflow: hidden;
  19. /* margin-top: 78rpx; */
  20. height: calc(100% - 270rpx);
  21. }
  22. /* 搜索栏 */
  23. .top-search-input {
  24. margin-left: 20rpx;
  25. display: flex;
  26. align-items: center;
  27. width: 500rpx;
  28. border: 2rpx solid #006CE8;
  29. border-radius: 40rpx;
  30. height: 60rpx;
  31. background: #fff;
  32. box-sizing: border-box;
  33. }
  34. .top-search-swiper {
  35. width: 440rpx;
  36. height: 60rpx;
  37. line-height: 60rpx;
  38. margin-top: 0;
  39. font-weight: normal;
  40. font-size: 24rpx;
  41. color: #AAAAAA;
  42. margin-left: 28rpx;
  43. }
  44. .top-search-line {
  45. color: #DEDEDE;
  46. margin-right: 16rpx;
  47. }
  48. .top-search-text {
  49. width: 100rpx;
  50. font-weight: bold;
  51. font-size: 28rpx;
  52. color: #006CE8;
  53. }
  54. /* 顶部分类 */
  55. .top-content{
  56. position: relative;
  57. }
  58. .top-box{
  59. white-space: nowrap;
  60. align-items: center;
  61. margin-top: 100rpx;
  62. width: 100%;
  63. padding-left: 24rpx;
  64. box-sizing: border-box;
  65. background: #E5F1FF;
  66. padding-bottom: 18rpx;
  67. }
  68. .top-content .all{
  69. position: absolute;
  70. top: 0;
  71. right: 0;
  72. width: 64rpx;
  73. height: 100%;
  74. display: flex;
  75. justify-content: center;
  76. align-items: center;
  77. letter-spacing: 10rpx;
  78. background: linear-gradient( 180deg, rgba(219,230,244,0) 0%, #DDE9F7 11%, #E5F1FF 100%);
  79. box-shadow: -10rpx 0rpx 12rpx 2rpx rgba(0,0,0,0.07);
  80. writing-mode: vertical-rl;
  81. font-weight: bold;
  82. font-size: 24rpx;
  83. color: #222222;
  84. }
  85. .top-content .all .icon{
  86. width: 20rpx;
  87. height: 20rpx;
  88. margin-left: 2rpx;
  89. }
  90. .top-all-box {
  91. /* display: flex;
  92. flex-wrap: wrap;
  93. justify-content: space-between;
  94. align-items: flex-start; */
  95. display: grid;
  96. /* 列规则:5列等宽(1fr 代表"剩余空间等份分配") */
  97. grid-template-columns: repeat(5, 1fr);
  98. /* 行列间距:10rpx(小程序常用 rpx 适配多端) */
  99. gap: 16rpx;
  100. padding: 0 32rpx 150rpx;
  101. box-sizing: border-box;
  102. max-height: 750rpx;
  103. overflow-y: auto;
  104. overflow-x: hidden;
  105. }
  106. .top-box.top-all-box .type-item{
  107. margin-bottom: 24rpx;
  108. display: flex;
  109. flex-direction: column;
  110. align-items: center;
  111. }
  112. .top-box .type-item{
  113. display: inline-block;
  114. text-align: center;
  115. }
  116. .type-item .pic-box{
  117. position: relative;
  118. margin-left: 8rpx;
  119. width: 72rpx;
  120. height: 72rpx;
  121. border-radius: 16rpx;
  122. }
  123. .type-item .pic-box.active{
  124. width: 98rpx;
  125. height: 98rpx;
  126. border-radius: 32rpx;
  127. }
  128. .type-item .pic-box.active .sell-out-box{
  129. border-radius: 32rpx;
  130. }
  131. .sell-out-box{
  132. position: absolute;
  133. top: 0;
  134. left: 0;
  135. border-radius: 16rpx;
  136. width: 100%;
  137. height: 100%;
  138. background: rgba(0,0,0,0.6);
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. }
  143. .sell-out-text{
  144. text-align: center;
  145. font-size: 16rpx;
  146. color: #FFFFFF;
  147. }
  148. .top-box .type-item .icon{
  149. width: 72rpx;
  150. height: 72rpx;
  151. background: #F6F6F6;
  152. border-radius: 16rpx;
  153. }
  154. .top-box .type-item .name{
  155. font-size: 22rpx;
  156. color: #222222;
  157. width: 116rpx;
  158. height: 36rpx;
  159. line-height: 36rpx;
  160. text-align: center;
  161. margin-top: 12rpx;
  162. white-space: nowrap;
  163. text-overflow: ellipsis;
  164. overflow: hidden;
  165. }
  166. .top-box .type-item .icon.active{
  167. width: 88rpx;
  168. height: 88rpx;
  169. border-radius: 32rpx;
  170. border: 5rpx solid #006CE8;
  171. }
  172. .top-box .type-item .name.active{
  173. font-size: 24rpx;
  174. background: #006CE8;
  175. border-radius: 18rpx 18rpx 18rpx 18rpx;
  176. color: #FFFFFF;
  177. }
  178. .popup-box{
  179. position: relative;
  180. background: #E5F1FF;
  181. }
  182. .close-box{
  183. position: absolute;
  184. bottom: 0;
  185. left: 0;
  186. z-index: 999;
  187. font-size: 24rpx;
  188. color: #AAAAAA;
  189. width: 100%;
  190. text-align: center;
  191. line-height: 82rpx;
  192. border-top: 1rpx solid #F0F0F0;
  193. background: #E5F1FF;
  194. }
  195. .close-box .icon{
  196. width: 20rpx;
  197. height: 20rpx;
  198. transform: rotateZ(180deg);
  199. }
  200. /* 左侧菜单栏 */
  201. .leftmenu {
  202. width: 200rpx;
  203. height: 100%;
  204. box-sizing: border-box;
  205. background-color: #f5f6f7;
  206. overflow: scroll;
  207. z-index: 2;
  208. padding-bottom: 166rpx;
  209. }
  210. scroll-view ::-webkit-scrollbar {
  211. width: 0;
  212. height: 0;
  213. color: transparent;
  214. display: none;
  215. }
  216. .menu-item {
  217. line-height: 94rpx;
  218. height: 94rpx;
  219. text-align: center;
  220. border-bottom: 2rpx silid #e3e3e3;
  221. position: relative;
  222. color: #666;
  223. font-size: 24rpx;
  224. overflow: hidden;
  225. white-space: nowrap;
  226. text-overflow: ellipsis;
  227. display: flex;
  228. align-items: center;
  229. justify-content: center;
  230. }
  231. .menu-item .icon{
  232. width: 30rpx;
  233. height: 30rpx;
  234. margin-right: 8rpx;
  235. }
  236. .menu-item.active {
  237. color: #333;
  238. font-size: 28rpx;
  239. font-weight: bold;
  240. position: relative;
  241. background: #fff;
  242. }
  243. .menu-item.active:before {
  244. position: absolute;
  245. left: 0;
  246. content: "";
  247. width: 8rpx;
  248. height: 60rpx;
  249. top: 20rpx;
  250. background: #006CE8;
  251. }
  252. .menu-item text.tips-num {
  253. position: absolute;
  254. top: 20rpx;
  255. right: 15rpx;
  256. border-radius: 15rpx;
  257. width: 30rpx;
  258. height: 30rpx;
  259. background: red;
  260. color: #fff;
  261. font-size: 25rpx;
  262. line-height: 30rpx;
  263. }
  264. /* 右侧商品栏 */
  265. .loading{
  266. width: 550rpx;
  267. height: 70vh;
  268. display: flex;
  269. justify-content: center;
  270. align-items: center;
  271. flex-shrink: 0;
  272. position: fixed;
  273. z-index: 99999;
  274. background: #fff;
  275. }
  276. @keyframes rotato{
  277. from { transform: rotate(0deg); }
  278. to { transform: rotate(360deg); }
  279. }
  280. .loading .icon{
  281. animation: rotato .5s linear infinite;
  282. width: 48rpx;
  283. height: 48rpx;
  284. }
  285. .rightcontent {
  286. width: 550rpx;
  287. height: 100%;
  288. box-sizing: border-box;
  289. background-color: #fff;
  290. z-index: 1;
  291. position: relative;
  292. }
  293. .rightcontent .banner{
  294. width: 506rpx;
  295. height: 144rpx;
  296. margin-top: 20rpx;
  297. margin-left: 20rpx;
  298. }
  299. .rightcontent .right-top-box{
  300. position: fixed;
  301. z-index: 9999;
  302. background-color: #fff;
  303. }
  304. .rightcontent .filter-box{
  305. display: flex;
  306. justify-content: flex-end;
  307. width: 510rpx;
  308. background: #F6F6F6;
  309. padding: 8rpx 20rpx;
  310. box-sizing: border-box;
  311. margin-left: 20rpx;
  312. margin-top: 10rpx;
  313. border-radius: 16rpx 16rpx 16rpx 16rpx;
  314. }
  315. .rightcontent .filter-box .filter-item{
  316. font-size: 24rpx;
  317. color: #222222;
  318. margin-left: 40rpx;
  319. display: flex;
  320. align-items: center;
  321. }
  322. .rightcontent .filter-box .filter-item.active{
  323. color: #006CE8;
  324. }
  325. .rightcontent .filter-box .filter-item .icon{
  326. width: 20rpx;
  327. height: 20rpx;
  328. }
  329. .rightcontent .filter-box .filter-item .icon-box{
  330. display: flex;
  331. flex-direction: column;
  332. }
  333. .rightcontent .filter-box .filter-item .icon-box .down{
  334. transform: rotateZ(270deg);
  335. margin-bottom: -6rpx;
  336. }
  337. .rightcontent .filter-box .filter-item .icon-box .up{
  338. transform: rotateZ(90deg);
  339. margin-left: -4rpx;
  340. }
  341. .rightcontent .thrid-type-box{
  342. display: flex;
  343. flex-wrap: nowrap;
  344. padding: 10rpx 20rpx 10rpx 0;
  345. width: 530rpx;
  346. overflow: auto;
  347. margin-left: 20rpx;
  348. background: #fff;
  349. }
  350. .rightcontent .thrid-type-box .thrid-type-item{
  351. height: 36rpx;
  352. line-height: 36rpx;
  353. background: #F0F0F0;
  354. padding: 2rpx 16rpx;
  355. border-radius: 22rpx;
  356. font-size: 24rpx;
  357. color: #222222;
  358. flex-shrink: 0;
  359. margin-right: 20rpx;
  360. }
  361. .rightcontent .thrid-type-box .thrid-type-item.active{
  362. background: #006CE8;
  363. color: #FFFFFF;
  364. }
  365. .rightcontent .right-box{
  366. /* padding-bottom: 300rpx; */
  367. /* padding-bottom: 500rpx; */
  368. padding-top: 98rpx;
  369. position: relative;
  370. height: 100%;
  371. }
  372. .rightcontent .product-item{
  373. display: flex;
  374. padding: 0 20rpx;
  375. }
  376. .rightcontent .product-item .pic-box{
  377. position: relative;
  378. }
  379. .rightcontent .product-item .pic{
  380. width: 200rpx;
  381. height: 200rpx;
  382. background: #F6F6F6;
  383. border-radius: 16rpx;
  384. flex-shrink: 0;
  385. margin: 20rpx 0;
  386. }
  387. .rightcontent .product-item .sell-out{
  388. position: absolute;
  389. top: 0;
  390. left: 0;
  391. width: 200rpx;
  392. height: 240rpx;
  393. background: rgba(255,255,255,0.6);
  394. border-radius: 16rpx 16rpx 16rpx 16rpx;
  395. display: flex;
  396. justify-content: center;
  397. align-items: center;
  398. }
  399. .rightcontent .product-item .sell-out-text{
  400. width: 112rpx;
  401. height: 36rpx;
  402. line-height: 36rpx;
  403. text-align: center;
  404. background: rgba(0,0,0,0.6);
  405. border-radius: 18rpx 18rpx 18rpx 18rpx;
  406. font-size: 24rpx;
  407. color: #FFFFFF
  408. }
  409. .rightcontent .product-item .info{
  410. flex: 1;
  411. display: flex;
  412. flex-direction: column;
  413. justify-content: space-between;
  414. border-bottom: 1rpx solid #F0F0F0;
  415. padding: 20rpx 0 20rpx 20rpx;
  416. }
  417. .rightcontent .product-item .info .title{
  418. font-weight: bold;
  419. font-size: 28rpx;
  420. color: #222222;
  421. overflow: hidden;
  422. text-overflow: ellipsis;
  423. display: -webkit-box;
  424. -webkit-line-clamp: 2; /* 限制显示的行数 */
  425. -webkit-box-orient: vertical;
  426. }
  427. .rightcontent .product-item .info .price-box{
  428. display: flex;
  429. justify-content: space-between;
  430. align-items: center;
  431. }
  432. .rightcontent .product-item .info .price{
  433. font-weight: 800;
  434. font-size: 36rpx;
  435. color: #FF4D3A;
  436. }
  437. .rightcontent .product-item .info .salesVolume{
  438. font-size: 22rpx;
  439. color: #AAAAAA;
  440. }
  441. .rightcontent .adver-map {
  442. width: auto;
  443. box-sizing: border-box;
  444. overflow: hidden;
  445. position: relative;
  446. margin: 30rpx 20rpx 0;
  447. }
  448. .rightcontent .adver-map .item-a {
  449. display: block;
  450. font-size: 0;
  451. width: 100%;
  452. height: 160rpx;
  453. }
  454. .rightcontent .adver-map .item-a image {
  455. width: 100%;
  456. height: 100%;
  457. border-radius: 16rpx;
  458. }
  459. /* .rightcontent .sub-category {
  460. display: flex;
  461. flex-wrap: wrap;
  462. } */
  463. /* 二级分类 */
  464. .sub-category-con {
  465. margin: 20rpx;
  466. }
  467. .sub-cate-title {
  468. display: flex;
  469. align-items: center;
  470. font-weight: 800;
  471. }
  472. .view-all {
  473. color: #999;
  474. font-weight: normal;
  475. font-size: 24rpx;
  476. }
  477. .sub-cate-text {
  478. flex: 1;
  479. }
  480. .th-cate-con {
  481. display: flex;
  482. flex-wrap: wrap;
  483. }
  484. .sub-category-item {
  485. width: 33.33%;
  486. display: flex;
  487. flex-direction: column;
  488. padding: 30rpx;
  489. box-sizing: border-box;
  490. align-items: center;
  491. }
  492. .sub-category-item .sub-category-item-pic {
  493. width: 120rpx !important;
  494. height: 120rpx !important;
  495. border-radius: 16rpx;
  496. }
  497. .sub-category-item text {
  498. margin-top: 10rpx;
  499. font-size: 25rpx;
  500. }
  501. .not-category-data{
  502. padding: 20rpx;
  503. }
  504. .not-data-list{
  505. width: 100%;
  506. }
  507. .reset-localization{
  508. text-align: center;
  509. font-size: 26rpx;
  510. color: #AAAAAA;
  511. }
  512. /* 购物车 */
  513. .car-box{
  514. /* padding: 28rpx 24rpx 123rpx; */
  515. padding: 28rpx 24rpx 269rpx;
  516. max-height: 700rpx;
  517. overflow: auto;
  518. }
  519. .car-box .item{
  520. display: flex;
  521. align-items: center;
  522. padding-bottom: 30rpx;
  523. /* border-bottom: 2rpx solid #F0F0F0; */
  524. }
  525. .car-box .item .img{
  526. width: 200rpx;
  527. height: 200rpx;
  528. border-radius: 16rpx;
  529. background: chartreuse;
  530. }
  531. .car-box .item .info{
  532. flex: 1;
  533. padding-left: 20rpx;
  534. display: flex;
  535. flex-direction: column;
  536. justify-content: space-between;
  537. height: 200rpx;
  538. }
  539. .car-box .item .info .title{
  540. font-weight: 800;
  541. font-size: 32rpx;
  542. color: #222222;
  543. }
  544. .car-box .item .info .desc{
  545. font-size: 24rpx;
  546. color: #AAAAAA;
  547. }
  548. .car-box .item .info .price-box{
  549. display: flex;
  550. justify-content: space-between;
  551. align-items: center;
  552. }
  553. .car-box .item .info .price-box .price{
  554. display: flex;
  555. align-items: flex-end;
  556. color: #FF4D3A;
  557. }
  558. .car-box .item .info .price-box .price .unit{
  559. font-size: 20rpx;
  560. }
  561. .car-box .item .info .price-box .price .num{
  562. font-size: 48rpx;
  563. }
  564. /* .car-box .item .info .price-box .num-box{ */
  565. .num-box{
  566. display: flex;
  567. align-items: center;
  568. }
  569. /* .car-box .item .info .price-box .num-box .btn{ */
  570. .num-box .btn{
  571. font-size: 20rpx;
  572. width: 44rpx;
  573. height: 44rpx;
  574. text-align: center;
  575. }
  576. /* .car-box .item .info .price-box .num-box .num{ */
  577. .num-box .num{
  578. width: 80rpx;
  579. height: 44rpx;
  580. background: #FFFFFF;
  581. text-align: center;
  582. line-height: 40rpx;
  583. font-size: 24rpx ;
  584. color: #222222;
  585. border-bottom: 2rpx solid #F0F0F0;
  586. border-top: 2rpx solid #F0F0F0;
  587. box-sizing: border-box;
  588. }
  589. .bottom-box{
  590. position: fixed;
  591. /* bottom: 0; */
  592. bottom: 166rpx;
  593. left: 0;
  594. z-index: 999999;
  595. box-sizing: border-box;
  596. width: 100%;
  597. height: 120rpx;
  598. display: flex;
  599. justify-content: space-between;
  600. align-items: center;
  601. background: #FFFFFF;
  602. box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.05);
  603. border-radius: 32rpx 32rpx 0rpx 0rpx;
  604. }
  605. .bottom-box .num{
  606. position: absolute;
  607. top: 20rpx;
  608. left: 80rpx;
  609. border-radius: 30rpx;
  610. font-size: 24rpx;
  611. color: #fff;
  612. background: #FF4D3A;
  613. padding: 2rpx 6rpx;
  614. }
  615. .bottom-box .left{
  616. display: flex;
  617. align-items: center;
  618. justify-content: space-between;
  619. flex: 1;
  620. }
  621. .bottom-box .icon{
  622. width: 100rpx;
  623. height: 100rpx;
  624. margin-left: 20rpx;
  625. }
  626. .bottom-box .price-box{
  627. display: flex;
  628. align-items: center;
  629. margin-right: 40rpx;
  630. }
  631. .bottom-box .price-box .label{
  632. font-weight: bold;
  633. font-size: 22rpx;
  634. color: #222222;
  635. }
  636. .bottom-box .price-box .top{
  637. display: flex;
  638. align-items: center;
  639. }
  640. .bottom-box .price-box .top .price{
  641. font-size: 30rpx;
  642. color: #FF4D3A;
  643. }
  644. .bottom-box .price-box .top .reduce-price{
  645. font-size: 24rpx;
  646. color: #AAAAAA
  647. }
  648. .bottom-box .price-box .shipping-fee{
  649. font-size: 24rpx;
  650. color: #AAAAAA;
  651. }
  652. .bottom-box .btn{
  653. height: 80rpx;
  654. line-height: 80rpx;
  655. width: 160rpx;
  656. text-align: center;
  657. background: #006CE8;
  658. color: #fff;
  659. border-radius: 40rpx;
  660. margin-right: 20rpx;
  661. font-size: 28rpx;
  662. }
  663. /* 购物车为空 */
  664. .empty {
  665. margin-top: 100rpx;
  666. text-align: cneter;
  667. }
  668. .empty-icon {
  669. display: block;
  670. width: 110rpx;
  671. height: 110rpx;
  672. margin: 0 auto;
  673. margin-bottom: 20rpx;
  674. }
  675. .empty-icon > image {
  676. width: 100%;
  677. height: 100%;
  678. }
  679. .empty-text {
  680. font-size: 24rpx;
  681. color: #222222;
  682. line-height: 2em;
  683. text-align: center;
  684. }
  685. /* 纵向滚动容器:隐藏垂直滚动条 */
  686. .thrid-type-box::-webkit-scrollbar {
  687. width: 0; /* 滚动条宽度设为0(关键) */
  688. height: 0; /* 横向滚动时设置高度为0 */
  689. display: none; /* 直接隐藏 */
  690. }
  691. /* 可选:针对滚动轨道和滑块的进一步隐藏 */
  692. .thrid-type-box::-webkit-scrollbar-track {
  693. display: none;
  694. }
  695. .thrid-type-box::-webkit-scrollbar-thumb {
  696. display: none;
  697. }
  698. .none .van-empty__description{
  699. margin-top: -30rpx;
  700. }
  701. /* 动画容器:全屏覆盖,不影响下层交互 */
  702. .animation-wrap {
  703. position: fixed;
  704. top: 0;
  705. left: 0;
  706. width: 100vw;
  707. height: 100vh;
  708. pointer-events: none;
  709. z-index: 9999;
  710. }
  711. /* 抛物线小图标样式 */
  712. .move-x {
  713. animation:
  714. moveX .5s linear forwards; /* X轴匀速 */
  715. }
  716. .move-y{
  717. animation: moveY .5s cubic-bezier(0.5, -0.5, 1, 1) forwards;
  718. }
  719. /* 核心抛物线动画:贝塞尔曲线轨迹 */
  720. @keyframes moveX {
  721. from {
  722. transform: translateX(0);
  723. }
  724. to {
  725. transform: translateX(var(--endX));
  726. }
  727. }
  728. /* 核心抛物线动画:贝塞尔曲线轨迹 */
  729. @keyframes moveY {
  730. from {
  731. transform: translateY(0);
  732. }
  733. to {
  734. transform: translateY(var(--endY));
  735. }
  736. }
  737. /* 购物车缩放动画 */
  738. .cart-pulse {
  739. animation: pulse 0.3s ease-in-out;
  740. }
  741. @keyframes pulse {
  742. 0% { transform: scale(1); }
  743. 50% { transform: scale(1.3); }
  744. 100% { transform: scale(1); }
  745. }