hotComponent.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="hot-wrap">
  3. <view class="hot-content" :class="{'hot-border': isGardeItem}">
  4. <view class="hot-title">
  5. <view class="title-l" v-show="!isGardeItem">
  6. 好味<text class="title-color">热卖</text>
  7. </view>
  8. <view class="title-l" v-show="isGardeItem">
  9. 果园热卖
  10. </view>
  11. <view class="title-btn">
  12. 限时抢购中<up-icon size="10" name="arrow-right"></up-icon>
  13. </view>
  14. </view>
  15. <view class="hot-list">
  16. <up-scroll-list indicatorColor="#FF770033" indicatorActiveColor="#FF7700" :indicatorWidth="30"
  17. :indicatorBarWidth="13">
  18. <view class="hot-panel">
  19. <view class="hot-item">
  20. <image class="hot-img" :src="`${config.BASIC_IMG}home/hot-1.png`" mode=""></image>
  21. <view class="item-info">
  22. <view class="info-text">
  23. <!-- <up-text :lines="2" color="#000000" size="12" text="海南妃子笑新鲜顺丰发货海南妃子笑海南妃子笑"></up-text> -->
  24. <view class="ellipsis-l2">
  25. 海南妃子笑新鲜顺丰发货海南妃子笑海南妃子笑
  26. </view>
  27. </view>
  28. <view class="info-price">
  29. <view class="price-text">
  30. <text class="price-unit">¥</text>108
  31. </view>
  32. <view class="info-sold">
  33. 已售1251
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="hot-item">
  39. <image class="hot-img" :src="`${config.BASIC_IMG}home/hot-2.png`" mode=""></image>
  40. <view class="item-info">
  41. <view class="info-text">
  42. <view class="ellipsis-l2">
  43. 海南妃子笑新鲜顺丰发货海南妃子笑海南妃子笑
  44. </view>
  45. </view>
  46. <view class="info-price">
  47. <view class="price-text">
  48. <text class="price-unit">¥</text>108
  49. </view>
  50. <view class="info-sold">
  51. 已售1251
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="hot-item">
  57. <image class="hot-img" :src="`${config.BASIC_IMG}home/hot-1.png`" mode=""></image>
  58. <view class="item-info">
  59. <view class="info-text">
  60. <view class="ellipsis-l2">
  61. 海南妃子笑新鲜顺丰发货海南妃子笑海南妃子笑新鲜顺丰发货
  62. </view>
  63. </view>
  64. <view class="info-price">
  65. <view class="price-text">
  66. <text class="price-unit">¥</text>108
  67. </view>
  68. <view class="info-sold">
  69. 已售1251
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="hot-item">
  75. <image class="hot-img" :src="`${config.BASIC_IMG}home/hot-2.png`" mode=""></image>
  76. <view class="item-info">
  77. <view class="info-text">
  78. <view class="ellipsis-l2">
  79. 海南妃子笑新鲜顺丰发货海南妃子笑海南妃子笑新鲜顺丰发货
  80. </view>
  81. </view>
  82. <view class="info-price">
  83. <view class="price-text">
  84. <text class="price-unit">¥</text>108
  85. </view>
  86. <view class="info-sold">
  87. 已售1251
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </up-scroll-list>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script setup>
  99. import config from "@/api/config.js"
  100. const props = defineProps({
  101. isGardeItem: {
  102. type: Boolean,
  103. default: false
  104. }
  105. })
  106. </script>
  107. <style lang="scss" scoped>
  108. .hot-title {
  109. display: flex;
  110. align-items: center;
  111. justify-content: space-between;
  112. padding-bottom: 20rpx;
  113. .title-l {
  114. font-family: 'PangMenZhengDao';
  115. font-size: 32rpx;
  116. .title-color {
  117. color: #F3C11D;
  118. }
  119. }
  120. .title-btn {
  121. color: rgba(0, 0, 0, 0.6);
  122. font-size: 24rpx;
  123. display: inline-flex;
  124. align-items: center;
  125. }
  126. }
  127. .hot-wrap {
  128. background: linear-gradient(#FFFFFF, rgba(255, 255, 255, 0));
  129. padding: 2rpx;
  130. border-radius: 16rpx;
  131. .hot-content {
  132. background: linear-gradient(#fff1c3 4%, #FFFFFF 28%);
  133. border-radius: 16rpx;
  134. padding: 20rpx;
  135. height: 240rpx;
  136. box-sizing: border-box;
  137. &.hot-border {
  138. background: none;
  139. border: 2rpx solid #F3F3F3;
  140. }
  141. .hot-list {
  142. .hot-panel {
  143. width: 100%;
  144. display: flex;
  145. .hot-item {
  146. width: calc(50% - 10rpx);
  147. display: flex;
  148. white-space: nowrap;
  149. .hot-img {
  150. flex: none;
  151. width: 116rpx;
  152. height: 116rpx;
  153. object-fit: cover;
  154. border-radius: 10rpx;
  155. }
  156. .item-info {
  157. padding-left: 10rpx;
  158. width: 200rpx;
  159. .info-text {
  160. color: #000000;
  161. font-size: 24rpx;
  162. }
  163. .info-price {
  164. display: flex;
  165. align-items: baseline;
  166. justify-content: space-between;
  167. .price-text {
  168. color: #FF7700;
  169. font-size: 32rpx;
  170. .price-unit {
  171. font-size: 20rpx;
  172. }
  173. }
  174. .info-sold {
  175. font-size: 20rpx;
  176. color: #C4C4C4;
  177. }
  178. }
  179. }
  180. }
  181. .hot-item+.hot-item {
  182. margin-left: 20rpx;
  183. }
  184. }
  185. ::v-deep {
  186. .u-scroll-list__indicator {
  187. margin-top: 20rpx;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. </style>