Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

propertyPage.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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. <!-- Should not be visible? -->
  104. <!-- <li class="d-flex justify-content-between">
  105. <strong>Status:</strong>
  106. <span
  107. v-if="property.status"
  108. >{{ property.status.code }} - {{ property.status.description }}</span>
  109. </li>-->
  110. <li class="d-flex justify-content-between">
  111. <strong>Address:</strong>
  112. <span
  113. style="text-align:right"
  114. v-if="property"
  115. v-html="
  116. formatAddress(property.addressLine1) +
  117. formatAddress(property.addressLine2) +
  118. formatAddress(property.addressLine3) +
  119. formatAddress(property.suburb ? property.suburb.description : '') +
  120. formatAddress(property.city ? property.city.description : '') +
  121. formatAddress(property.province ? property.province.description : '')
  122. "
  123. ></span>
  124. </li>
  125. </ul>
  126. </div>
  127. </div>
  128. <div class="col-md-12" v-if="mayEdit">
  129. <button
  130. type="button"
  131. class="btn btn-b-n"
  132. data-toggle="modal"
  133. data-target="#myModal"
  134. >Make an Offer</button>
  135. <div id="myModal" class="modal fade" role="dialog">
  136. <div class="modal-dialog modal-lg">
  137. <!-- Modal content-->
  138. <div class="modal-content">
  139. <div class="modal-header">
  140. <button type="button" class="close" data-dismiss="modal">&times;</button>
  141. </div>
  142. <div padding-left="20px">
  143. <makeOffer
  144. name="MakeOffer"
  145. :isMakeOffer="true"
  146. :isProperty="true"
  147. :item="{
  148. id: property.id,
  149. shortDescription: property.shortDescription,
  150. description: property.description,
  151. price: property.price
  152. }"
  153. />
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <div
  160. class="col-md-12"
  161. v-if="!mayEdit"
  162. style="background-color: #ff8344; color: white;"
  163. >
  164. <p>
  165. <b>Offer Pending</b>
  166. </p>
  167. </div>
  168. <div class="col-md-12">
  169. <div class="row section-t3">
  170. <div class="col-sm-12">
  171. <div class="title-box-d">
  172. <h3 class="title-d" style="text-align:left">Contact Agent</h3>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="row">
  177. <div class="col-md-12">
  178. <div class="property-contact">
  179. <form class="form-a">
  180. <div class="row">
  181. <div class="col-md-12 mb-1">
  182. <div class="form-group">
  183. <input
  184. type="text"
  185. class="form-control form-control-lg form-control-a"
  186. id="inputName"
  187. placeholder="Name *"
  188. required
  189. />
  190. </div>
  191. </div>
  192. <div class="col-md-12 mb-1">
  193. <div class="form-group">
  194. <input
  195. type="email"
  196. class="form-control form-control-lg form-control-a"
  197. id="inputEmail1"
  198. placeholder="Email *"
  199. required
  200. />
  201. </div>
  202. </div>
  203. <div class="col-md-12 mb-1">
  204. <div class="form-group">
  205. <textarea
  206. id="textMessage"
  207. class="form-control"
  208. placeholder="Comment *"
  209. name="message"
  210. cols="45"
  211. rows="8"
  212. required
  213. ></textarea>
  214. </div>
  215. </div>
  216. <div class="col-md-12">
  217. <button type="submit" class="btn btn-b-n">Send Message</button>
  218. </div>
  219. </div>
  220. </form>
  221. <br />
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <!-- Tab Control -->
  231. <div class="row">
  232. <div class="col-md-12">
  233. <div v-if="property.virtualTour" class="row justify-content-between">
  234. <div class="col-md-12 col-lg-12 section-md-t3">
  235. <div class="row">
  236. <div class="col-md-12">
  237. <div class="title-box-d">
  238. <h3 class="title-d" style="text-align:left">Virtual Tour</h3>
  239. </div>
  240. </div>
  241. </div>
  242. <iframe
  243. :src="property.virtualTour"
  244. width="100%"
  245. height="700"
  246. frameborder="0"
  247. webkitallowfullscreen
  248. mozallowfullscreen
  249. allowfullscreen
  250. ></iframe>
  251. </div>
  252. </div>
  253. <div class="row">
  254. <br />
  255. </div>
  256. <div v-if="property.video" class="row justify-content-between">
  257. <div class="col-md-12 col-lg-12 section-md-t3">
  258. <div class="row">
  259. <div class="col-md-12">
  260. <div class="title-box-d">
  261. <h3 class="title-d" style="text-align:left">Video</h3>
  262. </div>
  263. </div>
  264. </div>
  265. <iframe
  266. :src="`https://www.youtube.com/embed/${property.video}`"
  267. width="100%"
  268. height="700"
  269. frameborder="0"
  270. style="border:0"
  271. allowfullscreen
  272. ></iframe>
  273. </div>
  274. </div>
  275. </div>
  276. <!-- End Tab Control -->
  277. </div>
  278. </div>
  279. </section>
  280. </div>
  281. </template>
  282. <script>
  283. import { mapState, mapActions } from "vuex";
  284. import makeOffer from "../processFlow/makeOffer.vue";
  285. import gallery from "../shared/gallerySlideShow.vue";
  286. export default {
  287. name: "property",
  288. components: {
  289. makeOffer,
  290. gallery
  291. },
  292. data() {
  293. return {
  294. index: null,
  295. date: new Date()
  296. };
  297. },
  298. mounted() {
  299. this.getProperty(this.$route.params.id);
  300. this.getPropertyImages(this.$route.params.id);
  301. this.mayEditProperty(this.$route.params.id);
  302. },
  303. computed: {
  304. ...mapState("property", ["property", "propertyImages"]),
  305. ...mapState("propertyEdit", ["mayEdit"])
  306. },
  307. methods: {
  308. ...mapActions("property", [
  309. "getProperty",
  310. "getPropertyImages",
  311. "clearPropertyImages"
  312. ]),
  313. ...mapActions("propertyEdit", ["mayEditProperty"]),
  314. formatPrice(value) {
  315. const val = (value / 1).toFixed(2);
  316. return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
  317. },
  318. formatAddress(value) {
  319. if (value !== "") {
  320. return `${value}<br/>`;
  321. }
  322. return "";
  323. }
  324. },
  325. beforeDestroy() {
  326. this.clearPropertyImages();
  327. }
  328. };
  329. </script>
  330. <style lang="scss">
  331. .image {
  332. width: 150px;
  333. height: 150px;
  334. background-size: cover;
  335. cursor: pointer;
  336. margin: 5px;
  337. border-radius: 3px;
  338. border: 1px solid lightgray;
  339. object-fit: contain;
  340. }
  341. .scrolling-wrapper {
  342. overflow-x: scroll;
  343. overflow-y: hidden;
  344. white-space: nowrap;
  345. .card {
  346. display: inline-block;
  347. }
  348. }
  349. </style>