searchlist.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="search-list">
  3. <view class="search-top">
  4. <swiper class="swiper" circular :indicator-dots="true">
  5. <swiper-item>
  6. <view class="project-item">
  7. <view class="title">
  8. <view class="name">
  9. 维绿大厦
  10. </view>
  11. <view class="to">
  12. 进入项目
  13. </view>
  14. </view>
  15. <image class="image"
  16. src="https://assets.api.uizard.io/api/cdn/stream/0ba939e8-082b-42f9-a314-be3e195b3b25.png"
  17. mode="aspectFill">
  18. </image>
  19. </view>
  20. </swiper-item>
  21. <swiper-item>
  22. <view class="project-item">
  23. <view class="title">
  24. <view class="name">
  25. 维绿大厦
  26. </view>
  27. <view class="to">
  28. 进入项目
  29. </view>
  30. </view>
  31. <image class="image"
  32. src="https://assets.api.uizard.io/api/cdn/stream/0ba939e8-082b-42f9-a314-be3e195b3b25.png"
  33. mode="aspectFill">
  34. </image>
  35. </view>
  36. </swiper-item>
  37. <swiper-item>
  38. <view class="project-item">
  39. <view class="title">
  40. <view class="name">
  41. 维绿大厦
  42. </view>
  43. <view class="to">
  44. 进入项目
  45. </view>
  46. </view>
  47. <image class="image"
  48. src="https://assets.api.uizard.io/api/cdn/stream/0ba939e8-082b-42f9-a314-be3e195b3b25.png"
  49. mode="aspectFill">
  50. </image>
  51. </view>
  52. </swiper-item>
  53. </swiper>
  54. </view>
  55. <view class="house-list">
  56. <house-item v-for="(item,index) in list" :house="item" :key="item.id"></house-item>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import houseItem from "@/components/house/houseItem.vue";
  62. import {
  63. getOpenHouseListByPage
  64. } from '@/request/api/house.js'
  65. export default {
  66. data() {
  67. return {
  68. list: []
  69. }
  70. },
  71. onLoad(body) {
  72. console.log(body);
  73. this.init();
  74. },
  75. methods: {
  76. init() {
  77. getOpenHouseListByPage({
  78. currPage: 1,
  79. pageSize: 10
  80. }).then(res => {
  81. if (res.code === 200) {
  82. this.list = this.list.concat(res.data.dataList); //追加新数据
  83. }
  84. })
  85. }
  86. },
  87. components: {
  88. houseItem
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. .search-list {
  94. .search-top {
  95. padding: 30rpx;
  96. .swiper {
  97. border-radius: 16rpx;
  98. overflow: hidden;
  99. height: 400rpx;
  100. }
  101. .project-item {
  102. height: 100%;
  103. background: #fff;
  104. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  105. .title {
  106. display: flex;
  107. padding: 20rpx 30rpx;
  108. align-items: center;
  109. }
  110. .name {
  111. font-weight: bold;
  112. font-size: 32rpx;
  113. flex: 1;
  114. width: 0;
  115. overflow: hidden;
  116. }
  117. .to {
  118. border: 1px solid $uni-primary;
  119. width: 160rpx;
  120. height: 60rpx;
  121. text-align: center;
  122. line-height: 60rpx;
  123. font-size: 24rpx;
  124. border-radius: 60rpx;
  125. color: $uni-primary;
  126. }
  127. .image {
  128. height: 300rpx;
  129. }
  130. }
  131. }
  132. .house-list {
  133. padding: 30rpx;
  134. padding-top: 0;
  135. }
  136. }
  137. </style>