searchlist.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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" @click="$navigateTo('/pages/project/project')">
  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>
  22. </view>
  23. <view class="house-list">
  24. <house-item v-for="(item,index) in list" :house="item" :key="item.id"></house-item>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import houseItem from "@/components/house/houseItem.vue";
  30. import {
  31. getOpenHouseListByPage
  32. } from '@/request/api/house.js'
  33. export default {
  34. data() {
  35. return {
  36. list: []
  37. }
  38. },
  39. onLoad(body) {
  40. console.log(body);
  41. this.init();
  42. },
  43. methods: {
  44. init() {
  45. getOpenHouseListByPage({
  46. currPage: 1,
  47. pageSize: 10
  48. }).then(res => {
  49. if (res.code === 200) {
  50. this.list = this.list.concat(res.data.dataList); //追加新数据
  51. }
  52. })
  53. }
  54. },
  55. components: {
  56. houseItem
  57. }
  58. }
  59. </script>
  60. <style lang="scss">
  61. .search-list {
  62. .search-top {
  63. padding: 30rpx;
  64. .swiper {
  65. border-radius: 16rpx;
  66. overflow: hidden;
  67. height: 400rpx;
  68. }
  69. .project-item {
  70. height: 100%;
  71. background: #fff;
  72. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  73. .title {
  74. display: flex;
  75. padding: 20rpx 30rpx;
  76. align-items: center;
  77. }
  78. .name {
  79. font-weight: bold;
  80. font-size: 32rpx;
  81. flex: 1;
  82. width: 0;
  83. overflow: hidden;
  84. }
  85. .to {
  86. border: 1px solid $uni-primary;
  87. width: 160rpx;
  88. height: 60rpx;
  89. text-align: center;
  90. line-height: 60rpx;
  91. font-size: 24rpx;
  92. border-radius: 60rpx;
  93. color: $uni-primary;
  94. }
  95. .image {
  96. height: 300rpx;
  97. }
  98. }
  99. }
  100. .house-list {
  101. padding: 30rpx;
  102. padding-top: 0;
  103. }
  104. }
  105. </style>