home.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. onNavigationBarButtonTap(e) {
  70. // console.log(e)
  71. switch (e.index) {
  72. case 0:
  73. uni.navigateTo({
  74. url: '/pages/message/message'
  75. });
  76. break;
  77. default:
  78. break;
  79. }
  80. },
  81. methods: {}
  82. }
  83. </script>
  84. <style lang="scss">
  85. .search {
  86. background-color: #FFFFFF;
  87. width: 100%;
  88. height: 60rpx;
  89. line-height: 60rpx;
  90. border-radius: 30rpx;
  91. text-align: center;
  92. color: #999999;
  93. }
  94. .top-bg {
  95. position: absolute;
  96. top: 0;
  97. width: 100%;
  98. height: 300rpx;
  99. background-color: $primary-color;
  100. overflow: hidden;
  101. }
  102. .top-bg::after {
  103. background: #F8F8F8;
  104. position: absolute;
  105. border-radius: 2000rpx;
  106. content: "";
  107. width: 4000rpx;
  108. height: 4000rpx;
  109. top: 260rpx;
  110. left: -1625rpx;
  111. }
  112. .carousel-wrapper {
  113. margin-top: 20rpx;
  114. .carousel {
  115. margin: auto;
  116. overflow: hidden;
  117. border-radius: 20rpx;
  118. transform: translateY(0);
  119. width: 702rpx;
  120. height: 340rpx;
  121. .image {
  122. width: 702rpx;
  123. height: 340rpx;
  124. }
  125. }
  126. }
  127. .section {
  128. // padding: 20rpx;
  129. }
  130. .col-title {
  131. height: 60rpx;
  132. line-height: 60rpx;
  133. font-weight: bold;
  134. display: flex;
  135. align-items: center;
  136. padding: 20upx 20upx 10upx 20upx;
  137. .icon {
  138. // vertical-align: middle;
  139. margin-right: 12rpx;
  140. }
  141. }
  142. .col-img-title {
  143. text-align: center;
  144. background: white;
  145. height: 80upx;
  146. line-height: 80upx;
  147. }
  148. .hot-rank .product-item,
  149. .new-rank .product-item {
  150. margin: 5rpx;
  151. &:first-child {
  152. margin-left: 20upx;
  153. }
  154. &:last-child {
  155. margin-right: 20upx;
  156. }
  157. }
  158. .like {
  159. display: flex;
  160. justify-content: space-between;
  161. flex-wrap: wrap;
  162. padding: 10upx 20upx;
  163. }
  164. .like .product-item {
  165. margin-bottom: 10upx;
  166. }
  167. </style>