You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

propertyPage.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <div v-if="property">
  4. <div class="container">
  5. <br />
  6. <div class="row">
  7. <div class="col-md-12 col-lg-8">
  8. <div class="title-box-d">
  9. <h1
  10. class="title-d"
  11. style="text-align:left; font-size: 250%"
  12. >{{ property.shortDescription }}</h1>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <!--/ Intro Single End /-->
  18. <!--/ property Single Star /-->
  19. <section class="property-single nav-arrow-b">
  20. <div class="container">
  21. <div class="row">
  22. <div id="app" class="scrolling-wrapper">
  23. <div class="card">
  24. <img
  25. class="image"
  26. v-for="(image, i) in propertyImages"
  27. :src="image"
  28. @click="index = i"
  29. :key="i"
  30. />
  31. </div>
  32. <gallery :images="propertyImages" :index="index" @close="index = null"></gallery>
  33. </div>
  34. </div>
  35. <br />
  36. <div class="row">
  37. <div class="col-sm-12">
  38. <div class="row justify-content-between">
  39. <div class="col-md-7 col-lg-7 section-md-t3">
  40. <div class="row">
  41. <div class="col-sm-12">
  42. <div class="title-box-d">
  43. <h3 class="title-d" style="text-align:left">Property Description</h3>
  44. </div>
  45. </div>
  46. </div>
  47. <div
  48. class="property-description"
  49. style="text-align:left"
  50. v-html="property.description"
  51. />
  52. <div v-for="display in property.displayData" :key="display.id">
  53. <div class="row section-t3" style="text-align:left">
  54. <div class="col-sm-12">
  55. <div class="title-box-d">
  56. <h3 class="title-d">{{ display.groupName }}</h3>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="summary-list">
  61. <ul class="list" v-for="item in display.values" :key="item.id">
  62. <li class="d-flex justify-content-between">
  63. <strong>{{ item.name }}:</strong>
  64. <span v-html="item.value"></span>
  65. </li>
  66. </ul>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="col-md-5 col-lg-4">
  71. <div class="property-price d-flex justify-content-center foo">
  72. <!-- <div class="card-header-c d-flex"> -->
  73. <div style="width: 300px; height: 80px; border-style: solid; color: #60CBEB;">
  74. <!-- <span class="ion-money">R</span> -->
  75. <div class="card-title-c align-self-center">
  76. <h5 class="title-c">R{{ formatPrice(property.price) }}</h5>
  77. <h6 v-if="property.pricePer">Per {{ property.pricePer }}</h6>
  78. </div>
  79. </div>
  80. <!-- </div> -->
  81. </div>
  82. <div class="property-summary">
  83. <div class="row">
  84. <div class="col-sm-12">
  85. <div class="title-box-d section-t4">
  86. <h3 class="title-d" style="text-align:left">Summary</h3>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="summary-list">
  91. <ul class="list">
  92. <li v-if="!property.isSale" class="d-flex justify-content-between">
  93. <strong>Available:</strong>
  94. <span
  95. v-if="property.dateAvailable < date"
  96. >{{ property.dateAvailable | toDate }}</span>
  97. <span v-else>Now</span>
  98. </li>
  99. <li class="d-flex justify-content-between">
  100. <strong>Property ID:</strong>
  101. <span>{{ property.id }}</span>
  102. </li>
  103. <li class="d-flex justify-content-between">
  104. <strong>Status:</strong>
  105. <span
  106. v-if="property.status"
  107. >{{ property.status.code }} - {{ property.status.description }}</span>
  108. </li>
  109. <li class="d-flex justify-content-between">
  110. <strong>Address:</strong>
  111. <span
  112. style="text-align:right"
  113. v-if="property"
  114. v-html="
  115. formatAddress(property.addressLine1) +
  116. formatAddress(property.addressLine2) +
  117. formatAddress(property.addressLine3) +
  118. formatAddress(property.suburb ? property.suburb.description : '') +
  119. formatAddress(property.city ? property.city.description : '') +
  120. formatAddress(property.province ? property.province.description : '')
  121. "
  122. ></span>
  123. </li>
  124. </ul>
  125. </div>
  126. </div>
  127. <div class="col-md-12" v-if="mayEdit">
  128. <button
  129. type="button"
  130. class="btn btn-b-n"
  131. data-toggle="modal"
  132. data-target="#myModal"
  133. >Make an Offer</button>
  134. <div id="myModal" class="modal fade" role="dialog">
  135. <div class="modal-dialog modal-lg">
  136. <!-- Modal content-->
  137. <div class="modal-content">
  138. <div class="modal-header">
  139. <button type="button" class="close" data-dismiss="modal">&times;</button>
  140. </div>
  141. <div padding-left="20px">
  142. <makeOffer
  143. name="MakeOffer"
  144. :isMakeOffer="true"
  145. :isProperty="true"
  146. :item="{
  147. id: property.id,
  148. shortDescription: property.shortDescription,
  149. description: property.description,
  150. sellPrice: property.price
  151. }"
  152. />
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div
  159. class="col-md-12"
  160. v-if="!mayEdit"
  161. style="background-color: #ff8344; color: white;"
  162. >
  163. <p>
  164. <b>Offer Pending</b>
  165. </p>
  166. </div>
  167. <div class="col-md-12">
  168. <div class="row section-t3">
  169. <div class="col-sm-12">
  170. <div class="title-box-d">
  171. <h3 class="title-d" style="text-align:left">Contact Agent</h3>
  172. </div>
  173. </div>
  174. </div>
  175. <div class="row">
  176. <div class="col-md-12">
  177. <div class="property-contact">
  178. <form class="form-a">
  179. <div class="row">
  180. <div class="col-md-12 mb-1">
  181. <div class="form-group">
  182. <input
  183. type="text"
  184. class="form-control form-control-lg form-control-a"
  185. id="inputName"
  186. placeholder="Name *"
  187. required
  188. />
  189. </div>
  190. </div>
  191. <div class="col-md-12 mb-1">
  192. <div class="form-group">
  193. <input
  194. type="email"
  195. class="form-control form-control-lg form-control-a"
  196. id="inputEmail1"
  197. placeholder="Email *"
  198. required
  199. />
  200. </div>
  201. </div>
  202. <div class="col-md-12 mb-1">
  203. <div class="form-group">
  204. <textarea
  205. id="textMessage"
  206. class="form-control"
  207. placeholder="Comment *"
  208. name="message"
  209. cols="45"
  210. rows="8"
  211. required
  212. ></textarea>
  213. </div>
  214. </div>
  215. <div class="col-md-12">
  216. <button type="submit" class="btn btn-b-n">Send Message</button>
  217. </div>
  218. </div>
  219. </form>
  220. <br />
  221. </div>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. <!-- Tab Control -->
  230. <div class="row">
  231. <div class="col-md-12">
  232. <div v-if="property.virtualTour" class="row justify-content-between">
  233. <div class="col-md-12 col-lg-12 section-md-t3">
  234. <div class="row">
  235. <div class="col-md-12">
  236. <div class="title-box-d">
  237. <h3 class="title-d" style="text-align:left">Virtual Tour</h3>
  238. </div>
  239. </div>
  240. </div>
  241. <iframe
  242. :src="property.virtualTour"
  243. width="100%"
  244. height="700"
  245. frameborder="0"
  246. webkitallowfullscreen
  247. mozallowfullscreen
  248. allowfullscreen
  249. ></iframe>
  250. </div>
  251. </div>
  252. <div class="row">
  253. <br />
  254. </div>
  255. <div v-if="property.video" class="row justify-content-between">
  256. <div class="col-md-12 col-lg-12 section-md-t3">
  257. <div class="row">
  258. <div class="col-md-12">
  259. <div class="title-box-d">
  260. <h3 class="title-d" style="text-align:left">Video</h3>
  261. </div>
  262. </div>
  263. </div>
  264. <iframe
  265. :src="`https://www.youtube.com/embed/${property.video}`"
  266. width="100%"
  267. height="700"
  268. frameborder="0"
  269. style="border:0"
  270. allowfullscreen
  271. ></iframe>
  272. </div>
  273. </div>
  274. </div>
  275. <!-- End Tab Control -->
  276. </div>
  277. </div>
  278. </section>
  279. </div>
  280. </template>
  281. <script>
  282. import { mapState, mapActions } from 'vuex';
  283. import makeOffer from '../processFlow/makeOffer.vue';
  284. import gallery from '../shared/gallerySlideShow.vue';
  285. export default {
  286. name: 'property',
  287. components: {
  288. makeOffer,
  289. gallery,
  290. },
  291. data() {
  292. return {
  293. index: null,
  294. date: new Date(),
  295. };
  296. },
  297. mounted() {
  298. this.getProperty(this.$route.params.id);
  299. this.getPropertyImages(this.$route.params.id);
  300. this.mayEditProperty(this.$route.params.id);
  301. },
  302. computed: {
  303. ...mapState('property', ['property', 'propertyImages']),
  304. ...mapState('propertyEdit', ['mayEdit']),
  305. },
  306. methods: {
  307. ...mapActions('property', [
  308. 'getProperty',
  309. 'getPropertyImages',
  310. 'clearPropertyImages',
  311. ]),
  312. ...mapActions('propertyEdit', ['mayEditProperty']),
  313. formatPrice(value) {
  314. const val = (value / 1).toFixed(2);
  315. return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
  316. },
  317. formatAddress(value) {
  318. if (value !== '') {
  319. return `${value}<br/>`;
  320. }
  321. return '';
  322. },
  323. },
  324. beforeDestroy() {
  325. this.clearPropertyImages();
  326. },
  327. };
  328. </script>
  329. <style lang="scss">
  330. .image {
  331. width: 150px;
  332. height: 150px;
  333. background-size: cover;
  334. cursor: pointer;
  335. margin: 5px;
  336. border-radius: 3px;
  337. border: 1px solid lightgray;
  338. object-fit: contain;
  339. }
  340. .scrolling-wrapper {
  341. overflow-x: scroll;
  342. overflow-y: hidden;
  343. white-space: nowrap;
  344. .card {
  345. display: inline-block;
  346. }
  347. }
  348. </style>