home.vue 5.2 KB

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