housedetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <template>
  2. <div class="housedetails" style="padding-bottom: 500rpx">
  3. <div class="content" v-if="planPictureList.length != 0">
  4. <uni-swiper-dot
  5. class="uni-swiper-dot-box"
  6. @clickItem="clickItem"
  7. :info="info"
  8. :current="current"
  9. :mode="mode"
  10. :dots-styles="dotsStyles"
  11. field="content"
  12. >
  13. <swiper class="swiper-box" @change="change" :current="swiperDotIndex">
  14. <swiper-item v-for="(item, index) in planPictureList" :key="index">
  15. <view class="swiper-item" :class="'swiper-item' + index">
  16. <img :src="item.url" alt="" style="width: 100%; height: 100%" />
  17. </view>
  18. </swiper-item>
  19. </swiper>
  20. </uni-swiper-dot>
  21. </div>
  22. <div class="list-row">
  23. <div class="cell_1">
  24. <div class="width100 mb8rpx">
  25. <div class="first_title">
  26. {{
  27. form.groupName + form.floorDiscName + form.buildName + form.roomNo
  28. }}
  29. </div>
  30. </div>
  31. <div class="width100 mb8rpx height50rpx chuzuborder">
  32. <div class="float_left chuzu_label">出租指导价(元/㎡/月):</div>
  33. <div class="float_left chuzu_vlaue">
  34. {{ form.guidePrice }}
  35. </div>
  36. </div>
  37. <div class="width100 pdt32 pdb32 chuzuborder">
  38. <van-row>
  39. <van-col :span="6">
  40. <div class="yongtu_first_title">
  41. {{ getDicType("roomUse", form.roomUse) }}
  42. </div>
  43. <div class="yongtu_second_title">用途</div>
  44. </van-col>
  45. <van-col :span="6">
  46. <div class="yongtu_first_title over_hidden textflow">
  47. {{
  48. form.decorationSituation ? form.decorationSituation : "暂无"
  49. }}
  50. <!-- decorationSituation-->
  51. </div>
  52. <div class="yongtu_second_title">装修情况</div>
  53. </van-col>
  54. <van-col :span="6">
  55. <div class="yongtu_first_title">
  56. {{ form.direction ? form.direction : "暂无" }}
  57. </div>
  58. <div class="yongtu_second_title">朝向</div>
  59. </van-col>
  60. <van-col :span="6">
  61. <div class="yongtu_first_title">
  62. {{ form.size ? form.size : "暂无" }}
  63. </div>
  64. <div class="yongtu_second_title">面积(m²)</div>
  65. </van-col>
  66. </van-row>
  67. </div>
  68. <div class="width100 pdt32 height50rpx pdb32 chuzuborder">
  69. <div class="roomstatus">
  70. {{ getDicType("zaiti", form.propertyNature) }}
  71. </div>
  72. <div class="roomstatus" v-if="form.currentState == '1'">空置</div>
  73. <div class="roomstatus" v-if="form.currentState == '2'">锁定</div>
  74. <div class="roomstatus" v-if="form.currentState == '3'">预约</div>
  75. <div class="roomstatus" v-if="form.currentState == '4'">临期</div>
  76. <div class="roomstatus" v-if="form.currentState == '5'">已租</div>
  77. <div class="roomstatus" v-if="form.currentState == '6'">到期</div>
  78. </div>
  79. <div class="width100 pdt32 pdb32 chuzuborder">
  80. <van-row>
  81. <van-col :span="4">
  82. <div style="white-space: nowrap">说明</div>
  83. </van-col>
  84. <van-col :span="20">
  85. <span>{{ form.remark ? form.remark : "暂无" }}</span>
  86. </van-col>
  87. </van-row>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="project-column pdt32 pdl32 pdr32">
  92. <div class="pdb16 chuzuborder">关联项目</div>
  93. </div>
  94. <div class="list-row" v-for="item in list">
  95. <div class="cell_1">
  96. <div class="width100 height44rpx mb8rpx">
  97. <div class="first_title float_left chaochuyincang">
  98. {{ item.projectName }}
  99. </div>
  100. <div class="width20 float_left">
  101. <div
  102. class="button_primary float_right"
  103. v-if="item.reservationStatus == '1'"
  104. >
  105. 空置
  106. </div>
  107. <div
  108. class="button_primary float_right"
  109. v-if="item.reservationStatus == '2'"
  110. >
  111. 锁定
  112. </div>
  113. <div
  114. class="button_primary float_right"
  115. v-if="item.reservationStatus == '3'"
  116. >
  117. 预约
  118. </div>
  119. <div
  120. class="button_primary float_right"
  121. v-if="item.reservationStatus == '4'"
  122. >
  123. 临期
  124. </div>
  125. <div
  126. class="button_primary float_right"
  127. v-if="item.reservationStatus == '5'"
  128. >
  129. 已租
  130. </div>
  131. <div
  132. class="button_primary float_right"
  133. v-if="item.reservationStatus == '6'"
  134. >
  135. 到期
  136. </div>
  137. </div>
  138. </div>
  139. <div class="width100 height44rpx mb8rpx">
  140. <div class="second_title width100">
  141. 企业名称:{{
  142. !item.companyId || item.companyId == null
  143. ? "未知"
  144. : item.companyId
  145. }}
  146. </div>
  147. </div>
  148. <div class="width100 height44rpx mb8rpx">
  149. <div class="second_title width100">
  150. 招商联系人:{{ item.projectManager }}
  151. </div>
  152. </div>
  153. <div class="width100 height44rpx mb8rpx">
  154. <div class="second_title width100">
  155. 联系电话:{{ item.managerPhone }}
  156. </div>
  157. </div>
  158. <div class="width100 height44rpx mb8rpx">
  159. <div class="second_title width100">
  160. 项目介绍:{{ item.projectInfo }}…
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. <view class="btn-view">
  166. <button
  167. class="btn"
  168. @click="jumpCreatedProject()"
  169. style="margin-left: 10rpx"
  170. >
  171. 创建项目
  172. </button>
  173. </view>
  174. </div>
  175. </template>
  176. <script>
  177. import { getByCodes, getRoomInfo, listByModel } from "@/js_sdk/http";
  178. export default {
  179. components: {},
  180. data() {
  181. return {
  182. dic_key: ["PROPERTY_NATURE", "HOUSE_USAGE"],
  183. dic_SelectList: {},
  184. search: {
  185. pageSize: 10,
  186. pageNum: 1,
  187. },
  188. form: {
  189. id: "",
  190. },
  191. list: [],
  192. info: [
  193. {
  194. colorClass: "uni-bg-red",
  195. url: "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",
  196. content: "内容 A",
  197. },
  198. {
  199. colorClass: "uni-bg-green",
  200. url: "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",
  201. content: "内容 B",
  202. },
  203. {
  204. colorClass: "uni-bg-blue",
  205. url: "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",
  206. content: "内容 C",
  207. },
  208. ],
  209. dotStyle: [
  210. {
  211. backgroundColor: "rgba(0, 0, 0, .3)",
  212. border: "1px rgba(0, 0, 0, .3) solid",
  213. color: "#fff",
  214. selectedBackgroundColor: "rgba(0, 0, 0, .9)",
  215. selectedBorder: "1px rgba(0, 0, 0, .9) solid",
  216. },
  217. {
  218. backgroundColor: "rgba(255, 90, 95,0.3)",
  219. border: "1px rgba(255, 90, 95,0.3) solid",
  220. color: "#fff",
  221. selectedBackgroundColor: "rgba(255, 90, 95,0.9)",
  222. selectedBorder: "1px rgba(255, 90, 95,0.9) solid",
  223. },
  224. {
  225. backgroundColor: "rgba(83, 200, 249,0.3)",
  226. border: "1px rgba(83, 200, 249,0.3) solid",
  227. color: "#fff",
  228. selectedBackgroundColor: "rgba(83, 200, 249,0.9)",
  229. selectedBorder: "1px rgba(83, 200, 249,0.9) solid",
  230. },
  231. ],
  232. modeIndex: -1,
  233. styleIndex: -1,
  234. current: 0,
  235. mode: "default",
  236. dotsStyles: {},
  237. planPictureList: [],
  238. swiperDotIndex: 0,
  239. };
  240. },
  241. onLoad(options) {
  242. this.getByCodes();
  243. this.form.id = options.id;
  244. getRoomInfo(options.id).then((e) => {
  245. this.form = e;
  246. this.form.currentState = options.currentState;
  247. console.log(e.planPicture.split(","));
  248. if (e.planPicture.length != 0) {
  249. this.planPictureList = e.planPicture.split(",").map((e) => {
  250. return {
  251. url: this.$constant.BASE_URI + "/FileController/download/" + e,
  252. };
  253. });
  254. } else {
  255. this.planPictureList = [];
  256. }
  257. });
  258. //
  259. console.log({ id: this.form.id, ...this.search });
  260. listByModel({ id: options.id, ...this.search }).then((e) => {
  261. this.list = e.rows;
  262. });
  263. },
  264. methods: {
  265. jumpCreatedProject() {
  266. uni.navigateTo({
  267. url: "/pages/subPackages/addintention/addintention?ids=" + this.form.id,
  268. });
  269. },
  270. getDicType(type, value) {
  271. if (type == "zaiti" && this.dic_SelectList.PROPERTY_NATURE) {
  272. let PROPERTY_NATURE = this.dic_SelectList.PROPERTY_NATURE;
  273. let index = PROPERTY_NATURE.findIndex((e) => e.value == value);
  274. return PROPERTY_NATURE[index].label;
  275. }
  276. if (type == "roomUse" && this.dic_SelectList.HOUSE_USAGE) {
  277. let HOUSE_USAGE = this.dic_SelectList.HOUSE_USAGE;
  278. let index = HOUSE_USAGE.findIndex((e) => e.value == value);
  279. return HOUSE_USAGE[index].label;
  280. }
  281. },
  282. async getByCodes() {
  283. let data = await getByCodes(JSON.stringify(this.dic_key));
  284. this.dic_SelectList = this.$common.handleDicList(data);
  285. },
  286. getMoreListByModel() {
  287. listByModel({ id: this.form.id, ...this.search }).then((e) => {
  288. this.list.push(...e.rows);
  289. });
  290. },
  291. onReachBottom() {
  292. this.search.pageNum += 1;
  293. this.getMoreListByModel();
  294. console.log("滑动到距离底部100px的时候触发,可以放 。。业务逻辑");
  295. }, //下拉执行的时候触发 (下拉刷新)
  296. change(e) {
  297. this.current = e.detail.current;
  298. },
  299. selectStyle(index) {
  300. this.dotsStyles = this.dotStyle[index];
  301. this.styleIndex = index;
  302. },
  303. selectMode(mode, index) {
  304. this.mode = mode;
  305. this.modeIndex = index;
  306. this.styleIndex = -1;
  307. this.dotsStyles = this.dotStyle[0];
  308. },
  309. clickItem(e) {
  310. this.swiperDotIndex = e;
  311. },
  312. onBanner(index) {
  313. console.log(22222, index);
  314. },
  315. },
  316. };
  317. </script>
  318. <style lang="scss">
  319. .chaochuyincang {
  320. white-space: nowrap;
  321. overflow: hidden;
  322. text-overflow: ellipsis;
  323. }
  324. .button_primary {
  325. width: 96rpx;
  326. height: 50rpx;
  327. text-align: center;
  328. line-height: 50rpx;
  329. color: #1d18bc;
  330. font-weight: 500;
  331. background: rgba(29, 24, 188, 0.05);
  332. border-radius: 8rpx 8rpx 8rpx 8rpx;
  333. }
  334. .housedetails {
  335. .btn-view {
  336. width: 100%;
  337. height: 100rpx;
  338. padding: 20rpx 10%;
  339. background-color: #ffffff;
  340. position: fixed;
  341. bottom: 0;
  342. left: 0;
  343. }
  344. .btn {
  345. width: 75%;
  346. height: 90rpx;
  347. border-radius: 8rpx 8rpx 8rpx 8rpx;
  348. background: #1d18bc;
  349. line-height: 90rpx;
  350. color: white;
  351. float: left;
  352. }
  353. .over_hidden {
  354. overflow: hidden;
  355. }
  356. .textflow {
  357. text-overflow: ellipsis;
  358. white-space: nowrap;
  359. }
  360. .cell_1 {
  361. float: left;
  362. width: 100%;
  363. }
  364. .project-column {
  365. border-radius: 8rpx 8rpx 0rpx 0rpx;
  366. //height: 44rpx;
  367. font-size: 32rpx;
  368. font-family: PingFang SC-Medium, PingFang SC;
  369. font-weight: 500;
  370. color: #333333;
  371. background: #ffffff;
  372. }
  373. .shuomingflex {
  374. display: flex;
  375. min-height: 110rpx;
  376. }
  377. .roomstatus {
  378. height: 50rpx;
  379. line-height: 50rpx;
  380. font-size: 24rpx;
  381. padding: 0rpx 16rpx;
  382. float: left;
  383. border-radius: 8rpx 8rpx 8rpx 8rpx;
  384. font-family: PingFang SC-Medium, PingFang SC;
  385. font-weight: 500;
  386. color: #1d18bc;
  387. border: 2rpx solid #1d18bc;
  388. margin-left: 16rpx;
  389. }
  390. .roomstatus:first-child {
  391. margin-left: 0 !important;
  392. }
  393. .height50rpx {
  394. height: 50rpx;
  395. }
  396. .pd32 {
  397. padding: 32rpx;
  398. }
  399. .cell_1 {
  400. float: left;
  401. width: 100%;
  402. }
  403. .float_left {
  404. float: left;
  405. }
  406. .chuzu_label {
  407. width: 312rpx;
  408. height: 36rpx;
  409. font-size: 26rpx;
  410. font-family: PingFang SC-Medium, PingFang SC;
  411. font-weight: 500;
  412. color: #333333;
  413. line-height: 36rpx;
  414. }
  415. .chuzuborder {
  416. border-bottom: 2px solid #cccccc;
  417. }
  418. .chuzu_vlaue {
  419. width: 86rpx;
  420. font-size: 32rpx;
  421. font-family: PingFang SC-Bold, PingFang SC;
  422. font-weight: bold;
  423. color: #ec7359;
  424. line-height: 38rpx;
  425. }
  426. .list-row {
  427. width: calc(100% - 64rpx);
  428. padding: 16rpx 32rpx 18rpx 32rpx;
  429. background: #ffffff;
  430. margin-bottom: 16rpx;
  431. display: flex;
  432. //height: 278rpx;
  433. border-radius: 8rpx 8rpx 8rpx 8rpx;
  434. }
  435. .mb8rpx {
  436. margin-bottom: 8rpx;
  437. }
  438. padding: 32rpx;
  439. .swiper-box {
  440. height: 200px;
  441. }
  442. .content {
  443. margin-bottom: 32rpx;
  444. }
  445. .swiper-item {
  446. /* #ifndef APP-NVUE */
  447. display: flex;
  448. /* #endif */
  449. flex-direction: column;
  450. justify-content: center;
  451. align-items: center;
  452. height: 200px;
  453. color: #fff;
  454. }
  455. .swiper-item0 {
  456. background-color: #cee1fd;
  457. }
  458. .swiper-item1 {
  459. background-color: #b2cef7;
  460. }
  461. .swiper-item2 {
  462. background-color: #cee1fd;
  463. }
  464. .image {
  465. width: 750rpx;
  466. }
  467. .uni-bg-red {
  468. background-color: #ff5a5f;
  469. }
  470. .uni-bg-green {
  471. background-color: #09bb07;
  472. }
  473. .uni-bg-blue {
  474. background-color: #007aff;
  475. }
  476. .active {
  477. border-style: solid;
  478. border-color: #007aff;
  479. border-width: 1px;
  480. }
  481. }
  482. </style>