housedetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. <template>
  2. <div class="housedetails" style="padding-bottom: 500rpx">
  3. <div class="list-row">
  4. <div class="cell_1">
  5. <div class="width100 mb8rpx">
  6. <div class="first_title">
  7. {{
  8. form.groupName + form.floorDiscName + form.buildName + form.roomNo
  9. }}
  10. </div>
  11. </div>
  12. <div class="width100 mb8rpx chuzuborder">
  13. <div style="display: flex">
  14. <div class="float_left chuzu_label">出租指导价(元/㎡/月):</div>
  15. <div class="float_left chuzu_vlaue">
  16. {{ form.guidePrice ? form.guidePrice : "未知" }}
  17. </div>
  18. </div>
  19. <div style="display: flex">
  20. <div class="float_left">承重:</div>
  21. <div class="float_left chuzu_vlaue">
  22. {{ form.bearing ? form.bearing : "未知" }}
  23. </div>
  24. </div>
  25. <div style="display: flex">
  26. <div class="float_left">层高:</div>
  27. <div
  28. class="float_left chuzu_vlaue"
  29. style="white-space: normal; width: auto"
  30. >
  31. {{ form.floorHeight ? form.floorHeight : "未知" }}
  32. </div>
  33. </div>
  34. <div style="display: flex">
  35. <div class="float_left">用电:</div>
  36. <div class="float_left chuzu_vlaue">
  37. {{ form.electricity ? form.electricity : "未知" }}
  38. </div>
  39. </div>
  40. <div style="display: flex; margin: 20rpx 0">
  41. <div class="roomstatus">
  42. {{
  43. form.propertyNature
  44. ? getDicType("zaiti", form.propertyNature)
  45. : "暂无"
  46. }}
  47. </div>
  48. <div class="roomstatus" v-if="form.currentState == '1'">空置</div>
  49. <div class="roomstatus" v-if="form.currentState == '2'">锁定</div>
  50. <div class="roomstatus" v-if="form.currentState == '3'">预约</div>
  51. <div class="roomstatus" v-if="form.currentState == '4'">临期</div>
  52. <div class="roomstatus" v-if="form.currentState == '5'">已租</div>
  53. <div class="roomstatus" v-if="form.currentState == '6'">到期</div>
  54. </div>
  55. </div>
  56. <div class="width100 pdt32 pdb32 chuzuborder">
  57. <van-row>
  58. <van-col :span="8">
  59. <div class="yongtu_first_title">
  60. {{
  61. form.roomUse ? getDicType("roomUse", form.roomUse) : "暂无"
  62. }}
  63. </div>
  64. <div class="yongtu_second_title">用途</div>
  65. </van-col>
  66. <van-col :span="8">
  67. <div class="yongtu_first_title">
  68. {{ form.direction ? form.direction : "暂无" }}
  69. </div>
  70. <div class="yongtu_second_title">朝向</div>
  71. </van-col>
  72. <van-col :span="8">
  73. <div class="yongtu_first_title">
  74. {{ form.size ? form.size : "暂无" }}
  75. </div>
  76. <div class="yongtu_second_title">面积(m²)</div>
  77. </van-col>
  78. </van-row>
  79. </div>
  80. <!-- <div class="width100 pdt32 height50rpx pdb32 chuzuborder">
  81. </div> -->
  82. <div class="width100 pdt32 pdb32 chuzuborder">
  83. <van-row>
  84. <van-col :span="5">
  85. <div style="white-space: nowrap">装修情况</div>
  86. </van-col>
  87. <van-col :span="19">
  88. <span>
  89. {{
  90. !form.decorationSituation ||
  91. form.decorationSituation == "暂无"
  92. ? "未知"
  93. : dic_SelectList.DECORATION_SITUATION[
  94. form.decorationSituation - 1
  95. ].label
  96. }}
  97. </span>
  98. </van-col>
  99. </van-row>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="project-column pdt32 pdl32 pdr32">
  104. <div class="pdb16 chuzuborder">房型图</div>
  105. </div>
  106. <div class="housepicture">
  107. <img
  108. class="picList"
  109. v-if="planPictureList.length > 0"
  110. @click="previewImage(item.url)"
  111. v-for="(item, index) in planPictureList"
  112. :key="index"
  113. :src="item.url"
  114. alt=""
  115. />
  116. <div class="housepicture">
  117. <van-empty
  118. v-if="planPictureList.length == 0"
  119. style="width: 100%"
  120. image="error"
  121. description="暂无房型图"
  122. />
  123. </div>
  124. </div>
  125. <div class="project-column pdt32 pdl32 pdr32">
  126. <div class="pdb16 chuzuborder">室外环境</div>
  127. </div>
  128. <div class="housepicture">
  129. <img
  130. class="picList"
  131. v-if="environmentPictureList.length != 0"
  132. @click="previewImage1(item.url)"
  133. v-for="(item, index) in environmentPictureList"
  134. :key="index"
  135. :src="item.url"
  136. alt=""
  137. />
  138. <van-empty
  139. v-if="environmentPictureList.length == 0"
  140. style="width: 100%"
  141. image="error"
  142. description="暂无室外环境图"
  143. />
  144. </div>
  145. <div class="project-column pdt32 pdl32 pdr32">
  146. <div class="pdb16 chuzuborder">已锁定项目</div>
  147. </div>
  148. <div class="list-row" v-if="list.length == 0">
  149. <van-empty style="width: 100%" image="error" description="暂未锁定" />
  150. </div>
  151. <div v-if="list.length > 0" class="list-row" v-for="item in list">
  152. <div class="cell_1">
  153. <div class="width100 height44rpx mb8rpx">
  154. <div class="first_title float_left chaochuyincang">
  155. {{ item.projectName }}
  156. </div>
  157. <div class="width20 float_left">
  158. <div
  159. class="button_primary float_right"
  160. v-if="item.reservationStatus == 2"
  161. >
  162. 锁定
  163. </div>
  164. <div
  165. class="button_primary float_right"
  166. v-if="item.reservationStatus == 7"
  167. >
  168. 已解锁
  169. </div>
  170. <div
  171. class="button_primary float_right"
  172. v-if="item.reservationStatus == '3'"
  173. >
  174. 预约
  175. </div>
  176. <div
  177. class="button_primary float_right"
  178. v-if="item.reservationStatus == '4'"
  179. >
  180. 临期
  181. </div>
  182. <div
  183. class="button_primary float_right"
  184. v-if="item.reservationStatus == '5'"
  185. >
  186. 已租
  187. </div>
  188. <div
  189. class="button_primary float_right"
  190. v-if="item.reservationStatus == '6'"
  191. >
  192. 到期
  193. </div>
  194. </div>
  195. </div>
  196. <div class="width100 height44rpx mb8rpx">
  197. <div class="second_title width100">
  198. 联系人:{{ item.projectManager }}
  199. </div>
  200. </div>
  201. <div class="width100 height44rpx mb8rpx">
  202. <div class="second_title width100">
  203. 联系电话:{{ item.managerPhone }}
  204. </div>
  205. </div>
  206. <div class="width100 height44rpx mb8rpx">
  207. <div class="second_title width100">
  208. 项目介绍:{{ item.projectInfo }}…
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. <view class="btn-view">
  214. <div
  215. v-if="form.currentState == '1'"
  216. class="btn"
  217. @click="jumpCreatedProject()"
  218. >
  219. 去预约
  220. </div>
  221. <button class="btn btn-disable" v-else @click="jumpCreatedProject()">
  222. 去预约
  223. </button>
  224. </view>
  225. </div>
  226. </template>
  227. <script>
  228. import { getByCodes, getRoomInfo, listByModel } from "@/js_sdk/http";
  229. export default {
  230. components: {},
  231. data() {
  232. return {
  233. dic_key: ["PROPERTY_NATURE", "HOUSE_USAGE", "DECORATION_SITUATION"],
  234. dic_SelectList: {},
  235. search: {
  236. pageSize: 10,
  237. pageNum: 1,
  238. },
  239. form: {
  240. id: "",
  241. },
  242. roomId: "",
  243. list: [],
  244. info: [
  245. {
  246. colorClass: "uni-bg-red",
  247. url: "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",
  248. content: "内容 A",
  249. },
  250. {
  251. colorClass: "uni-bg-green",
  252. url: "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",
  253. content: "内容 B",
  254. },
  255. {
  256. colorClass: "uni-bg-blue",
  257. url: "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",
  258. content: "内容 C",
  259. },
  260. ],
  261. dotStyle: [
  262. {
  263. backgroundColor: "rgba(0, 0, 0, .3)",
  264. border: "1px rgba(0, 0, 0, .3) solid",
  265. color: "#fff",
  266. selectedBackgroundColor: "rgba(0, 0, 0, .9)",
  267. selectedBorder: "1px rgba(0, 0, 0, .9) solid",
  268. },
  269. {
  270. backgroundColor: "rgba(255, 90, 95,0.3)",
  271. border: "1px rgba(255, 90, 95,0.3) solid",
  272. color: "#fff",
  273. selectedBackgroundColor: "rgba(255, 90, 95,0.9)",
  274. selectedBorder: "1px rgba(255, 90, 95,0.9) solid",
  275. },
  276. {
  277. backgroundColor: "rgba(83, 200, 249,0.3)",
  278. border: "1px rgba(83, 200, 249,0.3) solid",
  279. color: "#fff",
  280. selectedBackgroundColor: "rgba(83, 200, 249,0.9)",
  281. selectedBorder: "1px rgba(83, 200, 249,0.9) solid",
  282. },
  283. ],
  284. modeIndex: -1,
  285. styleIndex: -1,
  286. current: 0,
  287. mode: "default",
  288. dotsStyles: {},
  289. planPictureList: [],
  290. environmentPictureList: [],
  291. swiperDotIndex: 0,
  292. };
  293. },
  294. onLoad(options) {
  295. this.getByCodes();
  296. this.form.id = options.id;
  297. getRoomInfo(options.id).then((e) => {
  298. this.form = e;
  299. this.roomId = e.id;
  300. this.form.currentState = options.currentState;
  301. console.log(e.planPicture);
  302. if (e.planPicture && e.planPicture.length != 0) {
  303. this.planPictureList = e.planPicture
  304. .split(",")
  305. .filter((e) => e.length > 0)
  306. .map((e) => {
  307. console.log(e.length);
  308. return {
  309. isShow: e.length == 0 ? false : true,
  310. url: this.$constant.BASE_URI + "/FileController/download/" + e,
  311. };
  312. });
  313. } else {
  314. this.planPictureList = [];
  315. }
  316. if (e.environmentPicture && e.environmentPicture.length != 0) {
  317. this.environmentPictureList = e.environmentPicture
  318. .split(",")
  319. .filter((e) => e.length > 0)
  320. .map((e) => {
  321. return {
  322. isShow: e.length == 0 ? false : true,
  323. url: this.$constant.BASE_URI + "/FileController/download/" + e,
  324. };
  325. });
  326. } else {
  327. this.environmentPictureList = [];
  328. }
  329. listByModel({ parkRoomId: this.form.id, ...this.search }).then((e) => {
  330. this.list = e;
  331. console.log(this.list);
  332. });
  333. });
  334. //
  335. console.log({ id: this.form.id, ...this.search });
  336. },
  337. methods: {
  338. previewImage(url = null) {
  339. let pictureList = [];
  340. for (let i = 0; i < this.planPictureList.length; i++) {
  341. if (this.planPictureList[i].isShow) {
  342. pictureList.push(this.planPictureList[i].url);
  343. }
  344. }
  345. console.log(pictureList);
  346. uni.previewImage({
  347. urls: pictureList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  348. current: url, // 当前显示图片的http链接,默认是第一个
  349. success: function (res) {
  350. console.log(res);
  351. },
  352. fail: function (res) {},
  353. complete: function (res) {
  354. console.log(res);
  355. },
  356. });
  357. },
  358. previewImage1(url = null) {
  359. let pictureList = [];
  360. for (let i = 0; i < this.environmentPictureList.length; i++) {
  361. if (this.environmentPictureList[i].isShow) {
  362. pictureList.push(this.environmentPictureList[i].url);
  363. }
  364. }
  365. console.log(pictureList);
  366. uni.previewImage({
  367. urls: pictureList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  368. current: url, // 当前显示图片的http链接,默认是第一个
  369. success: function (res) {
  370. console.log(res);
  371. },
  372. fail: function (res) {},
  373. complete: function (res) {
  374. console.log(res);
  375. },
  376. });
  377. },
  378. jumpCreatedProject() {
  379. if (this.form.currentState != 1) {
  380. this.$showToast("该房源已锁定不能预约");
  381. } else {
  382. uni.navigateTo({
  383. url:
  384. "/pages/subPackages/addintention/addintention?ids=" +
  385. this.form.id +
  386. "&status=" +
  387. this.form.currentState,
  388. });
  389. }
  390. },
  391. getDicType(type, value) {
  392. if (type == "zaiti" && this.dic_SelectList.PROPERTY_NATURE) {
  393. let PROPERTY_NATURE = this.dic_SelectList.PROPERTY_NATURE;
  394. let index = PROPERTY_NATURE.findIndex((e) => e.value == value);
  395. return PROPERTY_NATURE[index].label;
  396. }
  397. if (type == "roomUse" && this.dic_SelectList.HOUSE_USAGE) {
  398. let HOUSE_USAGE = this.dic_SelectList.HOUSE_USAGE;
  399. let index = HOUSE_USAGE.findIndex((e) => e.value == value);
  400. return HOUSE_USAGE[index].label;
  401. }
  402. },
  403. async getByCodes() {
  404. let data = await getByCodes(JSON.stringify(this.dic_key));
  405. this.dic_SelectList = this.$common.handleDicList(data);
  406. },
  407. change(e) {
  408. this.current = e.detail.current;
  409. },
  410. selectStyle(index) {
  411. this.dotsStyles = this.dotStyle[index];
  412. this.styleIndex = index;
  413. },
  414. selectMode(mode, index) {
  415. this.mode = mode;
  416. this.modeIndex = index;
  417. this.styleIndex = -1;
  418. this.dotsStyles = this.dotStyle[0];
  419. },
  420. clickItem(e) {
  421. this.swiperDotIndex = e;
  422. },
  423. onBanner(index) {
  424. console.log(22222, index);
  425. },
  426. },
  427. };
  428. </script>
  429. <style lang="scss">
  430. .chaochuyincang {
  431. white-space: nowrap;
  432. overflow: hidden;
  433. text-overflow: ellipsis;
  434. }
  435. .button_primary {
  436. width: 96rpx;
  437. height: 50rpx;
  438. text-align: center;
  439. line-height: 50rpx;
  440. color: #1d18bc;
  441. font-weight: 500;
  442. background: rgba(29, 24, 188, 0.05);
  443. border-radius: 8rpx 8rpx 8rpx 8rpx;
  444. }
  445. .housedetails {
  446. .btn-view {
  447. width: 100%;
  448. height: 100rpx;
  449. padding: 20rpx 10%;
  450. background-color: #ffffff;
  451. position: fixed;
  452. bottom: 0;
  453. left: 0;
  454. }
  455. .btn {
  456. border-radius: 8rpx 8rpx 8rpx 8rpx;
  457. width: 75%;
  458. height: 90rpx;
  459. text-align: center;
  460. border-radius: 8rpx 8rpx 8rpx 8rpx;
  461. background: #1d18bc;
  462. line-height: 90rpx;
  463. margin-top: 10rpx;
  464. color: white;
  465. float: left;
  466. }
  467. .btn-disable {
  468. background: #cccccc;
  469. }
  470. .over_hidden {
  471. overflow: hidden;
  472. }
  473. .textflow {
  474. text-overflow: ellipsis;
  475. white-space: nowrap;
  476. }
  477. .cell_1 {
  478. float: left;
  479. width: 100%;
  480. }
  481. .project-column {
  482. border-radius: 8rpx 8rpx 0rpx 0rpx;
  483. //height: 44rpx;
  484. font-size: 32rpx;
  485. font-family: PingFang SC-Medium, PingFang SC;
  486. font-weight: 500;
  487. color: #333333;
  488. background: #ffffff;
  489. }
  490. .shuomingflex {
  491. display: flex;
  492. min-height: 110rpx;
  493. }
  494. .roomstatus {
  495. height: 50rpx;
  496. line-height: 50rpx;
  497. font-size: 24rpx;
  498. padding: 0rpx 16rpx;
  499. float: left;
  500. border-radius: 8rpx 8rpx 8rpx 8rpx;
  501. font-family: PingFang SC-Medium, PingFang SC;
  502. font-weight: 500;
  503. color: #1d18bc;
  504. border: 2rpx solid #1d18bc;
  505. margin-left: 16rpx;
  506. }
  507. .roomstatus:first-child {
  508. margin-left: 0 !important;
  509. }
  510. .height50rpx {
  511. height: 50rpx;
  512. }
  513. .pd32 {
  514. padding: 32rpx;
  515. }
  516. .cell_1 {
  517. float: left;
  518. width: 100%;
  519. }
  520. .float_left {
  521. float: left;
  522. }
  523. .chuzu_label {
  524. // width: 312rpx;
  525. height: 36rpx;
  526. font-size: 26rpx;
  527. font-family: PingFang SC-Medium, PingFang SC;
  528. font-weight: 500;
  529. color: #333333;
  530. line-height: 36rpx;
  531. }
  532. .chuzuborder {
  533. border-bottom: 1rpx solid #cccccc;
  534. }
  535. .chuzu_vlaue {
  536. width: 86rpx;
  537. font-size: 32rpx;
  538. font-family: PingFang SC-Bold, PingFang SC;
  539. font-weight: bold;
  540. color: #ec7359;
  541. line-height: 38rpx;
  542. }
  543. .list-row {
  544. width: calc(100% - 64rpx);
  545. padding: 16rpx 32rpx 18rpx 32rpx;
  546. background: #ffffff;
  547. margin-bottom: 16rpx;
  548. display: flex;
  549. //height: 278rpx;
  550. border-radius: 8rpx 8rpx 8rpx 8rpx;
  551. }
  552. .housepicture {
  553. width: calc(100% - 64rpx);
  554. padding: 16rpx 32rpx 18rpx 32rpx;
  555. background: #ffffff;
  556. margin-bottom: 16rpx;
  557. display: flex;
  558. //height: 278rpx;
  559. flex-wrap: wrap;
  560. border-radius: 8rpx 8rpx 8rpx 8rpx;
  561. .picList {
  562. height: 200rpx;
  563. width: 600rpx;
  564. flex: 0 0 calc(100% / 3);
  565. }
  566. }
  567. .mb8rpx {
  568. margin-bottom: 8rpx;
  569. }
  570. padding: 32rpx;
  571. .swiper-box {
  572. height: 200px;
  573. }
  574. .content {
  575. margin-bottom: 32rpx;
  576. }
  577. .swiper-item {
  578. /* #ifndef APP-NVUE */
  579. display: flex;
  580. /* #endif */
  581. flex-direction: column;
  582. justify-content: center;
  583. align-items: center;
  584. height: 200px;
  585. color: #fff;
  586. }
  587. .swiper-item0 {
  588. background-color: #cee1fd;
  589. }
  590. .swiper-item1 {
  591. background-color: #b2cef7;
  592. }
  593. .swiper-item2 {
  594. background-color: #cee1fd;
  595. }
  596. .image {
  597. width: 750rpx;
  598. }
  599. .uni-bg-red {
  600. background-color: #ff5a5f;
  601. }
  602. .uni-bg-green {
  603. background-color: #09bb07;
  604. }
  605. .uni-bg-blue {
  606. background-color: #007aff;
  607. }
  608. .active {
  609. border-style: solid;
  610. border-color: #007aff;
  611. border-width: 1px;
  612. }
  613. }
  614. </style>