home.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view style="background-color: #f7f7f5;overflow: hidden;">
  3. <view class="top-bg"></view>
  4. <view class="section carousel-wrapper">
  5. <swiper class="carousel" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" circular>
  6. <swiper-item>
  7. <view class="swiper-item">
  8. <image class="image" src="../../static/images/material/carousel01.png" mode=""></image>
  9. </view>
  10. </swiper-item>
  11. <swiper-item>
  12. <view class="swiper-item">
  13. <image class="image" src="../../static/images/material/carousel02.png" mode=""></image>
  14. </view>
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <view class="section">
  19. <view class="col-title">
  20. <image class="icon" style="width: 38rpx;height: 43rpx;" src="../../static/images/hot.png" mode="scaleToFill"></image>
  21. <text>今日拿货榜单</text>
  22. </view>
  23. <view class="hot-rank">
  24. <scroll-view scroll-x="true" :show-scrollbar="false" :enable-flex="true" style="white-space: nowrap;">
  25. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  26. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  27. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  28. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  29. </scroll-view>
  30. </view>
  31. </view>
  32. <view class="section">
  33. <view class="col-title">
  34. <image class="icon" style="width: 47rpx;height: 47rpx;" src="../../static/images/sale.png" mode="scaleToFill"></image>
  35. <text>最新上线</text>
  36. </view>
  37. <view class="new-rank">
  38. <scroll-view scroll-x="true" :show-scrollbar="false" :enable-flex="true" style="white-space: nowrap;">
  39. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  40. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  41. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  42. <product-item type="swiper" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  43. </scroll-view>
  44. </view>
  45. </view>
  46. <view class="section" style="margin-top: 40upx;">
  47. <view class="col-img-title">
  48. <image src="../../static/images/like.png" mode="scaleToFill" style="height: 28rpx;width: 363rpx;"></image>
  49. </view>
  50. <view class="like">
  51. <product-item type="list" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  52. <product-item type="list" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  53. <product-item type="list" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  54. <product-item type="list" image="https://img.alicdn.com/imgextra/i3/2930255252/O1CN0159ouF21ofSiQ3kPq2_!!2930255252.jpg"></product-item>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. title: 'Hello',
  64. }
  65. },
  66. components: {},
  67. onLoad() {
  68. },
  69. methods: {}
  70. }
  71. </script>
  72. <style lang="scss">
  73. .search {
  74. background-color: #FFFFFF;
  75. width: 100%;
  76. height: 60rpx;
  77. line-height: 60rpx;
  78. border-radius: 30rpx;
  79. text-align: center;
  80. color: #999999;
  81. }
  82. .top-bg {
  83. position: absolute;
  84. top: 0;
  85. width: 100%;
  86. height: 300rpx;
  87. background-color: $primary-color;
  88. overflow: hidden;
  89. }
  90. .top-bg::after {
  91. background: #F8F8F8;
  92. position: absolute;
  93. border-radius: 2000rpx;
  94. content: "";
  95. width: 4000rpx;
  96. height: 4000rpx;
  97. top: 260rpx;
  98. left: -1625rpx;
  99. }
  100. .carousel-wrapper {
  101. margin-top: 20rpx;
  102. .carousel {
  103. margin: auto;
  104. overflow: hidden;
  105. border-radius: 20rpx;
  106. transform: translateY(0);
  107. width: 702rpx;
  108. height: 340rpx;
  109. .image {
  110. width: 702rpx;
  111. height: 340rpx;
  112. }
  113. }
  114. }
  115. .section {
  116. // padding: 20rpx;
  117. }
  118. .col-title {
  119. height: 60rpx;
  120. line-height: 60rpx;
  121. font-weight: bold;
  122. display: flex;
  123. align-items: center;
  124. padding: 20upx 20upx 10upx 20upx;
  125. .icon {
  126. // vertical-align: middle;
  127. margin-right: 12rpx;
  128. }
  129. }
  130. .col-img-title {
  131. text-align: center;
  132. background: white;
  133. height: 80upx;
  134. line-height: 80upx;
  135. }
  136. .hot-rank .product-item ,.new-rank .product-item{
  137. margin: 5rpx;
  138. &:first-child {
  139. margin-left: 20upx;
  140. }
  141. &:last-child {
  142. margin-right: 20upx;
  143. }
  144. }
  145. .like{
  146. display: flex;
  147. justify-content: space-between;
  148. flex-wrap: wrap;
  149. padding: 10upx 20upx;
  150. }
  151. .like .product-item{
  152. margin-bottom: 10upx;
  153. }
  154. </style>