index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view>
  3. <view class="home-head">
  4. <view class="homeTab">
  5. <u-tabs :list="tabList" :current="current" @change="change" :show-bar="false" active-color="#333" inactive-color="#c4c0c0"></u-tabs>
  6. </view>
  7. <view class="homeAdd">
  8. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  9. <span>荆州市</span>
  10. </view>
  11. </view>
  12. <view class="homeWrap">
  13. <u-swiper :list="wrapList" height="300" border-radius="24"></u-swiper>
  14. </view>
  15. <view class="homeUser">
  16. <view class="homeUser-item">
  17. <view class="homeUser-add">
  18. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  19. <span>荆州</span>
  20. </view>
  21. <view class="homeUser-text">
  22. <view class="homeUser-name">
  23. <span>刘子琪</span>
  24. <u-icon custom-prefix="custom-icon" name="women-line" color="#FF695B"></u-icon>
  25. </view>
  26. <view class="homeUser-info">
  27. 24岁 · 160cm · 51kg
  28. </view>
  29. </view>
  30. <u-image class="homeUser-img" src="/static/img/user1.jpg" height="330" mode="aspectFill"></u-image>
  31. </view>
  32. <view class="homeUser-item">
  33. <view class="homeUser-add">
  34. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  35. <span>荆州</span>
  36. </view>
  37. <view class="homeUser-text">
  38. <view class="homeUser-name">
  39. <span>刘子琪</span>
  40. <u-icon custom-prefix="custom-icon" name="men-line" color="#1677FF"></u-icon>
  41. </view>
  42. <view class="homeUser-info">
  43. 24岁 · 160cm · 51kg
  44. </view>
  45. </view>
  46. <u-image src="/static/img/user2.jpg" height="330" mode="aspectFill"></u-image>
  47. </view>
  48. <view class="homeUser-item">
  49. <view class="homeUser-add">
  50. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  51. <span>荆州</span>
  52. </view>
  53. <view class="homeUser-text">
  54. <view class="homeUser-name">
  55. <span>刘子琪</span>
  56. <u-icon custom-prefix="custom-icon" name="men-line" color="#1677FF"></u-icon>
  57. </view>
  58. <view class="homeUser-info">
  59. 24岁 · 160cm · 51kg
  60. </view>
  61. </view>
  62. <u-image src="/static/img/user3.jpg" height="330" mode="aspectFill"></u-image>
  63. </view>
  64. <view class="homeUser-item">
  65. <view class="homeUser-add">
  66. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  67. <span>荆州</span>
  68. </view>
  69. <view class="homeUser-text">
  70. <view class="homeUser-name">
  71. <span>刘子琪</span>
  72. <u-icon custom-prefix="custom-icon" name="women-line" color="#FF695B"></u-icon>
  73. </view>
  74. <view class="homeUser-info">
  75. 24岁 · 160cm · 51kg
  76. </view>
  77. </view>
  78. <u-image src="/static/img/user4.jpg" height="330" mode="aspectFill"></u-image>
  79. </view>
  80. <u-divider color="#B6BDC3" style="margin-top:20px;">已经到底了</u-divider>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. tabList: [{
  89. name: '最新'
  90. }, {
  91. name: '最热'
  92. }],
  93. current: 0,
  94. wrapList: [{
  95. image: '/static/img/banner.png',
  96. },
  97. {
  98. image: '/static/img/banner.png',
  99. },
  100. {
  101. image: '/static/img/banner.png',
  102. }
  103. ],
  104. }
  105. },
  106. methods: {
  107. change(index) {
  108. this.current = index;
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .home-head{
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: center;
  118. padding-right: 15px;
  119. .homeAdd{
  120. color: #FF5E5E;
  121. span{
  122. margin-left: 3px;
  123. }
  124. }
  125. }
  126. .homeWrap{
  127. padding:0 15px;
  128. }
  129. .homeUser{
  130. display: flex;
  131. justify-content: space-between;
  132. flex-wrap: wrap;
  133. padding: 15px;
  134. .homeUser-item{
  135. width: 48%;
  136. height: 165px;
  137. margin-bottom: 15px;
  138. position: relative;
  139. color: #fff;
  140. border-radius: 12px;
  141. overflow: hidden;
  142. .homeUser-add{
  143. position: absolute;
  144. z-index: 9;
  145. right: 10px;
  146. top: 10px;
  147. background: rgba(0,0,0,0.5);
  148. padding:2px 5px;
  149. border-radius: 12px;
  150. span{
  151. margin-left: 3px;
  152. font-size: 14px;
  153. }
  154. }
  155. .homeUser-text{
  156. position: absolute;
  157. z-index: 9;
  158. left:0px ;
  159. bottom: 0px;
  160. right: 0;
  161. padding: 10px;
  162. background: linear-gradient( 180deg,rgba(0,0,0,0),rgba(0,0,0,0.5));
  163. }
  164. .homeUser-name{
  165. display: flex;
  166. align-items: center;
  167. span{
  168. margin-right: 3px;
  169. }
  170. }
  171. .homeUser-info{
  172. margin-top: 3px;
  173. }
  174. .homeUser-img{
  175. position: relative;
  176. z-index: 0;
  177. }
  178. }
  179. }
  180. </style>