houseDetail.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="house-detail">
  3. <view class="banner">
  4. <swiper class="banner-swiper" @change="swiperchange">
  5. <swiper-item v-for="(item,index) in detail.banner" :key="index">
  6. <view class="swiper-item" @click="previewImage(item.url)">
  7. <image :src="item.url" mode="aspectFill" class="banner-swiper-img">
  8. </image>
  9. </view>
  10. </swiper-item>
  11. </swiper>
  12. <view class="indicator-dots">
  13. <text>{{current + 1}}/{{detail.banner.length}}</text>
  14. </view>
  15. </view>
  16. <view class="house-info">
  17. <view class="title">{{detail.name}}</view>
  18. <view class="price">
  19. <view class="price-text">¥</view>
  20. <text class="price-number">{{detail.price}}</text>
  21. <view class="price-text">元/{{detail.payType === 0 ? '月' : '年'}}</view>
  22. </view>
  23. <view class="information">
  24. <view class="head-tilte">房源标签</view>
  25. <view class="tag">
  26. <uni-tag v-for="(tag,i) in detail.tagList" :key="i" :text="tag.name" size="mini"
  27. class="house-tag" />
  28. </view>
  29. <view class="head-tilte">房源信息</view>
  30. <view class="information-list">
  31. <view class="information-box">
  32. <text class="information-title">所属楼宇:</text>
  33. <text class="information-text">{{detail.projectItemName}}</text>
  34. </view>
  35. <view class="information-box">
  36. <text class="information-title">所属楼层:</text>
  37. <text class="information-text">{{detail.projectItemTargetName}}</text>
  38. </view>
  39. <view class="information-box">
  40. <text class="information-title">房源类型:</text>
  41. <text class="information-text">{{$field.findHouseTypeName(detail.roomTypeId)}}</text>
  42. </view>
  43. <view class="information-box">
  44. <text class="information-title">房间号码:</text>
  45. <text class="information-text">{{detail.roomNumber}}</text>
  46. </view>
  47. <view class="information-box">
  48. <text class="information-title">房源面积:</text>
  49. <text class="information-text">{{detail.area}}</text>
  50. </view>
  51. <view class="information-box">
  52. <text class="information-title">付款方式:</text>
  53. <text class="information-text">{{$field.findPayWayName(detail.payWay)}}</text>
  54. </view>
  55. <view class="information-box">
  56. <text class="information-title">产权证书:</text>
  57. <text class="information-text">{{detail.propertyCertificateNumber}}</text>
  58. </view>
  59. <view class="information-box">
  60. <text class="information-title">是否装修:</text>
  61. <text class="information-text">{{detail.decoration === 1 ? '已装修':'未装修'}}</text>
  62. </view>
  63. </view>
  64. <view class="desc">
  65. <view class="head-tilte">房屋介绍</view>
  66. <view class="desc-text" v-html="detail.introduce"></view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="btn-box">
  71. <view class="share color01">签约</view>
  72. <view class="share color02">咨询</view>
  73. <view class="share">留言</view>
  74. </view>
  75. <preview-video :show="videoShow" :videoUrl="videoUrl" @close="videoShow = false"></preview-video>
  76. </view>
  77. </template>
  78. <script>
  79. import previewVideo from '../../components/previewVideo/previewVideo'
  80. import {
  81. getHouseDetailById
  82. } from '@/request/api/house'
  83. export default {
  84. data() {
  85. return {
  86. videoShow: false,
  87. videoUrl: 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/071c2be54d154f57ae34c31242282788',
  88. current: 0,
  89. detail: {
  90. banner: [],
  91. tagList: []
  92. }
  93. }
  94. },
  95. onLoad(body) {
  96. getHouseDetailById(body.id).then(res => {
  97. if (res.code === 200) {
  98. this.detail = res.data;
  99. if (this.detail.picture) this.detail['banner'] = JSON.parse(this.detail.picture);
  100. }
  101. })
  102. },
  103. methods: {
  104. swiperchange(e) {
  105. this.current = e.detail.current
  106. },
  107. // 去预约
  108. gobook(id, name) {
  109. uni.navigateTo({
  110. url: `/pages/book/book?id=${id}&name=${name}`
  111. })
  112. },
  113. // 拨打电话
  114. isPhoneCall() {
  115. uni.makePhoneCall({
  116. phoneNumber: '10086' //仅为示例
  117. });
  118. },
  119. // 预览图片
  120. previewImage(url) {
  121. uni.previewImage({
  122. urls: [url]
  123. })
  124. },
  125. },
  126. components: {
  127. previewVideo
  128. }
  129. }
  130. </script>
  131. <style lang="scss">
  132. .house-detail {
  133. background: #fff;
  134. padding-bottom: 140rpx;
  135. .banner {
  136. position: relative;
  137. width: 100%;
  138. .banner-swiper {
  139. height: 600rpx;
  140. }
  141. .banner-swiper-img {
  142. height: 600rpx !important;
  143. }
  144. .swiper-item image {
  145. width: 100%;
  146. }
  147. .indicator-dots {
  148. position: absolute;
  149. bottom: 30rpx;
  150. left: 0;
  151. right: 0;
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. }
  156. .indicator-dots text {
  157. font-size: 24rpx;
  158. color: $uni-white;
  159. background: rgba(0, 0, 0, 0.5);
  160. border-radius: 50rpx;
  161. width: 64rpx;
  162. text-align: center;
  163. }
  164. /deep/ .uni-swiper-dot {
  165. width: 40rpx;
  166. height: 4rpx;
  167. border-radius: 20rpx;
  168. }
  169. }
  170. .house-info {
  171. position: relative;
  172. padding: 30rpx;
  173. border-top-left-radius: 30rpx;
  174. border-top-right-radius: 30rpx;
  175. background: $uni-white;
  176. margin-top: -30rpx;
  177. .title {
  178. font-size: 38rpx;
  179. font-weight: bold;
  180. }
  181. .price {
  182. padding-top: 20rpx;
  183. color: $uni-error;
  184. .price-number {
  185. font-size: 44rpx;
  186. font-weight: bold;
  187. }
  188. .price-text {
  189. display: inline-block;
  190. font-size: 26rpx;
  191. scale: 0.8;
  192. }
  193. }
  194. }
  195. .information {
  196. padding-top: 30rpx;
  197. .tag {
  198. margin-top: 10rpx;
  199. margin-bottom: 20rpx;
  200. padding: 0 20rpx;
  201. .house-tag {
  202. background-color: #d4d1d7;
  203. border-color: #d4d1d7;
  204. padding: 0 10px;
  205. border-radius: 10rpx;
  206. margin-right: 20rpx;
  207. /* #ifdef MP-WEIXIN */
  208. text {
  209. background: transparent;
  210. border: none;
  211. }
  212. /* #endif */
  213. }
  214. }
  215. .head-tilte {
  216. font-size: 30rpx;
  217. font-weight: bold;
  218. }
  219. .information-list {
  220. display: flex;
  221. flex-wrap: wrap;
  222. padding: 20rpx 20rpx 0;
  223. .information-box {
  224. width: 50%;
  225. display: flex;
  226. padding: 20rpx 0;
  227. }
  228. .information-title {
  229. font-size: 26rpx;
  230. color: $uni-extra-color;
  231. }
  232. .information-text {
  233. font-size: 26rpx;
  234. color: $uni-base-color;
  235. flex: 1;
  236. width: 0;
  237. overflow: hidden;
  238. white-space: nowrap;
  239. }
  240. }
  241. .desc {
  242. padding-top: 20rpx;
  243. .desc-text {
  244. padding: 20rpx;
  245. color: $uni-base-color;
  246. font-size: 26rpx;
  247. }
  248. }
  249. }
  250. .btn-box {
  251. position: fixed;
  252. bottom: 0;
  253. left: 0;
  254. right: 0;
  255. display: flex;
  256. justify-content: center;
  257. align-items: center;
  258. padding: 20rpx 1%;
  259. background: #fff;
  260. box-shadow: $uni-shadow-sm;
  261. .share {
  262. flex: 1;
  263. text-align: center;
  264. background: #4a55fd;
  265. border-radius: 8rpx;
  266. height: 60rpx;
  267. text-align: center;
  268. margin: 0 1%;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. font-size: 26rpx;
  273. color: #fff;
  274. }
  275. .color01 {
  276. background: linear-gradient(to right, #fea733, #feb34d, #fdc46b);
  277. }
  278. .color02 {
  279. background: linear-gradient(to right, #ff4761, #fe606e, #fc706f);
  280. }
  281. }
  282. }
  283. </style>