category.wxss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  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. }
  336. .rightcontent .product-item{
  337. display: flex;
  338. padding: 0 20rpx;
  339. }
  340. .rightcontent .product-item .pic{
  341. width: 200rpx;
  342. height: 200rpx;
  343. background: #F6F6F6;
  344. border-radius: 16rpx;
  345. flex-shrink: 0;
  346. margin: 20rpx 0;
  347. }
  348. .rightcontent .product-item .info{
  349. flex: 1;
  350. display: flex;
  351. flex-direction: column;
  352. justify-content: space-between;
  353. border-bottom: 1rpx solid #F0F0F0;
  354. padding: 20rpx 0 20rpx 20rpx;
  355. }
  356. .rightcontent .product-item .info .title{
  357. font-weight: bold;
  358. font-size: 28rpx;
  359. color: #222222;
  360. overflow: hidden;
  361. text-overflow: ellipsis;
  362. display: -webkit-box;
  363. -webkit-line-clamp: 2; /* 限制显示的行数 */
  364. -webkit-box-orient: vertical;
  365. }
  366. .rightcontent .product-item .info .price-box{
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. }
  371. .rightcontent .product-item .info .price{
  372. font-weight: 800;
  373. font-size: 36rpx;
  374. color: #FF4D3A;
  375. }
  376. .rightcontent .product-item .info .salesVolume{
  377. font-size: 22rpx;
  378. color: #AAAAAA;
  379. }
  380. .rightcontent .adver-map {
  381. width: auto;
  382. box-sizing: border-box;
  383. overflow: hidden;
  384. position: relative;
  385. margin: 30rpx 20rpx 0;
  386. }
  387. .rightcontent .adver-map .item-a {
  388. display: block;
  389. font-size: 0;
  390. width: 100%;
  391. height: 160rpx;
  392. }
  393. .rightcontent .adver-map .item-a image {
  394. width: 100%;
  395. height: 100%;
  396. border-radius: 16rpx;
  397. }
  398. /* .rightcontent .sub-category {
  399. display: flex;
  400. flex-wrap: wrap;
  401. } */
  402. /* 二级分类 */
  403. .sub-category-con {
  404. margin: 20rpx;
  405. }
  406. .sub-cate-title {
  407. display: flex;
  408. align-items: center;
  409. font-weight: 800;
  410. }
  411. .view-all {
  412. color: #999;
  413. font-weight: normal;
  414. font-size: 24rpx;
  415. }
  416. .sub-cate-text {
  417. flex: 1;
  418. }
  419. .th-cate-con {
  420. display: flex;
  421. flex-wrap: wrap;
  422. }
  423. .sub-category-item {
  424. width: 33.33%;
  425. display: flex;
  426. flex-direction: column;
  427. padding: 30rpx;
  428. box-sizing: border-box;
  429. align-items: center;
  430. }
  431. .sub-category-item .sub-category-item-pic {
  432. width: 120rpx !important;
  433. height: 120rpx !important;
  434. border-radius: 16rpx;
  435. }
  436. .sub-category-item text {
  437. margin-top: 10rpx;
  438. font-size: 25rpx;
  439. }
  440. .not-category-data{
  441. padding: 20rpx;
  442. }
  443. .not-data-list{
  444. width: 100%;
  445. }
  446. .reset-localization{
  447. text-align: center;
  448. font-size: 26rpx;
  449. color: #AAAAAA;
  450. }
  451. /* 购物车 */
  452. .car-box{
  453. /* padding: 28rpx 24rpx 123rpx; */
  454. padding: 28rpx 24rpx 269rpx;
  455. max-height: 700rpx;
  456. overflow: auto;
  457. }
  458. .car-box .item{
  459. display: flex;
  460. align-items: center;
  461. padding-bottom: 30rpx;
  462. /* border-bottom: 2rpx solid #F0F0F0; */
  463. }
  464. .car-box .item .img{
  465. width: 200rpx;
  466. height: 200rpx;
  467. border-radius: 16rpx;
  468. background: chartreuse;
  469. }
  470. .car-box .item .info{
  471. flex: 1;
  472. padding-left: 20rpx;
  473. display: flex;
  474. flex-direction: column;
  475. justify-content: space-between;
  476. height: 200rpx;
  477. }
  478. .car-box .item .info .title{
  479. font-weight: 800;
  480. font-size: 32rpx;
  481. color: #222222;
  482. }
  483. .car-box .item .info .desc{
  484. font-size: 24rpx;
  485. color: #AAAAAA;
  486. }
  487. .car-box .item .info .price-box{
  488. display: flex;
  489. justify-content: space-between;
  490. align-items: center;
  491. }
  492. .car-box .item .info .price-box .price{
  493. display: flex;
  494. align-items: flex-end;
  495. color: #FF4D3A;
  496. }
  497. .car-box .item .info .price-box .price .unit{
  498. font-size: 20rpx;
  499. }
  500. .car-box .item .info .price-box .price .num{
  501. font-size: 48rpx;
  502. }
  503. /* .car-box .item .info .price-box .num-box{ */
  504. .num-box{
  505. display: flex;
  506. align-items: center;
  507. }
  508. /* .car-box .item .info .price-box .num-box .btn{ */
  509. .num-box .btn{
  510. font-size: 20rpx;
  511. width: 44rpx;
  512. height: 44rpx;
  513. text-align: center;
  514. }
  515. /* .car-box .item .info .price-box .num-box .num{ */
  516. .num-box .num{
  517. width: 80rpx;
  518. height: 44rpx;
  519. background: #FFFFFF;
  520. text-align: center;
  521. line-height: 40rpx;
  522. font-size: 24rpx ;
  523. color: #222222;
  524. border-bottom: 2rpx solid #F0F0F0;
  525. border-top: 2rpx solid #F0F0F0;
  526. box-sizing: border-box;
  527. }
  528. .bottom-box{
  529. position: fixed;
  530. /* bottom: 0; */
  531. bottom: 166rpx;
  532. left: 0;
  533. z-index: 999999;
  534. box-sizing: border-box;
  535. width: 100%;
  536. display: flex;
  537. justify-content: space-between;
  538. padding: 20rpx 24rpx;
  539. background: #FFFFFF;
  540. box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.05);
  541. border-radius: 32rpx 32rpx 0rpx 0rpx;
  542. }
  543. .bottom-box .num{
  544. position: absolute;
  545. top: 20rpx;
  546. left: 80rpx;
  547. border-radius: 30rpx;
  548. font-size: 24rpx;
  549. color: #fff;
  550. background: #FF4D3A;
  551. padding: 2rpx 6rpx;
  552. }
  553. .bottom-box .left{
  554. display: flex;
  555. }
  556. .bottom-box .icon{
  557. width: 80rpx;
  558. height: 80rpx;
  559. margin-right: 20rpx;
  560. }
  561. .bottom-box .price-box .top{
  562. display: flex;
  563. align-items: center;
  564. }
  565. .bottom-box .price-box .top .price{
  566. font-weight: 800;
  567. font-size: 32rpx;
  568. color: #FF4D3A;
  569. }
  570. .bottom-box .price-box .top .reduce-price{
  571. font-size: 24rpx;
  572. color: #AAAAAA
  573. }
  574. .bottom-box .price-box .shipping-fee{
  575. font-size: 24rpx;
  576. color: #AAAAAA;
  577. }
  578. .bottom-box .btn{
  579. width: 342rpx;
  580. height: 80rpx;
  581. background: #006CE8;
  582. border-radius: 40rpx;
  583. text-align: center;
  584. line-height: 80rpx;
  585. font-weight: bold;
  586. font-size: 28rpx;
  587. color: #FFFFFF;
  588. }
  589. /* 购物车为空 */
  590. .empty {
  591. margin-top: 100rpx;
  592. text-align: cneter;
  593. }
  594. .empty-icon {
  595. display: block;
  596. width: 100rpx;
  597. height: 100rpx;
  598. margin: 0 auto;
  599. margin-bottom: 20rpx;
  600. }
  601. .empty-icon > image {
  602. width: 100%;
  603. height: 100%;
  604. }
  605. .empty-text {
  606. font-size: 28rpx;
  607. text-align: center;
  608. color: #999;
  609. line-height: 2em;
  610. }
  611. /* 纵向滚动容器:隐藏垂直滚动条 */
  612. .thrid-type-box::-webkit-scrollbar {
  613. width: 0; /* 滚动条宽度设为0(关键) */
  614. height: 0; /* 横向滚动时设置高度为0 */
  615. display: none; /* 直接隐藏 */
  616. }
  617. /* 可选:针对滚动轨道和滑块的进一步隐藏 */
  618. .thrid-type-box::-webkit-scrollbar-track {
  619. display: none;
  620. }
  621. .thrid-type-box::-webkit-scrollbar-thumb {
  622. display: none;
  623. }