category.wxss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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. }
  174. scroll-view ::-webkit-scrollbar {
  175. width: 0;
  176. height: 0;
  177. color: transparent;
  178. display: none;
  179. }
  180. .menu-item {
  181. line-height: 94rpx;
  182. height: 94rpx;
  183. text-align: center;
  184. border-bottom: 2rpx silid #e3e3e3;
  185. position: relative;
  186. color: #666;
  187. font-size: 24rpx;
  188. overflow: hidden;
  189. white-space: nowrap;
  190. text-overflow: ellipsis;
  191. display: flex;
  192. align-items: center;
  193. justify-content: center;
  194. }
  195. .menu-item .icon{
  196. width: 30rpx;
  197. height: 30rpx;
  198. margin-right: 8rpx;
  199. }
  200. .menu-item.active {
  201. color: #333;
  202. font-size: 28rpx;
  203. font-weight: bold;
  204. position: relative;
  205. background: #fff;
  206. }
  207. .menu-item.active:before {
  208. position: absolute;
  209. left: 0;
  210. content: "";
  211. width: 8rpx;
  212. height: 60rpx;
  213. top: 20rpx;
  214. background: #006CE8;
  215. }
  216. .menu-item text.tips-num {
  217. position: absolute;
  218. top: 20rpx;
  219. right: 15rpx;
  220. border-radius: 15rpx;
  221. width: 30rpx;
  222. height: 30rpx;
  223. background: red;
  224. color: #fff;
  225. font-size: 25rpx;
  226. line-height: 30rpx;
  227. }
  228. /* 右侧商品栏 */
  229. .loading{
  230. width: 550rpx;
  231. height: 70vh;
  232. display: flex;
  233. justify-content: center;
  234. align-items: center;
  235. flex-shrink: 0;
  236. position: fixed;
  237. z-index: 99999;
  238. background: #fff;
  239. }
  240. @keyframes rotato{
  241. from { transform: rotate(0deg); }
  242. to { transform: rotate(360deg); }
  243. }
  244. .loading .icon{
  245. animation: rotato .5s linear infinite;
  246. width: 48rpx;
  247. height: 48rpx;
  248. }
  249. .rightcontent {
  250. width: 550rpx;
  251. height: 100%;
  252. box-sizing: border-box;
  253. background-color: #fff;
  254. z-index: 1;
  255. position: relative;
  256. }
  257. .rightcontent .banner{
  258. width: 506rpx;
  259. height: 144rpx;
  260. margin-top: 20rpx;
  261. margin-left: 20rpx;
  262. }
  263. .rightcontent .right-top-box{
  264. position: fixed;
  265. z-index: 9999;
  266. background-color: #fff;
  267. }
  268. .rightcontent .filter-box{
  269. display: flex;
  270. justify-content: flex-end;
  271. width: 510rpx;
  272. background: #F6F6F6;
  273. padding: 8rpx 20rpx;
  274. box-sizing: border-box;
  275. margin-left: 20rpx;
  276. margin-top: 10rpx;
  277. border-radius: 16rpx 16rpx 16rpx 16rpx;
  278. }
  279. .rightcontent .filter-box .filter-item{
  280. font-size: 24rpx;
  281. color: #222222;
  282. margin-left: 40rpx;
  283. display: flex;
  284. align-items: center;
  285. }
  286. .rightcontent .filter-box .filter-item.active{
  287. color: #006CE8;
  288. }
  289. .rightcontent .filter-box .filter-item .icon{
  290. width: 20rpx;
  291. height: 20rpx;
  292. }
  293. .rightcontent .filter-box .filter-item .icon-box{
  294. display: flex;
  295. flex-direction: column;
  296. }
  297. .rightcontent .filter-box .filter-item .icon-box .down{
  298. transform: rotateZ(270deg);
  299. margin-bottom: -6rpx;
  300. }
  301. .rightcontent .filter-box .filter-item .icon-box .up{
  302. transform: rotateZ(90deg);
  303. margin-left: -4rpx;
  304. }
  305. .rightcontent .thrid-type-box{
  306. display: flex;
  307. flex-wrap: nowrap;
  308. padding: 10rpx 20rpx 10rpx 0;
  309. width: 530rpx;
  310. overflow: auto;
  311. margin-left: 20rpx;
  312. background: #fff;
  313. }
  314. .rightcontent .thrid-type-box .thrid-type-item{
  315. height: 36rpx;
  316. line-height: 36rpx;
  317. background: #F0F0F0;
  318. padding: 2rpx 16rpx;
  319. border-radius: 22rpx;
  320. font-size: 24rpx;
  321. color: #222222;
  322. flex-shrink: 0;
  323. margin-right: 20rpx;
  324. }
  325. .rightcontent .thrid-type-box .thrid-type-item.active{
  326. background: #006CE8;
  327. color: #FFFFFF;
  328. }
  329. .rightcontent .right-box{
  330. /* padding-bottom: 300rpx; */
  331. /* padding-bottom: 500rpx; */
  332. padding-top: 98rpx;
  333. position: relative;
  334. }
  335. .rightcontent .product-item{
  336. display: flex;
  337. padding: 0 20rpx;
  338. }
  339. .rightcontent .product-item .pic{
  340. width: 200rpx;
  341. height: 200rpx;
  342. background: #F6F6F6;
  343. border-radius: 16rpx;
  344. flex-shrink: 0;
  345. margin: 20rpx 0;
  346. }
  347. .rightcontent .product-item .info{
  348. flex: 1;
  349. display: flex;
  350. flex-direction: column;
  351. justify-content: space-between;
  352. border-bottom: 1rpx solid #F0F0F0;
  353. padding: 20rpx 0 20rpx 20rpx;
  354. }
  355. .rightcontent .product-item .info .title{
  356. font-weight: bold;
  357. font-size: 28rpx;
  358. color: #222222;
  359. overflow: hidden;
  360. text-overflow: ellipsis;
  361. display: -webkit-box;
  362. -webkit-line-clamp: 2; /* 限制显示的行数 */
  363. -webkit-box-orient: vertical;
  364. }
  365. .rightcontent .product-item .info .price-box{
  366. display: flex;
  367. justify-content: space-between;
  368. align-items: center;
  369. }
  370. .rightcontent .product-item .info .price{
  371. font-weight: 800;
  372. font-size: 36rpx;
  373. color: #FF4D3A;
  374. }
  375. .rightcontent .product-item .info .salesVolume{
  376. font-size: 22rpx;
  377. color: #AAAAAA;
  378. }
  379. .rightcontent .adver-map {
  380. width: auto;
  381. box-sizing: border-box;
  382. overflow: hidden;
  383. position: relative;
  384. margin: 30rpx 20rpx 0;
  385. }
  386. .rightcontent .adver-map .item-a {
  387. display: block;
  388. font-size: 0;
  389. width: 100%;
  390. height: 160rpx;
  391. }
  392. .rightcontent .adver-map .item-a image {
  393. width: 100%;
  394. height: 100%;
  395. border-radius: 16rpx;
  396. }
  397. /* .rightcontent .sub-category {
  398. display: flex;
  399. flex-wrap: wrap;
  400. } */
  401. /* 二级分类 */
  402. .sub-category-con {
  403. margin: 20rpx;
  404. }
  405. .sub-cate-title {
  406. display: flex;
  407. align-items: center;
  408. font-weight: 800;
  409. }
  410. .view-all {
  411. color: #999;
  412. font-weight: normal;
  413. font-size: 24rpx;
  414. }
  415. .sub-cate-text {
  416. flex: 1;
  417. }
  418. .th-cate-con {
  419. display: flex;
  420. flex-wrap: wrap;
  421. }
  422. .sub-category-item {
  423. width: 33.33%;
  424. display: flex;
  425. flex-direction: column;
  426. padding: 30rpx;
  427. box-sizing: border-box;
  428. align-items: center;
  429. }
  430. .sub-category-item .sub-category-item-pic {
  431. width: 120rpx !important;
  432. height: 120rpx !important;
  433. border-radius: 16rpx;
  434. }
  435. .sub-category-item text {
  436. margin-top: 10rpx;
  437. font-size: 25rpx;
  438. }
  439. .not-category-data{
  440. padding: 20rpx;
  441. }
  442. .not-data-list{
  443. width: 100%;
  444. }
  445. .reset-localization{
  446. text-align: center;
  447. font-size: 26rpx;
  448. color: #AAAAAA;
  449. }
  450. /* 购物车 */
  451. .car-box{
  452. /* padding: 28rpx 24rpx 123rpx; */
  453. padding: 28rpx 24rpx 269rpx;
  454. max-height: 700rpx;
  455. overflow: auto;
  456. }
  457. .car-box .item{
  458. display: flex;
  459. align-items: center;
  460. padding-bottom: 30rpx;
  461. /* border-bottom: 2rpx solid #F0F0F0; */
  462. }
  463. .car-box .item .img{
  464. width: 200rpx;
  465. height: 200rpx;
  466. border-radius: 16rpx;
  467. background: chartreuse;
  468. }
  469. .car-box .item .info{
  470. flex: 1;
  471. padding-left: 20rpx;
  472. display: flex;
  473. flex-direction: column;
  474. justify-content: space-between;
  475. height: 200rpx;
  476. }
  477. .car-box .item .info .title{
  478. font-weight: 800;
  479. font-size: 32rpx;
  480. color: #222222;
  481. }
  482. .car-box .item .info .desc{
  483. font-size: 24rpx;
  484. color: #AAAAAA;
  485. }
  486. .car-box .item .info .price-box{
  487. display: flex;
  488. justify-content: space-between;
  489. align-items: center;
  490. }
  491. .car-box .item .info .price-box .price{
  492. display: flex;
  493. align-items: flex-end;
  494. color: #FF4D3A;
  495. }
  496. .car-box .item .info .price-box .price .unit{
  497. font-size: 20rpx;
  498. }
  499. .car-box .item .info .price-box .price .num{
  500. font-size: 48rpx;
  501. }
  502. /* .car-box .item .info .price-box .num-box{ */
  503. .num-box{
  504. display: flex;
  505. align-items: center;
  506. }
  507. /* .car-box .item .info .price-box .num-box .btn{ */
  508. .num-box .btn{
  509. font-size: 20rpx;
  510. width: 44rpx;
  511. height: 44rpx;
  512. text-align: center;
  513. }
  514. /* .car-box .item .info .price-box .num-box .num{ */
  515. .num-box .num{
  516. width: 80rpx;
  517. height: 44rpx;
  518. background: #FFFFFF;
  519. text-align: center;
  520. line-height: 40rpx;
  521. font-size: 24rpx ;
  522. color: #222222;
  523. border-bottom: 2rpx solid #F0F0F0;
  524. border-top: 2rpx solid #F0F0F0;
  525. box-sizing: border-box;
  526. }
  527. .bottom-box{
  528. position: fixed;
  529. /* bottom: 0; */
  530. bottom: 166rpx;
  531. left: 0;
  532. z-index: 999999;
  533. box-sizing: border-box;
  534. width: 100%;
  535. display: flex;
  536. justify-content: space-between;
  537. padding: 20rpx 24rpx;
  538. background: #FFFFFF;
  539. box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.05);
  540. border-radius: 32rpx 32rpx 0rpx 0rpx;
  541. }
  542. .bottom-box .num{
  543. position: absolute;
  544. top: 20rpx;
  545. left: 80rpx;
  546. border-radius: 30rpx;
  547. font-size: 24rpx;
  548. color: #fff;
  549. background: #FF4D3A;
  550. padding: 2rpx 6rpx;
  551. }
  552. .bottom-box .left{
  553. display: flex;
  554. }
  555. .bottom-box .icon{
  556. width: 80rpx;
  557. height: 80rpx;
  558. margin-right: 20rpx;
  559. }
  560. .bottom-box .price-box .top{
  561. display: flex;
  562. align-items: center;
  563. }
  564. .bottom-box .price-box .top .price{
  565. font-weight: 800;
  566. font-size: 32rpx;
  567. color: #FF4D3A;
  568. }
  569. .bottom-box .price-box .top .reduce-price{
  570. font-size: 24rpx;
  571. color: #AAAAAA
  572. }
  573. .bottom-box .price-box .shipping-fee{
  574. font-size: 24rpx;
  575. color: #AAAAAA;
  576. }
  577. .bottom-box .btn{
  578. width: 342rpx;
  579. height: 80rpx;
  580. background: #006CE8;
  581. border-radius: 40rpx;
  582. text-align: center;
  583. line-height: 80rpx;
  584. font-weight: bold;
  585. font-size: 28rpx;
  586. color: #FFFFFF;
  587. }
  588. /* 购物车为空 */
  589. .empty {
  590. margin-top: 100rpx;
  591. text-align: cneter;
  592. }
  593. .empty-icon {
  594. display: block;
  595. width: 100rpx;
  596. height: 100rpx;
  597. margin: 0 auto;
  598. margin-bottom: 20rpx;
  599. }
  600. .empty-icon > image {
  601. width: 100%;
  602. height: 100%;
  603. }
  604. .empty-text {
  605. font-size: 28rpx;
  606. text-align: center;
  607. color: #999;
  608. line-height: 2em;
  609. }
  610. /* 纵向滚动容器:隐藏垂直滚动条 */
  611. .thrid-type-box::-webkit-scrollbar {
  612. width: 0; /* 滚动条宽度设为0(关键) */
  613. height: 0; /* 横向滚动时设置高度为0 */
  614. display: none; /* 直接隐藏 */
  615. }
  616. /* 可选:针对滚动轨道和滑块的进一步隐藏 */
  617. .thrid-type-box::-webkit-scrollbar-track {
  618. display: none;
  619. }
  620. .thrid-type-box::-webkit-scrollbar-thumb {
  621. display: none;
  622. }