category.wxss 12 KB

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