index.wxss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /**
  2. * 这里是uni-app内置的常用样式变量
  3. *
  4. * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
  5. * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
  6. *
  7. */
  8. /**
  9. * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
  10. *
  11. * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  12. */
  13. /* 颜色变量 */
  14. /* 行为相关颜色 */
  15. /* 文字基本颜色 */
  16. /* 背景颜色 */
  17. /* 边框颜色 */
  18. /* 尺寸变量 */
  19. /* 文字尺寸 */
  20. /* 图片尺寸 */
  21. /* Border Radius */
  22. /* 水平间距 */
  23. /* 垂直间距 */
  24. /* 透明度 */
  25. /* 文章场景相关 */
  26. .container {
  27. min-height: 100vh;
  28. background: linear-gradient(180deg, #eaf6ff 0%, #f7f8fa 100%);
  29. padding-bottom: 120rpx;
  30. }
  31. .spacer {
  32. height: 60rpx;
  33. padding-top: 40px;
  34. }
  35. .search-bar {
  36. display: flex;
  37. align-items: center;
  38. background: #fff;
  39. border-radius: 40rpx;
  40. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  41. padding: 0 32rpx;
  42. margin: 0 auto 24rpx auto;
  43. width: 80vw;
  44. max-width: 600rpx;
  45. height: 80rpx;
  46. }
  47. input {
  48. flex: 1;
  49. border: none;
  50. background: transparent;
  51. font-size: 30rpx;
  52. height: 80rpx;
  53. }
  54. .iconfont {
  55. color: #bbb;
  56. font-size: 36rpx;
  57. margin-left: 10rpx;
  58. }
  59. .category-tabs {
  60. display: flex;
  61. margin: 20rpx 0 0 0;
  62. background: #fff;
  63. border-radius: 20rpx;
  64. overflow-x: auto;
  65. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  66. }
  67. .tab {
  68. flex: 1;
  69. text-align: center;
  70. padding: 20rpx 0;
  71. font-size: 30rpx;
  72. color: #666;
  73. position: relative;
  74. white-space: nowrap;
  75. }
  76. .tab.active {
  77. color: #3498db;
  78. font-weight: bold;
  79. }
  80. .tab.active::after {
  81. content: "";
  82. position: absolute;
  83. left: 50%;
  84. bottom: 0;
  85. transform: translateX(-50%);
  86. width: 40rpx;
  87. height: 6rpx;
  88. background: #3498db;
  89. border-radius: 3rpx;
  90. }
  91. .course-grid {
  92. display: grid;
  93. grid-template-columns: repeat(2, 1fr);
  94. gap: 32rpx;
  95. padding: 32rpx 24rpx 0 24rpx;
  96. }
  97. .card {
  98. background: #fff;
  99. border-radius: 20rpx;
  100. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
  101. overflow: hidden;
  102. transition: transform 0.2s;
  103. display: flex;
  104. flex-direction: column;
  105. min-height: 380rpx;
  106. }
  107. .card:active {
  108. transform: scale(0.98);
  109. }
  110. .cover {
  111. width: 100%;
  112. height: 140rpx;
  113. background-color: #f5f5f5;
  114. border-radius: 20rpx 20rpx 0 0;
  115. }
  116. .content {
  117. flex: 1;
  118. display: flex;
  119. flex-direction: column;
  120. justify-content: space-between;
  121. padding: 20rpx 16rpx 16rpx 16rpx;
  122. }
  123. .title {
  124. font-size: 28rpx;
  125. font-weight: 600;
  126. margin-bottom: 8rpx;
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. white-space: nowrap;
  130. }
  131. .desc {
  132. font-size: 24rpx;
  133. color: #888;
  134. margin-bottom: 12rpx;
  135. display: -webkit-box;
  136. -webkit-line-clamp: 2;
  137. -webkit-box-orient: vertical;
  138. overflow: hidden;
  139. }
  140. .price-row {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. }
  145. .price {
  146. color: #e74c3c;
  147. font-size: 28rpx;
  148. font-weight: bold;
  149. }
  150. .sales {
  151. font-size: 24rpx;
  152. color: #999;
  153. }
  154. .loading-container,
  155. .error-container {
  156. display: flex;
  157. flex-direction: column;
  158. align-items: center;
  159. justify-content: center;
  160. padding: 40rpx;
  161. }
  162. .error-text {
  163. color: #e74c3c;
  164. font-size: 28rpx;
  165. margin-bottom: 20rpx;
  166. }
  167. .retry-btn {
  168. background: #3498db;
  169. color: #fff;
  170. padding: 16rpx 32rpx;
  171. border-radius: 30rpx;
  172. font-size: 28rpx;
  173. }