index.css 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /* 商品分类页面样式 */
  2. .category-page {
  3. height: 100vh;
  4. background-color: #f5f5f5;
  5. }
  6. .category-container {
  7. display: flex;
  8. height: 100%;
  9. }
  10. /* 左侧边栏容器 */
  11. .category-sidebar-container {
  12. width: 176rpx;
  13. height: 100%;
  14. background-color: #f5f5f5;
  15. }
  16. /* 右侧内容区 */
  17. .category-content {
  18. flex: 1;
  19. background-color: white;
  20. position: relative;
  21. padding: 20rpx;
  22. }
  23. /* 二级分类标签栏 */
  24. .sub-category-tabbar {
  25. margin-bottom: 20rpx;
  26. }
  27. /* 二级分类网格布局 */
  28. .sub-category-grid {
  29. display: grid;
  30. grid-template-columns: 33.33% 33.33% 33.33%;
  31. gap: 20rpx;
  32. }
  33. .sub-category-item {
  34. display: flex;
  35. flex-direction: column;
  36. align-items: center;
  37. padding: 20rpx;
  38. border-radius: 16rpx;
  39. background-color: #f8f8f8;
  40. transition: all 0.3s ease;
  41. }
  42. .sub-category-item:active {
  43. background-color: #e8e8e8;
  44. transform: scale(0.95);
  45. }
  46. .sub-category-image-container {
  47. width: 144rpx;
  48. height: 144rpx;
  49. margin-bottom: 16rpx;
  50. }
  51. .sub-category-image {
  52. width: 100%;
  53. height: 100%;
  54. border-radius: 16rpx;
  55. overflow: hidden;
  56. background-color: #e0e0e0;
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. }
  61. .image-placeholder {
  62. width: 100%;
  63. height: 100%;
  64. display: flex;
  65. align-items: center;
  66. justify-content: center;
  67. }
  68. .image-fallback {
  69. width: 80rpx;
  70. height: 80rpx;
  71. border-radius: 50%;
  72. background-color: #0071ce;
  73. color: white;
  74. display: flex;
  75. align-items: center;
  76. justify-content: center;
  77. font-size: 32rpx;
  78. font-weight: bold;
  79. }
  80. .sub-category-name {
  81. font-size: 26rpx;
  82. color: #333;
  83. text-align: center;
  84. line-height: 1.4;
  85. max-width: 100%;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. }
  90. /* 广告图容器 */
  91. .advertisement-container {
  92. position: fixed;
  93. bottom: 13%;
  94. right: 3%;
  95. z-index: 100;
  96. }
  97. .advertisement-image {
  98. width: 200rpx;
  99. height: 200rpx;
  100. border-radius: 16rpx;
  101. overflow: hidden;
  102. background-color: #fa4126;
  103. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
  104. }
  105. .ad-image-placeholder {
  106. width: 100%;
  107. height: 100%;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. color: white;
  112. font-size: 24rpx;
  113. }
  114. /* 加载和错误状态 */
  115. .loading, .error {
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. height: 200rpx;
  120. font-size: 28rpx;
  121. color: #666;
  122. }
  123. .error {
  124. color: #fa4126;
  125. }
  126. /* 响应式适配 */
  127. @media (max-width: 750rpx) {
  128. .category-sidebar-container {
  129. width: 160rpx;
  130. }
  131. .sub-category-grid {
  132. grid-template-columns: 50% 50%;
  133. gap: 16rpx;
  134. }
  135. .sub-category-image-container {
  136. width: 120rpx;
  137. height: 120rpx;
  138. }
  139. }