detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <div class="housingDetail">
  3. <div class="swiperBody">
  4. <!--室内外环境图-->
  5. <div v-if="selectImgType">
  6. <swiper :indicator-dots="false" circular style="height: 360rpx" @change="changeImg">
  7. <swiper-item v-for="item in envList">
  8. <img :src="item.url" class="swiperImg"/>
  9. </swiper-item>
  10. </swiper>
  11. </div>
  12. <!--房型图-->
  13. <div v-if="!selectImgType">
  14. <swiper :indicator-dots="false" circular style="height: 360rpx" @change="changeImg">
  15. <swiper-item v-for="item in layOutList">
  16. <img :src="item.url" class="swiperImg"/>
  17. </swiper-item>
  18. </swiper>
  19. </div>
  20. <div class="radioBox" @tap="changeType">
  21. <div :class="selectImgType?'selectEnvironment':'unSelEn'">
  22. 室内外环境 <span v-if="selectImgType">{{current}}/{{envList.length}}</span>
  23. </div>
  24. <div :class="!selectImgType?'selectLayout':'unSelLayout'">
  25. 房型图 <span v-if="!selectImgType">{{current}}/{{layOutList.length}}</span>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="housingInfoBody">
  30. <div class="housingName">{{ form.groupName + form.floorDiscName + form.buildName + form.roomNo }}</div>
  31. <div class="housingImportBox">
  32. <div class="housingImportItem">
  33. <span class="housingImportInfo">
  34. <span style="font-size: 40rpx;font-weight: 600">{{form.guidePrice}}</span>
  35. 元/㎡/月</span>
  36. <span class="housingInportName">出租指导价</span>
  37. </div>
  38. <div class="housingImportItem">
  39. <span class="housingImportInfo">
  40. <span style="font-size: 40rpx;font-weight: 600">{{ form.size }}</span>
  41. </span>
  42. <span class="housingInportName">
  43. 面积
  44. </span>
  45. </div>
  46. <div class="housingImportItem">
  47. <span class="housingImportInfo">
  48. <span style="font-size: 40rpx;font-weight: 600">{{ form.decorationSituation }}</span>
  49. </span>
  50. <span class="housingInportName">装修情况</span>
  51. </div>
  52. </div>
  53. <div class="placeBox">
  54. <span class="placeTit">位置</span>
  55. <div class="placeInfo">{{ form.address }}</div>
  56. <img src="../parkActivity/image/dhIcon.png" class="dhIcon">
  57. </div>
  58. <div class="housingInfoBox">
  59. <div class="housingInfoItem">
  60. <span style="color: red">*</span>
  61. <span class="infoTitle">区域</span>
  62. <span class="infoMsg">{{ form.region }}</span>
  63. </div>
  64. <div class="housingInfoItem">
  65. <span style="color: red">*</span>
  66. <span class="infoTitle">楼层</span>
  67. <span class="infoMsg">{{ form.floor }}</span>
  68. </div>
  69. <div class="housingInfoItem">
  70. <span style="color: red">*</span>
  71. <span class="infoTitle">出租单元号</span>
  72. <span class="infoMsg">{{ form.roomNo }}</span>
  73. </div>
  74. <div class="housingInfoItem">
  75. <span style="color: red;visibility: hidden">*</span>
  76. <span class="infoTitle">平面图单元号</span>
  77. <span class="infoMsg">{{ form.imgNo }}</span>
  78. </div>
  79. <div class="housingInfoItem">
  80. <span style="color: red;">*</span>
  81. <span class="infoTitle">用途</span>
  82. <span class="infoMsg">{{ form.roomUse }}</span>
  83. </div>
  84. <div class="housingInfoItem">
  85. <span style="color: red;">*</span>
  86. <span class="infoTitle">朝向</span>
  87. <span class="infoMsg">{{ form.direction }}</span>
  88. </div>
  89. <div class="housingInfoItem">
  90. <span style="color: red;visibility: hidden">*</span>
  91. <span class="infoTitle">承重情况(kg/㎡)</span>
  92. <span class="infoMsg">{{ form.bearing }}</span>
  93. </div>
  94. <div class="housingInfoItem">
  95. <span style="color: red;visibility: hidden">*</span>
  96. <span class="infoTitle">层高(m)</span>
  97. <span class="infoMsg">{{ form.floorHeight }}</span>
  98. </div>
  99. <div class="housingInfoItem">
  100. <span style="color: red;visibility: hidden">*</span>
  101. <span class="infoTitle">用电说明</span>
  102. <span class="infoMsg">{{ form.electricity }}</span>
  103. </div>
  104. <div class="housingInfoItem" style="margin-top: 12rpx">
  105. <span style="color: red;visibility: hidden">*</span>
  106. <span class="infoTitle">备注</span>
  107. </div>
  108. <div class="bzInfo">
  109. {{ form.remark }}
  110. </div>
  111. </div>
  112. <button class="submitBtn" @click="toPredetermine">去预定</button>
  113. </div>
  114. </div>
  115. </template>
  116. <script>
  117. import {
  118. getRoomInfo,
  119. } from "@/js_sdk/http";
  120. import constant from "../../utils/constant";
  121. export default {
  122. name: "detail",
  123. onLoad(options){
  124. this.form.id = options.id
  125. this.getById()
  126. },
  127. data() {
  128. return {
  129. selectImgType:true,
  130. current:1,
  131. envList:[
  132. // {url:require('./testImg.png')},
  133. // {url:require('./testImg.png')},
  134. // {url:require('./testImg.png')},
  135. // {url:require('./testImg.png')},
  136. // {url:require('./testImg.png')},
  137. ],
  138. layOutList:[
  139. // {url:require('./testImg.png')},
  140. // {url:require('./testImg.png')},
  141. ],
  142. form:{
  143. }
  144. };
  145. },
  146. methods:{
  147. getById() {
  148. const _this = this
  149. getRoomInfo(this.form.id).then(res=>{
  150. if(res){
  151. this.form = res
  152. this.form.imgNo = res.imgNo == null ? '' : this.form.imgNo
  153. this.form.bearing = res.bearing == null ? '' : this.form.bearing
  154. this.form.floorHeight = res.floorHeight == null ? '' : this.form.floorHeight
  155. this.form.electricity = res.electricity == null ? '' : this.form.electricity
  156. this.form.remark = res.remark == null ? '' : this.form.remark
  157. // 房型图
  158. if(res.planPicture){
  159. const layOutList = []
  160. res.planPicture.split(',').forEach(v => {
  161. if (v) {
  162. layOutList.push({
  163. url: constant.BASE_URI + '/FileController/download/' + v,
  164. id: v
  165. })
  166. }
  167. })
  168. _this.layOutList = layOutList
  169. }
  170. // 室内外环境
  171. if(res.environmentPicture){
  172. const envList = []
  173. res.environmentPicture.split(',').forEach(v => {
  174. if (v) {
  175. envList.push({
  176. url: constant.BASE_URI + '/FileController/download/' + v,
  177. id: v
  178. })
  179. }
  180. })
  181. _this.envList = envList
  182. }
  183. }
  184. })
  185. },
  186. changeType(){
  187. this.selectImgType = !this.selectImgType
  188. this.current = 1
  189. },
  190. changeImg(index){
  191. this.current = index.detail.current+1
  192. },
  193. toPredetermine() {
  194. uni.navigateTo({
  195. url:'/pages/subPackages/housingResources/addPredetermine?roomId=' + this.form.id
  196. })
  197. }
  198. }
  199. }
  200. </script>
  201. <style lang="scss">
  202. .housingDetail{
  203. .swiperBody{
  204. position: relative;
  205. .swiperImg{
  206. width: 750rpx;
  207. height: 360rpx;
  208. }
  209. .radioBox{
  210. width: 344rpx;
  211. height: 60rpx;
  212. display: flex;
  213. align-items: center;
  214. justify-content: space-between;
  215. border-radius: 30rpx;
  216. background: rgba(0, 0, 0, 0.70);
  217. position: absolute;
  218. color: white;
  219. left: 204rpx;
  220. top: 268rpx;
  221. font-size: 26rpx;
  222. box-sizing: border-box;
  223. .selectEnvironment{
  224. width: 220rpx;
  225. height: 60rpx;
  226. background: rgba(3, 101, 249, 1);
  227. border-radius: 30rpx;
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. box-sizing: border-box;
  232. }
  233. .unSelEn{
  234. width: 164rpx;
  235. height: 60rpx;
  236. border-radius: 30rpx;
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. box-sizing: border-box;
  241. }
  242. .selectLayout{
  243. width: 180rpx;
  244. height: 60rpx;
  245. display: flex;
  246. background: rgba(3, 101, 249, 1);
  247. align-items: center;
  248. justify-content: center;
  249. box-sizing: border-box;
  250. border-radius: 30rpx;
  251. }
  252. .unSelLayout{
  253. width: 124rpx;
  254. height: 60rpx;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. box-sizing: border-box;
  259. border-radius: 30rpx;
  260. }
  261. }
  262. }
  263. .housingInfoBody{
  264. background: white;
  265. padding: 32rpx;
  266. .housingName{
  267. font-size: 40rpx;
  268. color: rgba(51, 51, 51, 1);
  269. margin-bottom: 24rpx;
  270. }
  271. .housingImportBox{
  272. display: flex;
  273. justify-content: space-between;
  274. align-items: center;
  275. padding:0 10rpx;
  276. .housingImportItem{
  277. display: flex;
  278. flex-direction: column;
  279. align-items: center;
  280. .housingImportInfo{
  281. color: rgba(226, 81, 0, 1);
  282. font-size: 28rpx;
  283. line-height: 46rox;
  284. }
  285. .housingInportName{
  286. color: rgba(136, 136, 136, 1);
  287. font-size: 28rpx;
  288. line-height: 32rpx;
  289. margin-top: 10rpx;
  290. }
  291. }
  292. }
  293. }
  294. .placeBox{
  295. display: flex;
  296. justify-content: space-between;
  297. align-items: center;
  298. background: rgba(245, 247, 250, 1);
  299. padding: 16rpx 24rpx;
  300. border-radius: 8rpx;
  301. margin-top: 32rpx;
  302. .placeTit{
  303. color: rgba(136, 136, 136, 1);
  304. font-size: 28rpx;
  305. white-space: nowrap;
  306. }
  307. .placeInfo{
  308. color:rgba(51, 51, 51, 1);
  309. font-size: 28rpx;
  310. width: 466rpx;
  311. line-height: 42rpx;
  312. word-wrap: break-word;
  313. }
  314. .dhIcon{
  315. width: 48rpx;
  316. height: 48rpx;
  317. }
  318. }
  319. .housingInfoBox{
  320. display: flex;
  321. flex-direction: column;
  322. margin-top: 32rpx;
  323. .housingInfoItem{
  324. display: flex;
  325. align-items: center;
  326. margin-bottom: 24rpx;
  327. .infoTitle{
  328. color: rgba(136, 136, 136, 1);
  329. font-size: 28rpx;
  330. margin-left: 8rpx;
  331. width: 240rpx;
  332. }
  333. .infoMsg{
  334. font-size: 28rpx;
  335. color: rgba(51, 51, 51, 1);
  336. }
  337. }
  338. .bzInfo{
  339. width: 640rpx;
  340. padding: 0 24rpx;
  341. word-wrap: break-word;
  342. font-size: 28rpx;
  343. color: #333333;
  344. line-height: 42rpx;
  345. }
  346. }
  347. .submitBtn{
  348. width: 654rpx;
  349. height: 96rpx;
  350. display: flex;
  351. align-items: center;
  352. justify-content: center;
  353. color: white;
  354. font-size: 35rpx;
  355. background: rgba(3, 101, 249, 1);
  356. margin: 64rpx auto;
  357. }
  358. }
  359. </style>