index.css 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* ===== 商品卡片组件样式 ===== */
  2. .goods-card {
  3. box-sizing: border-box;
  4. font-size: 24rpx;
  5. border-radius: 0 0 16rpx 16rpx;
  6. border-bottom: none;
  7. }
  8. .goods-card__main {
  9. position: relative;
  10. display: flex;
  11. line-height: 1;
  12. padding: 0;
  13. background: transparent;
  14. width: 342rpx;
  15. border-radius: 0 0 16rpx 16rpx;
  16. align-items: center;
  17. justify-content: center;
  18. margin-bottom: 16rpx;
  19. flex-direction: column;
  20. }
  21. .goods-card__thumb {
  22. flex-shrink: 0;
  23. position: relative;
  24. width: 340rpx;
  25. height: 340rpx;
  26. }
  27. .goods-card__thumb:empty {
  28. display: none;
  29. margin: 0;
  30. }
  31. .goods-card__img {
  32. display: block;
  33. width: 100%;
  34. height: 100%;
  35. border-radius: 16rpx 16rpx 0 0;
  36. overflow: hidden;
  37. }
  38. .goods-card__body {
  39. display: flex;
  40. box-sizing: border-box;
  41. width: 100%;
  42. flex: 1 1 auto;
  43. background: #fff;
  44. border-radius: 0 0 16rpx 16rpx;
  45. padding: 16rpx 24rpx 18rpx;
  46. flex-direction: column;
  47. }
  48. .goods-card__upper {
  49. display: flex;
  50. flex-direction: column;
  51. overflow: hidden;
  52. flex: 1 1 auto;
  53. }
  54. .goods-card__title {
  55. flex-shrink: 0;
  56. font-size: 28rpx;
  57. color: #333;
  58. font-weight: 400;
  59. display: -webkit-box;
  60. height: 72rpx;
  61. -webkit-box-orient: vertical;
  62. -webkit-line-clamp: 2;
  63. overflow: hidden;
  64. word-break: break-word;
  65. line-height: 36rpx;
  66. }
  67. .goods-card__tags {
  68. display: flex;
  69. flex-direction: row;
  70. flex-wrap: wrap;
  71. margin: 8rpx 0 0 0;
  72. }
  73. .goods-card__tag {
  74. color: #fa4126;
  75. background: transparent;
  76. font-size: 20rpx;
  77. border: 1rpx solid #fa4126;
  78. padding: 0 8rpx;
  79. border-radius: 16rpx;
  80. line-height: 30rpx;
  81. margin: 0 8rpx 8rpx 0;
  82. display: block;
  83. overflow: hidden;
  84. white-space: nowrap;
  85. word-break: keep-all;
  86. text-overflow: ellipsis;
  87. }
  88. .goods-card__down {
  89. display: flex;
  90. position: relative;
  91. flex-direction: row;
  92. justify-content: flex-start;
  93. align-items: baseline;
  94. line-height: 32rpx;
  95. margin: 8rpx 0 0 0;
  96. }
  97. .goods-card__price {
  98. display: flex;
  99. align-items: baseline;
  100. flex: 1;
  101. }
  102. .goods-card__symbol {
  103. font-size: 24rpx;
  104. color: #fa4126;
  105. font-weight: 700;
  106. }
  107. .goods-card__current-price {
  108. font-size: 36rpx;
  109. white-space: nowrap;
  110. font-weight: 700;
  111. color: #fa4126;
  112. margin: 0;
  113. }
  114. .goods-card__origin-price {
  115. white-space: nowrap;
  116. font-weight: 700;
  117. color: #bbbbbb;
  118. font-size: 24rpx;
  119. margin: 0 0 0 8rpx;
  120. text-decoration: line-through;
  121. }
  122. .goods-card__add-cart {
  123. margin: auto 0 0 auto;
  124. position: absolute;
  125. bottom: 0;
  126. right: 0;
  127. }
  128. /* 无货标记样式 */
  129. .goods-card__out-of-stock {
  130. position: absolute;
  131. top: 0;
  132. left: 0;
  133. right: 0;
  134. bottom: 0;
  135. background: rgba(0, 0, 0, 0.5);
  136. border-radius: 16rpx 16rpx 0 0;
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. z-index: 10;
  141. }
  142. .goods-card__out-of-stock-text {
  143. font-size: 28rpx;
  144. font-weight: 600;
  145. color: white;
  146. background: rgba(0, 0, 0, 0.7);
  147. padding: 16rpx 32rpx;
  148. border-radius: 8rpx;
  149. text-align: center;
  150. white-space: nowrap;
  151. }