dtl.vue 15 KB

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