detail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <div class="housingDetail">
  3. <div class="swiperBody">
  4. <!--室内外环境图-->
  5. <!-- <div v-if="selectImgType">
  6. <swiper
  7. :indicator-dots="false"
  8. circular
  9. style="height: 360rpx"
  10. @change="changeImg"
  11. >
  12. <swiper-item v-for="item in envList">
  13. <img :src="item.url" class="swiperImg" />
  14. </swiper-item>
  15. </swiper>
  16. </div> -->
  17. <!--房型图-->
  18. <!-- <div v-if="!selectImgType">
  19. <swiper
  20. :indicator-dots="false"
  21. circular
  22. style="height: 360rpx"
  23. @change="changeImg"
  24. >
  25. <swiper-item v-for="item in layOutList">
  26. <img :src="item.url" class="swiperImg" />
  27. </swiper-item>
  28. </swiper>
  29. </div> -->
  30. <!-- <div class="radioBox" @tap="changeType">
  31. <div :class="selectImgType ? 'selectEnvironment' : 'unSelEn'">
  32. 室内外环境
  33. <span v-if="selectImgType">{{ current }}/{{ envList.length }}</span>
  34. </div>
  35. <div :class="!selectImgType ? 'selectLayout' : 'unSelLayout'">
  36. 房型图
  37. <span v-if="!selectImgType"
  38. >{{ current }}/{{ layOutList.length }}</span
  39. >
  40. </div>
  41. </div> -->
  42. </div>
  43. <div class="housingInfoBody">
  44. <div class="housingName">
  45. {{
  46. form.groupName +
  47. "-" +
  48. form.discName +
  49. "-" +
  50. form.buildName +
  51. "-" +
  52. form.roomNo
  53. }}
  54. </div>
  55. <div class="housingImportBox">
  56. <div class="housingImportItem">
  57. <span class="housingImportInfo">
  58. <span style="font-size: 40rpx; font-weight: 600">
  59. {{ HOUSE_USAGE[form.roomUse - 1].label }}
  60. </span>
  61. </span>
  62. <span class="housingInportName">用途</span>
  63. </div>
  64. <div class="housingImportItem">
  65. <span class="housingImportInfo">
  66. <span style="font-size: 40rpx; font-weight: 600">{{
  67. form.actualInternalArea ? form.actualInternalArea : "暂无数据"
  68. }}</span>
  69. </span>
  70. <span class="housingInportName"> 实测套内面积(㎡) </span>
  71. </div>
  72. <div class="housingImportItem">
  73. <span class="housingImportInfo">
  74. <span style="font-size: 40rpx; font-weight: 600">{{
  75. !form.decorationSituation
  76. ? "暂无数据"
  77. : DECORATION_SITUATION[form.decorationSituation - 1].label
  78. }}</span>
  79. </span>
  80. <span class="housingInportName">装修情况</span>
  81. </div>
  82. </div>
  83. <!-- <div class="placeBox">
  84. <span class="placeTit">位置</span>
  85. <div class="placeInfo">{{ form.address }}</div>
  86. <img src="../parkActivity/image/dhIcon.png" class="dhIcon" />
  87. </div> -->
  88. <div class="housingInfoBox">
  89. <div class="housingInfoItem">
  90. <span class="infoTitle">父级</span>
  91. <span class="infoMsg">
  92. {{ form.groupName + "-" + form.discName + "-" + form.buildName }}
  93. </span>
  94. </div>
  95. <div class="housingInfoItem">
  96. <span class="infoTitle">户室号</span>
  97. <span class="infoMsg">{{ form.floor }}</span>
  98. </div>
  99. <div class="housingInfoItem">
  100. <span class="infoTitle">所在层</span>
  101. <span class="infoMsg">{{ form.floor }}</span>
  102. </div>
  103. <div class="housingInfoItem">
  104. <span class="infoTitle">预测套内面积(㎡)</span>
  105. <span class="infoMsg">{{
  106. form.predictionInternalArea
  107. ? form.predictionInternalArea
  108. : "暂无数据"
  109. }}</span>
  110. </div>
  111. <div class="housingInfoItem">
  112. <span class="infoTitle">预测分摊面积(㎡)</span>
  113. <span class="infoMsg">{{
  114. form.actualShareArea ? form.actualShareArea : "暂无数据"
  115. }}</span>
  116. </div>
  117. <div class="housingInfoItem">
  118. <span class="infoTitle">预测建筑面积(㎡)</span>
  119. <span class="infoMsg">{{
  120. form.predictionBuildArea ? form.predictionBuildArea : "暂无数据"
  121. }}</span>
  122. </div>
  123. <div class="housingInfoItem">
  124. <span class="infoTitle">预测土地面积(㎡)</span>
  125. <span class="infoMsg">{{
  126. form.predictionLandArea ? form.predictionLandArea : "暂无数据"
  127. }}</span>
  128. </div>
  129. <div class="housingInfoItem">
  130. <span class="infoTitle">实测套内面积(㎡)</span>
  131. <span class="infoMsg">{{
  132. form.actualInternalArea ? form.actualInternalArea : "暂无数据"
  133. }}</span>
  134. </div>
  135. <div class="housingInfoItem">
  136. <span class="infoTitle">实测分摊面积(㎡)</span>
  137. <span class="infoMsg">{{
  138. form.actualShareArea ? form.actualShareArea : "暂无数据"
  139. }}</span>
  140. </div>
  141. <div class="housingInfoItem">
  142. <span class="infoTitle">实测建筑面积(㎡)</span>
  143. <span class="infoMsg">{{
  144. form.actualBuildArea ? form.actualBuildArea : "暂无数据"
  145. }}</span>
  146. </div>
  147. <div class="housingInfoItem">
  148. <span class="infoTitle">实测土地面积(㎡)</span>
  149. <span class="infoMsg">{{
  150. form.actualLandArea ? form.actualLandArea : "暂无数据"
  151. }}</span>
  152. </div>
  153. <div class="housingInfoItem">
  154. <span class="infoTitle">用途</span>
  155. <span class="infoMsg">{{ HOUSE_USAGE[form.roomUse - 1].label }}</span>
  156. </div>
  157. <div class="housingInfoItem">
  158. <span class="infoTitle">可售状态</span>
  159. <span class="infoMsg">{{
  160. SALE_STATUS[form.saleStatus - 1].label
  161. }}</span>
  162. </div>
  163. <div class="housingInfoItem">
  164. <span class="infoTitle">已售状态</span>
  165. <span class="infoMsg">
  166. {{ SOLD_STATUS[form.soldStatus - 1].label }}
  167. </span>
  168. </div>
  169. <div class="housingInfoItem">
  170. <span class="infoTitle">户型</span>
  171. <span class="infoMsg">
  172. <picker
  173. @change="getHouseImageList"
  174. :value="index"
  175. :range="houseTypeList"
  176. range-key="label"
  177. >
  178. {{ houseType ? houseType : "请选择" }}
  179. </picker>
  180. </span>
  181. </div>
  182. <div class="imageList">
  183. <img
  184. @click="showImgList(item.url)"
  185. v-for="item in imageList"
  186. :key="item.url"
  187. :src="item.url"
  188. alt=""
  189. />
  190. </div>
  191. </div>
  192. <button class="submitBtn" @click="goBack()">返回上一页</button>
  193. </div>
  194. </div>
  195. </template>
  196. <script>
  197. import { getRoomInfo, getByCodes, getHouseImage } from "@/js_sdk/http";
  198. import constant from "../../utils/constant";
  199. export default {
  200. name: "detail",
  201. onLoad(options) {
  202. this.form.id = options.id;
  203. this.getByCodes();
  204. },
  205. data() {
  206. return {
  207. constant: constant,
  208. imgs: [],
  209. dic_key: [
  210. "HOUSE_USAGE",
  211. "DECORATION_SITUATION",
  212. "SALE_STATUS",
  213. "SOLD_STATUS",
  214. ],
  215. selectImgType: true,
  216. current: 1,
  217. HOUSE_USAGE: [],
  218. dic_SelectList: {},
  219. envList: [],
  220. layOutList: [],
  221. HOUSE_USAGE: [],
  222. DECORATION_SITUATION: [],
  223. SALE_STATUS: [],
  224. SOLD_STATUS: [],
  225. BIZ_OA: [],
  226. form: {},
  227. houseTypeList: [],
  228. imageList: [],
  229. };
  230. },
  231. methods: {
  232. goBack() {
  233. uni.navigateBack();
  234. },
  235. showImgList(url) {
  236. console.log(this.imgs);
  237. console.log(url);
  238. uni.previewImage({
  239. urls: this.imgs,
  240. longPressActions: {
  241. itemList: ["发送给朋友", "保存图片", "收藏"],
  242. success: function (data) {
  243. console.log(
  244. "选中了第" +
  245. (data.tapIndex + 1) +
  246. "个按钮,第" +
  247. (data.index + 1) +
  248. "张图片"
  249. );
  250. },
  251. fail: function (err) {
  252. console.log(err.errMsg);
  253. },
  254. },
  255. });
  256. },
  257. getHouseImageList({ detail }) {
  258. this.houseType = this.houseTypeList[detail.value].label;
  259. this.imgs = [];
  260. let fileList = JSON.parse(this.houseTypeList[detail.value].fileList);
  261. for (let i = 0; i < fileList.length; i++) {
  262. console.log(fileList[i].url);
  263. fileList[i].url =
  264. this.constant.BASE_URI + fileList[i].url.replace("/webServer", "");
  265. this.imgs.push(fileList[i].url.replace("/webServer", ""));
  266. }
  267. this.imageList = fileList;
  268. },
  269. async getByCodes() {
  270. let data = await getByCodes(JSON.stringify(this.dic_key));
  271. this.dic_SelectList = this.$common.handleDicList(data);
  272. this.HOUSE_USAGE = this.dic_SelectList.HOUSE_USAGE;
  273. this.DECORATION_SITUATION = this.dic_SelectList.DECORATION_SITUATION;
  274. this.SALE_STATUS = this.dic_SelectList.SALE_STATUS;
  275. this.SOLD_STATUS = this.dic_SelectList.SOLD_STATUS;
  276. this.BIZ_OA = this.dic_SelectList.BIZ_OA;
  277. this.getById();
  278. },
  279. async getHouseImage() {
  280. let data = await getHouseImage({ discId: this.form.discId });
  281. this.houseTypeList = data.map((e) => {
  282. return {
  283. label: `${e.name},建筑面积${e.buildArea},使用面积${e.useArea}`,
  284. fileList: e.fileList,
  285. };
  286. });
  287. console.log(data);
  288. },
  289. getById() {
  290. const _this = this;
  291. getRoomInfo(this.form.id).then((res) => {
  292. if (res) {
  293. this.form = res;
  294. this.form.imgNo = res.imgNo == null ? "" : this.form.imgNo;
  295. this.form.bearing = res.bearing == null ? "" : this.form.bearing;
  296. this.form.floorHeight =
  297. res.floorHeight == null ? "" : this.form.floorHeight;
  298. this.form.electricity =
  299. res.electricity == null ? "" : this.form.electricity;
  300. this.form.remark = res.remark == null ? "" : this.form.remark;
  301. this.getHouseImage();
  302. }
  303. });
  304. },
  305. changeType() {
  306. this.selectImgType = !this.selectImgType;
  307. this.current = 1;
  308. },
  309. changeImg(index) {
  310. this.current = index.detail.current + 1;
  311. },
  312. toPredetermine() {
  313. uni.navigateTo({
  314. url:
  315. "/pages/subPackages/housingResources/addPredetermine?roomId=" +
  316. this.form.id,
  317. });
  318. },
  319. },
  320. };
  321. </script>
  322. <style lang="scss">
  323. .housingDetail {
  324. .imageList {
  325. display: flex;
  326. flex-wrap: nowrap;
  327. img {
  328. width: 230rpx;
  329. height: 230rpx;
  330. }
  331. }
  332. .swiperBody {
  333. position: relative;
  334. .swiperImg {
  335. width: 750rpx;
  336. height: 360rpx;
  337. }
  338. .radioBox {
  339. width: 344rpx;
  340. height: 60rpx;
  341. display: flex;
  342. align-items: center;
  343. justify-content: space-between;
  344. border-radius: 30rpx;
  345. background: rgba(0, 0, 0, 0.7);
  346. position: absolute;
  347. color: white;
  348. left: 204rpx;
  349. top: 268rpx;
  350. font-size: 26rpx;
  351. box-sizing: border-box;
  352. .selectEnvironment {
  353. width: 220rpx;
  354. height: 60rpx;
  355. background: rgba(3, 101, 249, 1);
  356. border-radius: 30rpx;
  357. display: flex;
  358. align-items: center;
  359. justify-content: center;
  360. box-sizing: border-box;
  361. }
  362. .unSelEn {
  363. width: 164rpx;
  364. height: 60rpx;
  365. border-radius: 30rpx;
  366. display: flex;
  367. align-items: center;
  368. justify-content: center;
  369. box-sizing: border-box;
  370. }
  371. .selectLayout {
  372. width: 180rpx;
  373. height: 60rpx;
  374. display: flex;
  375. background: rgba(3, 101, 249, 1);
  376. align-items: center;
  377. justify-content: center;
  378. box-sizing: border-box;
  379. border-radius: 30rpx;
  380. }
  381. .unSelLayout {
  382. width: 124rpx;
  383. height: 60rpx;
  384. display: flex;
  385. align-items: center;
  386. justify-content: center;
  387. box-sizing: border-box;
  388. border-radius: 30rpx;
  389. }
  390. }
  391. }
  392. .housingInfoBody {
  393. background: white;
  394. padding: 32rpx;
  395. .housingName {
  396. font-size: 40rpx;
  397. color: rgba(51, 51, 51, 1);
  398. // margin-bottom: 24rpx;
  399. }
  400. .housingImportBox {
  401. display: flex;
  402. justify-content: space-between;
  403. align-items: center;
  404. padding: 0 10rpx;
  405. margin-top: 10rpx;
  406. .housingImportItem {
  407. display: flex;
  408. flex-direction: column;
  409. align-items: center;
  410. .housingImportInfo {
  411. color: rgba(226, 81, 0, 1);
  412. font-size: 28rpx;
  413. line-height: 46rox;
  414. }
  415. .housingInportName {
  416. color: rgba(136, 136, 136, 1);
  417. font-size: 28rpx;
  418. line-height: 32rpx;
  419. margin-top: 10rpx;
  420. }
  421. }
  422. }
  423. }
  424. .placeBox {
  425. display: flex;
  426. justify-content: space-between;
  427. align-items: center;
  428. background: rgba(245, 247, 250, 1);
  429. padding: 16rpx 24rpx;
  430. border-radius: 8rpx;
  431. margin-top: 32rpx;
  432. .placeTit {
  433. color: rgba(136, 136, 136, 1);
  434. font-size: 28rpx;
  435. white-space: nowrap;
  436. }
  437. .placeInfo {
  438. color: rgba(51, 51, 51, 1);
  439. font-size: 28rpx;
  440. width: 466rpx;
  441. line-height: 42rpx;
  442. word-wrap: break-word;
  443. }
  444. .dhIcon {
  445. width: 48rpx;
  446. height: 48rpx;
  447. }
  448. }
  449. .housingInfoBox {
  450. display: flex;
  451. flex-direction: column;
  452. margin-top: 32rpx;
  453. .housingInfoItem {
  454. display: flex;
  455. align-items: center;
  456. margin-bottom: 24rpx;
  457. .infoTitle {
  458. color: rgba(136, 136, 136, 1);
  459. font-size: 28rpx;
  460. margin-left: 8rpx;
  461. width: 300rpx;
  462. }
  463. .infoMsg {
  464. font-size: 28rpx;
  465. color: rgba(51, 51, 51, 1);
  466. }
  467. }
  468. .bzInfo {
  469. width: 640rpx;
  470. padding: 0 24rpx;
  471. word-wrap: break-word;
  472. font-size: 28rpx;
  473. color: #333333;
  474. line-height: 42rpx;
  475. }
  476. }
  477. .submitBtn {
  478. width: 654rpx;
  479. height: 96rpx;
  480. display: flex;
  481. align-items: center;
  482. justify-content: center;
  483. color: white;
  484. font-size: 35rpx;
  485. background: rgba(3, 101, 249, 1);
  486. margin: 64rpx auto;
  487. }
  488. }
  489. </style>