dtl.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  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-sale">
  174. <View class="ss-img">
  175. <Image :src="saleObj.avatar || 'https://img2.honglounews.com/20220515083230-1148.jpg'" class="img"/>
  176. </View>
  177. <View class="ss-info">
  178. <View class="p1">{{saleObj.nickname || '巴老师'}}</View>
  179. <View class="p2">该楼盘咨询我</View>
  180. </View>
  181. <View class="ss-r">
  182. <View class="b t2" @click="callHandle(saleObj)">打电话</View>
  183. <View class="b" @click="toAgentHandle">立即报备</View>
  184. </View>
  185. </View>
  186. <backTop :src="backTop.src" :scrollTop="backTop.scrollTop"></backTop>
  187. </view>
  188. </template>
  189. <script>
  190. import backTop from '@/components/back-top/back-top.vue'
  191. import wmWatermark from '@/components/wm-watermark/wm-watermark.vue'
  192. import { arrToObj } from '@/utils'
  193. export default {
  194. components: {
  195. backTop,
  196. wmWatermark
  197. },
  198. data() {
  199. return {
  200. allObj: {},
  201. curId: '',
  202. curObj: {},
  203. saleObj: {},
  204. atObj: {},
  205. ptObj: {},
  206. htObj: {},
  207. curHtml: '',
  208. backTop: {
  209. src: '../../static/back-top/top.png',
  210. scrollTop: 0
  211. },
  212. userInfo: {},
  213. };
  214. },
  215. filters: {
  216. filtersRichText(html) { //控制小程序中图片大小
  217. let newContent = html.replace(/<img[^>]*>/gi, (match, capture)=>{
  218. match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
  219. match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
  220. match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
  221. return match;
  222. });
  223. newContent = newContent.replace(/style="[^"]+"/gi, (match, capture)=>{
  224. match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
  225. return match;
  226. });
  227. newContent = newContent.replace(/<br[^>]*\/>/gi, '');
  228. newContent = newContent.replace(/\<img/gi,
  229. '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
  230. return newContent;
  231. }
  232. },
  233. onPageScroll(e) {
  234. this.scrollTop = e.scrollTop;
  235. this.backTop.scrollTop = e.scrollTop;
  236. },
  237. onLoad(params) {
  238. this.curId = params.id
  239. uni.api.estate.apiestatedetail({
  240. id: this.curId
  241. }).then(res => {
  242. this.allObj = res || {}
  243. this.curObj = res.plus_estate || {}
  244. this.saleObj = res.manage_user || {}
  245. })
  246. uni.api.estate.apiestatecontentdetail({id: this.curId}).then(res => {
  247. this.curHtml = res.content || ''
  248. })
  249. const userInfo2 = uni.getStorageSync('MD_userInfo2')
  250. this.userInfo = userInfo2 || {}
  251. },
  252. created () {
  253. const dictObj = uni.getStorageSync('MD_dict')
  254. this.atObj = arrToObj(dictObj.area_type)
  255. this.ptObj = arrToObj(dictObj.product_type)
  256. this.htObj = arrToObj(dictObj.house_type)
  257. },
  258. // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
  259. onReady() {
  260. },
  261. computed: {
  262. },
  263. methods: {
  264. linkPlus () {
  265. uni.navigateToMiniProgram({
  266. appId: 'wx91a710fad8c5eb22',
  267. path: `pagesHouse/indexDtl?id=${this.curObj.id}&fromViews=search`,
  268. // extraData: {
  269. // 'data1': 'test'
  270. // },
  271. success(res) {
  272. // 打开成功
  273. }
  274. })
  275. },
  276. oneImgHandle () {
  277. uni.api.estate.apiestateinfodetail({id: this.curId}).then(res => {
  278. const curImgUrl = res.info_img || ''
  279. if (!curImgUrl) {
  280. uni.$msg('该楼盘暂未设置一页纸楼盘简介~')
  281. return
  282. }
  283. uni.previewImage({
  284. current: curImgUrl,
  285. urls: [curImgUrl],
  286. })
  287. })
  288. },
  289. callHandle (saleObj) {
  290. uni.makePhoneCall({
  291. phoneNumber: saleObj.phone || '18100792072'
  292. })
  293. },
  294. toAgentHandle () {
  295. uni.navigateTo({
  296. url: '/pages/agent/recommend/create'
  297. })
  298. },
  299. previewImageHandle (cur, arr) {
  300. const current = `${cur}_plus`
  301. const urls = arr.map(item => {
  302. return `${item.img_url}_plus`
  303. })
  304. uni.previewImage({
  305. current,
  306. urls
  307. })
  308. }
  309. }
  310. };
  311. </script>
  312. <style lang="scss" scoped>
  313. .l-box {
  314. padding-bottom: 140rpx;
  315. }
  316. .dtl-header {
  317. position: relative;
  318. overflow: hidden;
  319. .dh-bg {
  320. position: absolute;
  321. top: 0;
  322. left: 0;
  323. right: 0;
  324. z-index: -1;
  325. width: 100%;
  326. height: 500rpx;
  327. }
  328. .dh-content {
  329. border-radius: 20rpx;
  330. box-sizing: border-box;
  331. padding: 20rpx;
  332. margin: 10rpx;
  333. background-color: #fff;
  334. margin-top: 400rpx;
  335. z-index: 2;
  336. .i {
  337. display: inline-block;
  338. vertical-align: middle;
  339. width: 30rpx;
  340. height: 30rpx;
  341. margin-right: 10rpx;
  342. }
  343. .t {
  344. display: inline-block;
  345. vertical-align: middle;
  346. }
  347. }
  348. .dh-p1 {
  349. color: #333;
  350. font-size: 30rpx;
  351. padding-bottom: 10rpx;
  352. }
  353. .dh-p2 {
  354. color: #666;
  355. font-size: 26rpx;
  356. padding-bottom: 20rpx;
  357. }
  358. .dh-sign {
  359. .s {
  360. display: inline-block;
  361. vertical-align: middle;
  362. color: #fff;
  363. background: #0259e7;
  364. font-size: 24rpx;
  365. border-radius: 10rpx;
  366. padding: 6rpx 10rpx;
  367. margin-right: 10rpx;
  368. margin-bottom: 10rpx;
  369. &:last-child {
  370. margin-right: 0;
  371. }
  372. &.t-shop {
  373. background: #FFC82C;
  374. }
  375. &.t-park {
  376. background: #13CE66;
  377. }
  378. }
  379. }
  380. }
  381. .dtl-options {
  382. background: #fff;
  383. margin-bottom: 20rpx;
  384. position: relative;
  385. &:last-child {
  386. margin-bottom: 0;
  387. }
  388. .do-title {
  389. padding: 20rpx 20rpx 10rpx;
  390. position: relative;
  391. .t {
  392. display: inline-block;
  393. vertical-align: top;
  394. font-size: 30rpx;
  395. height: 30rpx;
  396. line-height: 30rpx;
  397. overflow: hidden;
  398. border-left: 4PX solid #0259e7;
  399. padding-left: 10rpx;
  400. font-weight: bold;
  401. }
  402. .s {
  403. display: inline-block;
  404. vertical-align: top;
  405. color: #999;
  406. font-size: 28rpx;
  407. text-decoration: underline;
  408. padding-left: 20rpx;
  409. }
  410. .r {
  411. position: absolute;
  412. top: 20rpx;
  413. right: 20rpx;
  414. font-size: 28rpx;
  415. color: #999;
  416. }
  417. }
  418. .do-content {
  419. padding: 0 20rpx 0;
  420. }
  421. .do-p {
  422. display: flex;
  423. padding: 10rpx;
  424. // &:nth-child(2n) {
  425. // background: #f2f2f2;
  426. // }
  427. .k {
  428. width: 26%;
  429. color: #9b9b9b;
  430. }
  431. .v {
  432. width: 74%;
  433. text-align: left;
  434. color: #313131;
  435. &.b {
  436. color: #f00;
  437. font-weight: bold;
  438. font-size: 30rpx;
  439. }
  440. }
  441. .v-item {
  442. .n {
  443. display: inline-block;
  444. color: #0259e7;
  445. }
  446. }
  447. }
  448. }
  449. .scoped-house-type {
  450. .sht-one {
  451. margin-bottom: 20rpx;
  452. }
  453. .sht-one-title {
  454. font-weight: bold;
  455. }
  456. .sht-two {
  457. padding: 10rpx 10rpx 0 20rpx;
  458. margin-top: 10rpx;
  459. background: #f9f9f9;
  460. }
  461. .sht-area {
  462. padding-left: 10rpx;
  463. padding-top: 10rpx;
  464. }
  465. .sht-one-title {
  466. font-weight: bold;
  467. color: #666;
  468. }
  469. .sht-two-title {
  470. font-weight: bold;
  471. color: #666;
  472. font-size: 24rpx;
  473. }
  474. .sht-area {
  475. display: inline-block;
  476. vertical-align: middle;
  477. .img {
  478. width: 100rpx;
  479. height: 100rpx;
  480. }
  481. .t {
  482. margin-top: -10rpx;
  483. text-align: center;
  484. color: #999;
  485. font-size: 22rpx;
  486. }
  487. }
  488. }
  489. .scoped-sale {
  490. position: fixed;
  491. left: 0;
  492. bottom: 0;
  493. width: 100%;
  494. height: 140rpx;
  495. background: #fff;
  496. display: flex;
  497. box-sizing: border-box;
  498. padding: 20rpx;
  499. z-index: 99;
  500. border: 1PX solid #f2f2f2;
  501. .ss-img {
  502. width: 90rpx;
  503. height: 90rpx;
  504. border-radius: 50%;
  505. overflow: hidden;
  506. margin-right: 20rpx;
  507. .img {
  508. width: 90rpx;
  509. height: 90rpx;
  510. border-radius: 50%;
  511. overflow: hidden;
  512. }
  513. }
  514. .ss-info {
  515. flex: 1;
  516. .p1 {
  517. color: #313131;
  518. font-weight: bold;
  519. font-size: 30rpx;
  520. padding-bottom: 6rpx;
  521. padding-left: 10rpx;
  522. }
  523. .p2 {
  524. display: inline-block;
  525. padding: 6rpx 10rpx;
  526. color: #8b94b1;
  527. background: #eceff5;
  528. font-size: 24rpx;
  529. border-radius: 10rpx;
  530. }
  531. }
  532. .ss-r {
  533. width: 350rpx;
  534. display: flex;
  535. padding-top: 10rpx;
  536. justify-content: space-between;
  537. .b {
  538. // width: 170rpx;
  539. width: 100%;
  540. height: 80rpx;
  541. line-height: 80rpx;
  542. text-align: center;
  543. background: #3bc48b;
  544. color: #fff;
  545. border-radius: 10rpx;
  546. &.t2 {
  547. margin-right: 12rpx;
  548. background: #3072f6;
  549. }
  550. }
  551. }
  552. }
  553. .scoped-more-box {
  554. width: 100%;
  555. .plus {
  556. color: #0259e7;
  557. font-size: 34rpx;
  558. text-decoration: underline;
  559. font-weight: bold;
  560. padding: 30rpx 0;
  561. }
  562. }
  563. </style>