houseList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="house-list">
  3. <view class="house-item" v-for="(item,index) in houseList" :key="index">
  4. <view class="house-item-box">
  5. <view class="house-item-img">
  6. <image :src="item.privewImage" mode="aspectFill"></image>
  7. <view class="house-item-floor">
  8. <uni-icons type="location" color="#fff" size="12"></uni-icons>
  9. <text>{{item.projectItemName}}-{{item.projectItemTargetName}}</text>
  10. </view>
  11. </view>
  12. <view class="house-item-info">
  13. <view class="house-item-name">{{item.name}}</view>
  14. <view class="house-item-tag">
  15. <text v-for="(tag,i) in item.tagList" :key="i">
  16. <text>{{tag}}</text>
  17. <text class="line" v-if="i < item.tagList.length-1">|</text>
  18. </text>
  19. </view>
  20. <view class="house-item-price">
  21. <text>{{item.price}}</text>
  22. <view class="price-type">{{item.priceType}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'houseList',
  32. data() {
  33. return {
  34. houseList: [{
  35. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  36. projectItemName: '一号楼',
  37. projectItemTargetName: '一层',
  38. name: '1602,可短租~',
  39. tagList: ['标签1', '标签2', '标签3'],
  40. price: '1200',
  41. priceType: '元/月'
  42. }, {
  43. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  44. projectItemName: '一号楼',
  45. projectItemTargetName: '一层',
  46. name: '1602,可短租~',
  47. tagList: ['标签1', '标签2', '标签3'],
  48. price: '1200',
  49. priceType: '元/月'
  50. }, {
  51. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  52. projectItemName: '一号楼',
  53. projectItemTargetName: '一层',
  54. name: '1602,可短租~',
  55. tagList: ['标签1', '标签2', '标签3'],
  56. price: '1200',
  57. priceType: '元/月'
  58. }, {
  59. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  60. projectItemName: '一号楼',
  61. projectItemTargetName: '一层',
  62. name: '1602,可短租~',
  63. tagList: ['标签1', '标签2', '标签3'],
  64. price: '1200',
  65. priceType: '元/月'
  66. }, {
  67. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  68. projectItemName: '一号楼',
  69. projectItemTargetName: '一层',
  70. name: '1602,可短租~',
  71. tagList: ['标签1', '标签2', '标签3'],
  72. price: '1200',
  73. priceType: '元/月'
  74. }, {
  75. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  76. projectItemName: '一号楼',
  77. projectItemTargetName: '一层',
  78. name: '1602,可短租~',
  79. tagList: ['标签1', '标签2', '标签3'],
  80. price: '1200',
  81. priceType: '元/月'
  82. }, {
  83. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  84. projectItemName: '一号楼',
  85. projectItemTargetName: '一层',
  86. name: '1602,可短租~',
  87. tagList: ['标签1', '标签2', '标签3'],
  88. price: '1200',
  89. priceType: '元/月'
  90. }, {
  91. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  92. projectItemName: '一号楼',
  93. projectItemTargetName: '一层',
  94. name: '1602,可短租~',
  95. tagList: ['标签1', '标签2', '标签3'],
  96. price: '1200',
  97. priceType: '元/月'
  98. }, {
  99. privewImage: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/3556e2b4f9c844758c3af76407b3a5d5',
  100. projectItemName: '一号楼',
  101. projectItemTargetName: '一层',
  102. name: '1602,可短租~',
  103. tagList: ['标签1', '标签2', '标签3'],
  104. price: '1200',
  105. priceType: '元/月'
  106. }]
  107. }
  108. },
  109. onShow() {
  110. },
  111. onLoad() {
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. .house-list {
  117. display: flex;
  118. flex-wrap: wrap;
  119. margin-top: 30rpx;
  120. padding-bottom: 60rpx;
  121. .house-item {
  122. width: 50%;
  123. box-sizing: border-box;
  124. margin-bottom: 30rpx;
  125. &:nth-child(2n-1) {
  126. padding-right: 16rpx;
  127. }
  128. &:nth-child(2n) {
  129. padding-left: 16rpx;
  130. }
  131. .house-item-box {
  132. background: $uni-white;
  133. border-radius: 16rpx;
  134. overflow: hidden;
  135. .house-item-img {
  136. position: relative;
  137. image {
  138. width: 100%;
  139. height: 260rpx !important;
  140. }
  141. }
  142. .house-item-floor {
  143. position: absolute;
  144. left: 0;
  145. bottom: 20rpx;
  146. width: 100%;
  147. color: #FFFFFF;
  148. font-size: 24rpx;
  149. display: flex;
  150. align-items: center;
  151. padding-left: 10rpx;
  152. }
  153. .house-item-info {
  154. padding: 10rpx 0 20rpx 0;
  155. .house-item-name {
  156. font-size: 28rpx;
  157. padding: 0 20rpx;
  158. }
  159. .house-item-tag {
  160. display: flex;
  161. padding-top: 10rpx;
  162. padding-left: 20rpx;
  163. color: $uni-extra-color;
  164. text {
  165. font-size: 24rpx;
  166. }
  167. .line {
  168. margin: 0 10rpx;
  169. }
  170. }
  171. .house-item-price {
  172. display: flex;
  173. align-items: center;
  174. padding-top: 6rpx;
  175. color: $uni-error;
  176. padding-left: 20rpx;
  177. text {
  178. font-weight: bold;
  179. font-size: 30rpx;
  180. }
  181. .price-type {
  182. display: inline-block;
  183. font-size: 24rpx;
  184. scale: 0.9;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. }
  191. </style>