dtl.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <view class="l-box">
  3. <wm-watermark :text="userInfo.phone" :num="50"></wm-watermark>
  4. <View class="dtl-header" @click="previewImageHandle(curObj.pri_image, [{img_url: curObj.pri_image}])">
  5. <View class="dh-content">
  6. <View class="dh-p1">
  7. <Image class="i" :src="require('./img/i_house.png')" />
  8. <View class="t">{{curObj.estate_name}}</View>
  9. </View>
  10. <View class="dh-p2">
  11. <Image class="i" :src="require('./img/i_pos.png')" />
  12. <View class="t">{{curObj.address}}</View>
  13. </View>
  14. <View class="dh-sign">
  15. <!-- <View class="s" key={tagIndex}>{tag.key}</View> -->
  16. </View>
  17. </View>
  18. <Image class="dh-bg" :src="`${curObj.pri_image + '_white'}`" />
  19. </View>
  20. <View class="dtl-options">
  21. <View class="do-title">
  22. <View class="t">基本情况</View>
  23. </View>
  24. <View class="do-content">
  25. <View class="do-p">
  26. <View class="k">预计奖励</View>
  27. <View class="v b">{{allObj.brokerage}}</View>
  28. </View>
  29. <!-- <View class="do-p">
  30. <View class="k">营销中心</View>
  31. <View class="v">{{allObj.address}}</View>
  32. </View>
  33. <View class="do-p">
  34. <View class="k">销售热线</View>
  35. <View class="v">{{allObj.marketing_phone}}</View>
  36. </View> -->
  37. <View class="do-p">
  38. <View class="k">带看需收集</View>
  39. <View class="v">{{allObj.report_visit}}</View>
  40. </View>
  41. <View class="do-p">
  42. <View class="k">报备保护期</View>
  43. <View class="v">{{allObj.report_lock}}天</View>
  44. </View>
  45. <View class="do-p">
  46. <View class="k">带看保护期</View>
  47. <View class="v">{{allObj.lead_lock}}天</View>
  48. </View>
  49. </View>
  50. </View>
  51. <View class="dtl-options">
  52. <View class="do-title">
  53. <View class="t">带看单&流程</View>
  54. </View>
  55. <View class="do-content">
  56. <View class="do-p">
  57. <rich-text :nodes="curHtml | filtersRichText"></rich-text>
  58. </View>
  59. </View>
  60. </View>
  61. <View class="dtl-options">
  62. <View class="do-title">
  63. <View class="t">楼盘详细信息</View>
  64. </View>
  65. <View class="do-content">
  66. <View class="do-p">
  67. <View class="k">所属区域</View>
  68. <View class="v">{{atObj[curObj.area_type]}}</View>
  69. </View>
  70. <View class="do-p">
  71. <View class="k">参考价格</View>
  72. <View class="v">{{curObj.price_range}}/㎡</View>
  73. </View>
  74. <View class="do-p">
  75. <View class="k">户型面积</View>
  76. <View class="v">{{curObj.built_area}}㎡</View>
  77. </View>
  78. <View class="do-p">
  79. <View class="k">楼栋数</View>
  80. <View class="v">{{curObj.seat_sum}}栋</View>
  81. </View>
  82. <View class="do-p">
  83. <View class="k">产权年限</View>
  84. <View class="v">{{curObj.ownership || '未知'}}</View>
  85. </View>
  86. <View class="do-p">
  87. <View class="k">初次交付</View>
  88. <View class="v">{{curObj.deliver_time || '未知'}}</View>
  89. </View>
  90. <View class="do-p">
  91. <View class="k">建设时间</View>
  92. <View class="v">{{curObj.build_time || '未知'}}</View>
  93. </View>
  94. <View class="do-p">
  95. <View class="k">竣工时间</View>
  96. <View class="v">{{curObj.complete_time || '未知'}}</View>
  97. </View>
  98. <View class="do-p">
  99. <View class="k">占地面积</View>
  100. <View class="v">{{curObj.acreage}}㎡</View>
  101. </View>
  102. <View class="do-p">
  103. <View class="k">建筑面积</View>
  104. <View class="v">{{curObj.built_up_area}}㎡</View>
  105. </View>
  106. <View class="do-p">
  107. <View class="k">开发商</View>
  108. <View class="v">{{curObj.developer}}</View>
  109. </View>
  110. <View class="do-p">
  111. <View class="k">物业公司</View>
  112. <View class="v">{{curObj.property_type || '未知'}}</View>
  113. </View>
  114. <View class="do-p">
  115. <View class="k">物业费</View>
  116. <View class="v">{{curObj.property_fee || '未知'}}</View>
  117. </View>
  118. <View class="do-p">
  119. <View class="k">总户数</View>
  120. <View class="v">{{curObj.household || '未知'}}</View>
  121. </View>
  122. <View class="do-p">
  123. <View class="k">车位数</View>
  124. <View class="v">{{curObj.parking || '未知'}}</View>
  125. </View>
  126. <View class="do-p">
  127. <View class="k">容积率</View>
  128. <View class="v">{{curObj.plot_ratio}}</View>
  129. </View>
  130. <View class="do-p">
  131. <View class="k">绿化率</View>
  132. <View class="v">{{curObj.green_rate || '未知'}}%</View>
  133. </View>
  134. <View class="do-p">
  135. <View class="k">楼盘简介</View>
  136. <View class="v">{{curObj.remarked || '暂无'}}</View>
  137. </View>
  138. <View class="do-p">
  139. <View class="k">产品户型</View>
  140. <View class="v">
  141. <View class="scoped-house-type">
  142. <View v-for="(one, oIndex) in curObj.area_data" :key="oIndex" class="sht-one">
  143. <View class="sht-one-title">{{ptObj[one.product_type_val]}}</View>
  144. <View class="sht-two" v-for="(two, index2) in one.house_type_list" :key="index2">
  145. <View class="sht-two-title">{{htObj[two.house_type_val]}}</View>
  146. <View class="sht-area" v-for="(three, index3) in two.area_list" :key="index3">
  147. <Image class="img" :src="three.img_url + '_xs'" @click="previewImageHandle(three.img_url, two.area_list)" />
  148. <View class="t">建面:{{three.area}}㎡</View>
  149. </View>
  150. </View>
  151. </View>
  152. </View>
  153. </View>
  154. </View>
  155. </View>
  156. </View>
  157. <View class="dtl-options">
  158. <View class="do-title">
  159. <View class="t">一页纸&更多</View>
  160. </View>
  161. <View class="do-content">
  162. <view class="scoped-more-box">
  163. <!-- <u-image src="/static/index/popup_bg_more.png" mode="heightFix" height="118rpx" class="icon"></u-image> -->
  164. <view class="plus" @click="oneImgHandle()">楼盘一页纸>></view>
  165. <view class="plus" @click="linkPlus()">查看更多该楼盘的(学区、地铁、航拍户型VR等等)信息,点击这里>></view>
  166. </view>
  167. </View>
  168. </View>
  169. <View class="scoped-sale">
  170. <View class="ss-img">
  171. <Image :src="saleObj.avatar || 'https://img2.honglounews.com/20220515083230-1148.jpg'" class="img"/>
  172. </View>
  173. <View class="ss-info">
  174. <View class="p1">{{saleObj.nickname || '巴老师'}}</View>
  175. <View class="p2">该楼盘咨询我</View>
  176. </View>
  177. <View class="ss-r">
  178. <View class="b t2" @click="callHandle(saleObj)">打电话</View>
  179. </View>
  180. </View>
  181. <backTop :src="backTop.src" :scrollTop="backTop.scrollTop"></backTop>
  182. </view>
  183. </template>
  184. <script>
  185. import backTop from '@/components/back-top/back-top.vue'
  186. import wmWatermark from '@/components/wm-watermark/wm-watermark.vue'
  187. import { arrToObj } from '@/utils'
  188. export default {
  189. components: {
  190. backTop,
  191. wmWatermark
  192. },
  193. data() {
  194. return {
  195. allObj: {},
  196. curId: '',
  197. curObj: {},
  198. saleObj: {},
  199. atObj: {},
  200. ptObj: {},
  201. htObj: {},
  202. curHtml: '',
  203. backTop: {
  204. src: '../../static/back-top/top.png',
  205. scrollTop: 0
  206. },
  207. userInfo: {},
  208. };
  209. },
  210. filters: {
  211. filtersRichText(html) { //控制小程序中图片大小
  212. let newContent = html.replace(/<img[^>]*>/gi, (match, capture)=>{
  213. match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
  214. match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
  215. match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
  216. return match;
  217. });
  218. newContent = newContent.replace(/style="[^"]+"/gi, (match, capture)=>{
  219. match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
  220. return match;
  221. });
  222. newContent = newContent.replace(/<br[^>]*\/>/gi, '');
  223. newContent = newContent.replace(/\<img/gi,
  224. '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
  225. return newContent;
  226. }
  227. },
  228. onPageScroll(e) {
  229. this.scrollTop = e.scrollTop;
  230. this.backTop.scrollTop = e.scrollTop;
  231. },
  232. onLoad(params) {
  233. this.curId = params.id
  234. uni.api.estate.apiestatedetail({
  235. id: this.curId
  236. }).then(res => {
  237. this.allObj = res || {}
  238. this.curObj = res.plus_estate || {}
  239. this.saleObj = res.manage_user || {}
  240. })
  241. uni.api.estate.apiestatecontentdetail({id: this.curId}).then(res => {
  242. this.curHtml = res.content || ''
  243. })
  244. const userInfo2 = uni.getStorageSync('MD_userInfo2')
  245. this.userInfo = userInfo2 || {}
  246. },
  247. created () {
  248. const dictObj = uni.getStorageSync('MD_dict')
  249. this.atObj = arrToObj(dictObj.area_type)
  250. this.ptObj = arrToObj(dictObj.product_type)
  251. this.htObj = arrToObj(dictObj.house_type)
  252. },
  253. // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
  254. onReady() {
  255. },
  256. computed: {
  257. },
  258. methods: {
  259. linkPlus () {
  260. uni.navigateToMiniProgram({
  261. appId: 'wx91a710fad8c5eb22',
  262. path: `pagesHouse/indexDtl?id=${this.curObj.id}&fromViews=search`,
  263. // extraData: {
  264. // 'data1': 'test'
  265. // },
  266. success(res) {
  267. // 打开成功
  268. }
  269. })
  270. },
  271. oneImgHandle () {
  272. uni.api.estate.apiestateinfodetail({id: this.curId}).then(res => {
  273. const curImgUrl = res.info_img || ''
  274. if (!curImgUrl) {
  275. uni.$msg('该楼盘暂未设置一页纸楼盘简介~')
  276. return
  277. }
  278. uni.previewImage({
  279. current: curImgUrl,
  280. urls: [curImgUrl],
  281. })
  282. })
  283. },
  284. callHandle (saleObj) {
  285. uni.makePhoneCall({
  286. phoneNumber: saleObj.phone || '18100792072'
  287. })
  288. },
  289. previewImageHandle (cur, arr) {
  290. const current = `${cur}_plus`
  291. const urls = arr.map(item => {
  292. return `${item.img_url}_plus`
  293. })
  294. uni.previewImage({
  295. current,
  296. urls
  297. })
  298. }
  299. }
  300. };
  301. </script>
  302. <style lang="scss" scoped>
  303. .l-box {
  304. padding-bottom: 140rpx;
  305. }
  306. .dtl-header {
  307. position: relative;
  308. overflow: hidden;
  309. .dh-bg {
  310. position: absolute;
  311. top: 0;
  312. left: 0;
  313. right: 0;
  314. z-index: -1;
  315. width: 100%;
  316. height: 500rpx;
  317. }
  318. .dh-content {
  319. border-radius: 20rpx;
  320. box-sizing: border-box;
  321. padding: 20rpx;
  322. margin: 10rpx;
  323. background-color: #fff;
  324. margin-top: 400rpx;
  325. z-index: 2;
  326. .i {
  327. display: inline-block;
  328. vertical-align: middle;
  329. width: 30rpx;
  330. height: 30rpx;
  331. margin-right: 10rpx;
  332. }
  333. .t {
  334. display: inline-block;
  335. vertical-align: middle;
  336. }
  337. }
  338. .dh-p1 {
  339. color: #333;
  340. font-size: 30rpx;
  341. padding-bottom: 10rpx;
  342. }
  343. .dh-p2 {
  344. color: #666;
  345. font-size: 26rpx;
  346. padding-bottom: 20rpx;
  347. }
  348. .dh-sign {
  349. .s {
  350. display: inline-block;
  351. vertical-align: middle;
  352. color: #fff;
  353. background: #0259e7;
  354. font-size: 24rpx;
  355. border-radius: 10rpx;
  356. padding: 6rpx 10rpx;
  357. margin-right: 10rpx;
  358. margin-bottom: 10rpx;
  359. &:last-child {
  360. margin-right: 0;
  361. }
  362. &.t-shop {
  363. background: #FFC82C;
  364. }
  365. &.t-park {
  366. background: #13CE66;
  367. }
  368. }
  369. }
  370. }
  371. .dtl-options {
  372. background: #fff;
  373. margin-bottom: 20rpx;
  374. position: relative;
  375. &:last-child {
  376. margin-bottom: 0;
  377. }
  378. .do-title {
  379. padding: 20rpx 20rpx 10rpx;
  380. position: relative;
  381. .t {
  382. display: inline-block;
  383. vertical-align: top;
  384. font-size: 30rpx;
  385. height: 30rpx;
  386. line-height: 30rpx;
  387. overflow: hidden;
  388. border-left: 4PX solid #0259e7;
  389. padding-left: 10rpx;
  390. font-weight: bold;
  391. }
  392. .s {
  393. display: inline-block;
  394. vertical-align: top;
  395. color: #999;
  396. font-size: 28rpx;
  397. text-decoration: underline;
  398. padding-left: 20rpx;
  399. }
  400. .r {
  401. position: absolute;
  402. top: 20rpx;
  403. right: 20rpx;
  404. font-size: 28rpx;
  405. color: #999;
  406. }
  407. }
  408. .do-content {
  409. padding: 0 20rpx 0;
  410. }
  411. .do-p {
  412. display: flex;
  413. padding: 10rpx;
  414. // &:nth-child(2n) {
  415. // background: #f2f2f2;
  416. // }
  417. .k {
  418. width: 26%;
  419. color: #9b9b9b;
  420. }
  421. .v {
  422. width: 74%;
  423. text-align: left;
  424. color: #313131;
  425. &.b {
  426. color: #f00;
  427. font-weight: bold;
  428. font-size: 30rpx;
  429. }
  430. }
  431. .v-item {
  432. .n {
  433. display: inline-block;
  434. color: #0259e7;
  435. }
  436. }
  437. }
  438. }
  439. .scoped-house-type {
  440. .sht-one {
  441. margin-bottom: 20rpx;
  442. }
  443. .sht-one-title {
  444. font-weight: bold;
  445. }
  446. .sht-two {
  447. padding: 10rpx 10rpx 0 20rpx;
  448. margin-top: 10rpx;
  449. background: #f9f9f9;
  450. }
  451. .sht-area {
  452. padding-left: 10rpx;
  453. padding-top: 10rpx;
  454. }
  455. .sht-one-title {
  456. font-weight: bold;
  457. color: #666;
  458. }
  459. .sht-two-title {
  460. font-weight: bold;
  461. color: #666;
  462. font-size: 24rpx;
  463. }
  464. .sht-area {
  465. display: inline-block;
  466. vertical-align: middle;
  467. .img {
  468. width: 100rpx;
  469. height: 100rpx;
  470. }
  471. .t {
  472. margin-top: -10rpx;
  473. text-align: center;
  474. color: #999;
  475. font-size: 22rpx;
  476. }
  477. }
  478. }
  479. .scoped-sale {
  480. position: fixed;
  481. left: 0;
  482. bottom: 0;
  483. width: 100%;
  484. height: 140rpx;
  485. background: #fff;
  486. display: flex;
  487. box-sizing: border-box;
  488. padding: 20rpx;
  489. z-index: 99;
  490. border: 1PX solid #f2f2f2;
  491. .ss-img {
  492. width: 90rpx;
  493. height: 90rpx;
  494. border-radius: 50%;
  495. overflow: hidden;
  496. margin-right: 20rpx;
  497. .img {
  498. width: 90rpx;
  499. height: 90rpx;
  500. border-radius: 50%;
  501. overflow: hidden;
  502. }
  503. }
  504. .ss-info {
  505. flex: 1;
  506. .p1 {
  507. color: #313131;
  508. font-weight: bold;
  509. font-size: 30rpx;
  510. padding-bottom: 6rpx;
  511. padding-left: 10rpx;
  512. }
  513. .p2 {
  514. display: inline-block;
  515. padding: 6rpx 10rpx;
  516. color: #8b94b1;
  517. background: #eceff5;
  518. font-size: 24rpx;
  519. border-radius: 10rpx;
  520. }
  521. }
  522. .ss-r {
  523. width: 350rpx;
  524. display: flex;
  525. padding-top: 10rpx;
  526. justify-content: space-between;
  527. .b {
  528. // width: 170rpx;
  529. width: 100%;
  530. height: 80rpx;
  531. line-height: 80rpx;
  532. text-align: center;
  533. background: #3bc48b;
  534. color: #fff;
  535. border-radius: 10rpx;
  536. &.t2 {
  537. background: #3072f6;
  538. }
  539. }
  540. }
  541. }
  542. .scoped-more-box {
  543. width: 100%;
  544. .plus {
  545. color: #0259e7;
  546. font-size: 34rpx;
  547. text-decoration: underline;
  548. font-weight: bold;
  549. padding: 30rpx 0;
  550. }
  551. }
  552. </style>