index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="index-container">
  3. <view class="project-box">
  4. <view class="project-name">
  5. <text class="label">项目名称</text>
  6. <uni-icons class="project-icon" type="right" size="16"></uni-icons>
  7. </view>
  8. </view>
  9. <view class="banner-box">
  10. <uni-swiper-dot :info="info" mode="round">
  11. <swiper class="swiper-box">
  12. <swiper-item class="swiper-item-box" v-for="(item, index) in info" :key="index">
  13. <view class="swiper-item" :style="'background-image:url('+item.url+')'"></view>
  14. </swiper-item>
  15. </swiper>
  16. </uni-swiper-dot>
  17. </view>
  18. <view class="grid">
  19. <view class="grid-item red">
  20. <view>
  21. <view class="label">房源列表</view>
  22. <view class="sub-label">查看房源
  23. <uni-icons class="sub-label-icon" type="right" size="14" color="#eee"></uni-icons>
  24. </view>
  25. </view>
  26. <uni-icons class="home-filled" type="home-filled" size="40" color="#eee"></uni-icons>
  27. </view>
  28. <view class="grid-item blue">
  29. <view>
  30. <view class="label">客户管理</view>
  31. <view class="sub-label">查看客户
  32. <uni-icons class="sub-label-icon" type="right" size="14" color="#eee"></uni-icons>
  33. </view>
  34. </view>
  35. <uni-icons class="home-filled" type="person-filled" size="40" color="#eee"></uni-icons>
  36. </view>
  37. </view>
  38. <view class="good-box">
  39. <text>推荐房源</text>
  40. </view>
  41. <house></house>
  42. </view>
  43. </template>
  44. <script>
  45. import house from '@/components/house/house'
  46. export default {
  47. data() {
  48. return {
  49. info: [{
  50. url: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5'
  51. },
  52. {
  53. url: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/f488a1cc0e904ed089d52d88e3c1b33d'
  54. }
  55. ],
  56. modeIndex: -1,
  57. current: 0,
  58. swiperDotIndex: 0
  59. }
  60. },
  61. methods: {},
  62. components: {
  63. house
  64. },
  65. }
  66. </script>
  67. <style lang="scss">
  68. .index-container {
  69. padding: 0 30rpx;
  70. box-sizing: border-box;
  71. .good-box {
  72. margin-top: 30rpx;
  73. position: relative;
  74. text-align: center;
  75. text {
  76. background: #f3f6f8;
  77. z-index: 9;
  78. position: relative;
  79. padding: 5px 10px;
  80. color: $uni-secondary-color;
  81. }
  82. &:before {
  83. content: '';
  84. bottom: 20rpx;
  85. position: absolute;
  86. left: 0;
  87. height: 1px;
  88. right: 0;
  89. background: #eee;
  90. z-index: 8;
  91. }
  92. }
  93. .project-box {
  94. padding: 30rpx 0;
  95. position: sticky;
  96. .project-name {
  97. display: flex;
  98. font-size: 16px;
  99. align-items: center;
  100. font-weight: 400;
  101. }
  102. .project-icon {
  103. margin-left: 8rpx;
  104. }
  105. }
  106. .banner-box {
  107. border-radius: 20rpx;
  108. overflow: hidden;
  109. }
  110. .swiper-box {
  111. height: 400rpx;
  112. }
  113. .swiper-item {
  114. width: 100%;
  115. height: 100%;
  116. background-size: cover;
  117. background-position: bottom;
  118. }
  119. .swiper-item-box:first-child {
  120. border-radius: 20rpx 0 0 20rpx;
  121. }
  122. .swiper-item-box:last-child {
  123. border-radius: 0 20rpx 20rpx 0;
  124. }
  125. .grid {
  126. display: flex;
  127. flex-wrap: wrap;
  128. margin-top: 30rpx;
  129. .grid-item {
  130. flex: 1;
  131. height: 180rpx;
  132. background: #fff;
  133. border-radius: 16rpx;
  134. color: #fff;
  135. display: flex;
  136. align-items: center;
  137. padding: 0 10px;
  138. justify-content: space-between;
  139. &.red {
  140. background: linear-gradient(to right, rgb(242, 79, 104), rgb(237, 133, 152));
  141. }
  142. &.blue {
  143. background: linear-gradient(to right, rgb(69, 159, 230), rgb(108, 201, 228));
  144. }
  145. }
  146. .label {
  147. font-size: 36rpx;
  148. margin-bottom: 5px;
  149. }
  150. .sub-label {
  151. color: rgba(255, 255, 255, 0.5);
  152. font-size: 24rpx;
  153. display: flex;
  154. align-items: center;
  155. height: 40rpx;
  156. }
  157. .sub-label-icon {
  158. opacity: 0.7;
  159. }
  160. .grid-item:nth-child(2n) {
  161. margin-left: 30rpx;
  162. }
  163. .home-filled {
  164. color: #eee;
  165. opacity: 0.3;
  166. }
  167. }
  168. }
  169. </style>