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 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <div v-if="property">
  4. <section class="intro-single">
  5. <div class="container">
  6. <div class="row">
  7. <div class="col-md-12 col-lg-8">
  8. <div class="title-single-box">
  9. <h1 class="title-single">{{ property.shortDescription }}</h1>
  10. </div>
  11. </div>
  12. </div>
  13. </div>
  14. </section>
  15. <!--/ Intro Single End /-->
  16. <!--/ property Single Star /-->
  17. <section class="property-single nav-arrow-b">
  18. <div class="container">
  19. <div class="row">
  20. <lightBox
  21. :thumbnails="propertyImages"
  22. :largeImages="propertyImages"
  23. :caption="false"
  24. class="lightBox"
  25. />
  26. </div>
  27. <div class="row">
  28. <div class="col-sm-12">
  29. <div class="row justify-content-between">
  30. <div class="col-md-7 col-lg-7 section-md-t3">
  31. <div class="row">
  32. <div class="col-sm-12">
  33. <div class="title-box-d">
  34. <h3 class="title-d">Property Description</h3>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="property-description" v-html="property.description" />
  39. <div v-for="display in property.displayData" :key="display.id">
  40. <div class="row section-t3">
  41. <div class="col-sm-12">
  42. <div class="title-box-d">
  43. <h3 class="title-d">{{ display.groupName }}</h3>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="summary-list">
  48. <ul class="list" v-for="item in display.values" :key="item.id">
  49. <li class="d-flex justify-content-between">
  50. <strong>{{ item.name }}:</strong>
  51. <span v-html="item.value"></span>
  52. </li>
  53. </ul>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="col-md-5 col-lg-4">
  58. <div class="property-price d-flex justify-content-center foo">
  59. <div class="card-header-c d-flex">
  60. <div class="card-box-ico">
  61. <span class="ion-money">R</span>
  62. </div>
  63. <div class="card-title-c align-self-center">
  64. <h5 class="title-c">{{ formatPrice(property.price) }}</h5>
  65. <h6 v-if="property.pricePer">Per {{property.pricePer}}</h6>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="property-summary">
  70. <div class="row">
  71. <div class="col-sm-12">
  72. <div class="title-box-d section-t4">
  73. <h3 class="title-d">Summary</h3>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="summary-list">
  78. <ul class="list">
  79. <li class="d-flex justify-content-between">
  80. <strong>Property ID:</strong>
  81. <span>{{ property.id }}</span>
  82. </li>
  83. <li class="d-flex justify-content-between">
  84. <strong>Status:</strong>
  85. <span v-if="property.isSale">Sale</span>
  86. <span v-else>Rental</span>
  87. </li>
  88. <li class="d-flex justify-content-between">
  89. <strong>Address:</strong>
  90. <span
  91. v-if="property"
  92. v-html="formatAddress(property.addressLine1) + formatAddress(property.addressLine2) + formatAddress(property.addressLine3) + formatAddress(property.suburb ? property.suburb.description : '') + formatAddress(property.city ? property.city.description : '') + formatAddress(property.province ? property.province.description : '') "
  93. ></span>
  94. </li>
  95. </ul>
  96. </div>
  97. </div>
  98. <div class="col-md-12">
  99. <button
  100. type="button"
  101. class="btn btn-b-n"
  102. data-toggle="modal"
  103. data-target="#myModal"
  104. >Make an Offer</button>
  105. <div id="myModal" class="modal fade" role="dialog">
  106. <div class="modal-dialog modal-lg">
  107. <!-- Modal content-->
  108. <div class="modal-content">
  109. <div class="modal-header">
  110. <button type="button" class="close" data-dismiss="modal">&times;</button>
  111. </div>
  112. <div padding-left="20px">
  113. <makeOffer
  114. name="MakeOffer"
  115. :isMakeOffer="true"
  116. :isProperty="true"
  117. :item="{id: property.id, shortDescription: property.shortDescription, description: property.description, price: property.price}"
  118. />
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="col-md-12">
  125. <div class="row section-t3">
  126. <div class="col-sm-12">
  127. <div class="title-box-d">
  128. <h3 class="title-d">Contact Agent</h3>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="row">
  133. <div class="col-md-12">
  134. <img src="img/agent-4.jpg" alt class="img-fluid" />
  135. </div>
  136. </div>
  137. <div class="row">
  138. <div class="col-md-12">
  139. <div class="property-agent">
  140. <h4 class="title-agent">Anabella Geller</h4>
  141. <p class="color-text-a">
  142. Nulla porttitor accumsan tincidunt. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet
  143. dui. Quisque velit nisi,
  144. pretium ut lacinia in, elementum id enim.
  145. </p>
  146. <ul class="list-unstyled">
  147. <li class="d-flex justify-content-between">
  148. <strong>Phone:</strong>
  149. <span class="color-text-a">(222) 4568932</span>
  150. </li>
  151. <li class="d-flex justify-content-between">
  152. <strong>Mobile:</strong>
  153. <span class="color-text-a">777 287 378 737</span>
  154. </li>
  155. <li class="d-flex justify-content-between">
  156. <strong>Email:</strong>
  157. <span class="color-text-a">annabella@example.com</span>
  158. </li>
  159. <li class="d-flex justify-content-between">
  160. <strong>Skype:</strong>
  161. <span class="color-text-a">Annabela.ge</span>
  162. </li>
  163. </ul>
  164. <div class="socials-a">
  165. <ul class="list-inline">
  166. <li class="list-inline-item">
  167. <a href="#">
  168. <i class="fa fa-facebook" aria-hidden="true"></i>
  169. </a>
  170. </li>
  171. <li class="list-inline-item">
  172. <a href="#">
  173. <i class="fa fa-twitter" aria-hidden="true"></i>
  174. </a>
  175. </li>
  176. <li class="list-inline-item">
  177. <a href="#">
  178. <i class="fa fa-instagram" aria-hidden="true"></i>
  179. </a>
  180. </li>
  181. <li class="list-inline-item">
  182. <a href="#">
  183. <i class="fa fa-pinterest-p" aria-hidden="true"></i>
  184. </a>
  185. </li>
  186. <li class="list-inline-item">
  187. <a href="#">
  188. <i class="fa fa-dribbble" aria-hidden="true"></i>
  189. </a>
  190. </li>
  191. </ul>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. <div class="row">
  197. <div class="col-md-12">
  198. <div class="property-contact">
  199. <form class="form-a">
  200. <div class="row">
  201. <div class="col-md-12 mb-1">
  202. <div class="form-group">
  203. <input
  204. type="text"
  205. class="form-control form-control-lg form-control-a"
  206. id="inputName"
  207. placeholder="Name *"
  208. required
  209. />
  210. </div>
  211. </div>
  212. <div class="col-md-12 mb-1">
  213. <div class="form-group">
  214. <input
  215. type="email"
  216. class="form-control form-control-lg form-control-a"
  217. id="inputEmail1"
  218. placeholder="Email *"
  219. required
  220. />
  221. </div>
  222. </div>
  223. <div class="col-md-12 mb-1">
  224. <div class="form-group">
  225. <textarea
  226. id="textMessage"
  227. class="form-control"
  228. placeholder="Comment *"
  229. name="message"
  230. cols="45"
  231. rows="8"
  232. required
  233. ></textarea>
  234. </div>
  235. </div>
  236. <div class="col-md-12">
  237. <button type="submit" class="btn btn-a">Send Message</button>
  238. </div>
  239. </div>
  240. </form>
  241. </div>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. </section>
  251. </div>
  252. </template>
  253. <script>
  254. import { mapState, mapActions } from 'vuex';
  255. import lightBox from '../shared/lightBoxGallery.vue';
  256. import makeOffer from '../processFlow/makeOffer.vue';
  257. export default {
  258. name: 'property',
  259. components: {
  260. lightBox,
  261. makeOffer,
  262. },
  263. data() {
  264. return {};
  265. },
  266. mounted() {
  267. this.getProperty(this.$route.params.id);
  268. this.getPropertyImages(this.$route.params.id);
  269. },
  270. computed: {
  271. ...mapState('property', ['property', 'propertyImages']),
  272. },
  273. methods: {
  274. ...mapActions('property', [
  275. 'getProperty',
  276. 'getPropertyImages',
  277. 'clearPropertyImages',
  278. ]),
  279. formatPrice(value) {
  280. const val = (value / 1).toFixed(2);
  281. return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
  282. },
  283. formatAddress(value) {
  284. if (value !== '') {
  285. return `${value}<br/>`;
  286. }
  287. return '';
  288. },
  289. },
  290. beforeDestroy() {
  291. this.clearPropertyImages();
  292. },
  293. };
  294. </script>
  295. <style lang ="scss">
  296. .light-box {
  297. &__thumbnail {
  298. margin: 20px;
  299. width: 200px;
  300. }
  301. }
  302. img {
  303. max-width: 100%;
  304. }
  305. </style>