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.

contentSection.vue 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <section>
  3. <div class="container">
  4. <div class="row" id="resort-profile">
  5. <div class="col-md-4">
  6. <div class="resPortfolioSection">
  7. <iframe
  8. v-if="property.video != null"
  9. width="100%"
  10. :src="'https://www.youtube.com/embed/' + property.video"
  11. frameborder="0"
  12. allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
  13. allowfullscreen
  14. style="margin-bottom:-6px"
  15. ></iframe>
  16. <div v-for="(image, i) in propertyImages" @click="index = i" :key="i">
  17. <div v-if="i < 3">
  18. <img v-if="i === 0" style="width:100%" :src="image.image" />
  19. <div v-else-if="i !== 0">
  20. <img
  21. v-if="i % 2 === 0"
  22. style="width:50%; height:140px; float:right;"
  23. :src="image.image"
  24. />
  25. <img v-else style="width:50%; height:140px; float:left" :src="image.image" />
  26. </div>
  27. </div>
  28. </div>
  29. <gallery :images="Images" :index="index" @close="index = null"></gallery>
  30. </div>
  31. <div class="panel-left p-5" style="margin-top:130px">
  32. <h2>Property Detail</h2>
  33. <!-- TODO: Make it dynamic -->
  34. <h4 style="color:white" v-if="property.statusString === 'For Sale'">
  35. {{ property.price | toCurrency }}
  36. </h4>
  37. <h4 style="color:white" v-else>{{ property.price | toCurrency }} Per Month</h4>
  38. <p>#{{ property.propertyRef }}</p>
  39. <p v-if="property.showAddress">{{ property.addressOther }}</p>
  40. <p v-if="property.showAddress">{{ property.streetNumber }} {{ property.streetName }}</p>
  41. <p>{{ property.city }}, {{ property.suburb }}</p>
  42. <div v-for="(data, i) in property.displayData" :key="i">
  43. <div v-for="field in data.values" :key="field.id">
  44. <p v-if="field.name === 'Floor Size'">{{ field.value }}</p>
  45. <p v-if="field.name === 'Bedrooms'">Bedrooms {{ field.value }}</p>
  46. <p v-if="field.name === 'Bathrooms'">Bathrooms {{ field.value }}</p>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="panel-left px-5 pb-5 text-center">
  51. <h4 class="text-white">Share this Property</h4>
  52. <ShareNetwork
  53. v-if="currentUrl !== ''"
  54. network="facebook"
  55. :url="currentUrl"
  56. title="Uni-Vate Property Listing"
  57. description="Check out this property on Uni-Vate Properties!"
  58. quote="The hot reload is so fast it\'s near instant. - Evan You"
  59. hashtags="vuejs,vite"
  60. >
  61. <img src="img/icon-facebook.svg" alt="Share on Facebook" class="col-3 p-1 mx-1" />
  62. </ShareNetwork>
  63. <a
  64. href="mailto:?Subject=Simple Share Buttons&amp;Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://www.univateproperties.co.za/"
  65. >
  66. <img src="/img/icon-email.svg" alt="Share on email" class="col-3 p-1 mx-1" />
  67. </a>
  68. <a
  69. href="whatsapp://send?text=Check out this property!"
  70. data-action="share/whatsapp/share"
  71. target="_blank"
  72. >
  73. <img src="img/icon-whatsapp.svg" alt="Share on whatsapp" class="col-3 p-1 mx-1" />
  74. </a>
  75. </div>
  76. </div>
  77. <div class="col-md-8 p-5 resort-profile">
  78. <h2 v-if="property.showAddress">
  79. <div style="display:inline" v-if="property.propertyName !== null">
  80. {{ property.propertyName }} /
  81. </div>
  82. {{ property.streetNumber }} {{ property.streetName }}
  83. </h2>
  84. <h2 v-else>{{ property.propertyName }}</h2>
  85. <div class="container">
  86. <div class="row">
  87. <div class="col">
  88. <p v-html="property.description"></p>
  89. </div>
  90. </div>
  91. <div class="row">
  92. <div class="col">
  93. <h4>Property Features</h4>
  94. </div>
  95. </div>
  96. <div class="row">
  97. <div class="col-md-8">
  98. <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
  99. <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
  100. <div
  101. :style="
  102. field.value.toUpperCase() === 'FALSE' ? 'display:none' : 'display:show'
  103. "
  104. v-if="field.value.toUpperCase() !== 'TRUE'"
  105. >
  106. <i class="fa fa-check-circle"></i>
  107. {{ field.value }} {{ field.name }}
  108. </div>
  109. <div v-else>
  110. <i class="fa fa-check-circle"></i>
  111. {{ field.name }}
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="col-md-4">
  117. <button
  118. style="float:right; white-space: nowrap;"
  119. :class="status ? 'btn-disabled mt-3' : 'btn-solid-blue mt-3'"
  120. :disabled="status"
  121. @click="goToSingle()"
  122. >
  123. ENQUIRE NOW
  124. </button>
  125. </div>
  126. </div>
  127. </div>
  128. <h4 v-if="property.virtualTour != null" style="margin-top:150px">Virtual Tour</h4>
  129. <iframe
  130. v-if="property.virtualTour != null"
  131. width="100%"
  132. height="500px"
  133. :src="property.virtualTour"
  134. frameborder="0"
  135. allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
  136. allowfullscreen
  137. style="margin-bottom:-6px"
  138. class="mt-3"
  139. ></iframe>
  140. <h4 v-if="property.video != null" class="mt-5">Video</h4>
  141. <iframe
  142. v-if="property.video != null"
  143. width="100%"
  144. height="500px"
  145. :src="'https://www.youtube.com/embed/' + property.video"
  146. frameborder="0"
  147. allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
  148. allowfullscreen
  149. style="margin-bottom:-6px"
  150. class="mt-3"
  151. ></iframe>
  152. <p></p>
  153. <div class="d-flex mt-3">
  154. <iframe
  155. width="100%"
  156. height="200"
  157. id="gmap_canvas"
  158. :src="propertyMap"
  159. frameborder="0"
  160. scrolling="no"
  161. marginheight="0"
  162. marginwidth="0"
  163. ></iframe>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </section>
  169. </template>
  170. <script>
  171. /* eslint-disable */
  172. import { mapState, mapActions } from "vuex";
  173. import gallery from "../../../shared/gallerySlideShow";
  174. import { ShareFacebook } from "vue-social-sharing";
  175. export default {
  176. components: {
  177. gallery,
  178. ShareFacebook
  179. },
  180. props: {
  181. property: {},
  182. propertyImages: {},
  183. status: {}
  184. },
  185. async mounted() {
  186. await this.checkForVideos;
  187. this.currentUrl = window.location.origin + this.$route.fullPath;
  188. },
  189. data() {
  190. return {
  191. index: null,
  192. date: new Date(),
  193. currentUrl: ""
  194. };
  195. },
  196. methods: {
  197. //...mapActions("searchTab", ["getListsForPropertyEdit"])
  198. checkForVideos() {
  199. if (this.property.video === "") {
  200. this.property.video = null;
  201. }
  202. if (this.property.virtualTour === "") {
  203. this.property.virtualTour = null;
  204. }
  205. },
  206. goToSingle() {
  207. this.$router.push({ name: "EnquireNow", params: { id: this.$route.params.id } });
  208. }
  209. },
  210. computed: {
  211. //...mapState("searchTab", ["provinces", "cities", "suburbs"]),
  212. propertyMap() {
  213. if (this.property.propertCoords) {
  214. var lat = this.property.propertCoords.split(",")[0];
  215. var lng = this.property.propertCoords.split(",")[1];
  216. // var url =
  217. // "https://maps.google.com/maps?q=" +
  218. // lat.replace(".", ",") +
  219. // "," +
  220. // lng.replace(".", ",") +
  221. // "&hl=es&z=14&amp;output=embed";
  222. var url = "";
  223. return url;
  224. }
  225. return "";
  226. },
  227. Images() {
  228. const list = [];
  229. for (let i = 0; i < this.propertyImages.length; i++) {
  230. list.push(this.propertyImages[i].image);
  231. }
  232. return list;
  233. }
  234. },
  235. created() {
  236. this.$emit("Loaded", true);
  237. }
  238. };
  239. </script>
  240. <style lang="scss" scoped>
  241. .btn-disabled {
  242. font-family: "Muli";
  243. font-size: 15px;
  244. letter-spacing: 1px;
  245. display: inline-block;
  246. padding: 10px 32px;
  247. border-radius: 2px;
  248. transition: 0.5s;
  249. margin: 10px;
  250. color: #fff;
  251. background: grey;
  252. border-color: black;
  253. color: black;
  254. cursor: not-allowed;
  255. }
  256. .btn-disabled :hover {
  257. background: grey;
  258. border-color: black;
  259. color: black;
  260. cursor: not-allowed;
  261. }
  262. /* Extra small devices (phones, 600px and down) */
  263. @media only screen and (max-width: 575px) {
  264. .resPortfolioSection {
  265. margin-bottom: 100px;
  266. }
  267. }
  268. /* Small devices (portrait tablets and large phones, 600px and up) */
  269. @media only screen and (min-width: 576px) {
  270. .resPortfolioSection {
  271. margin-bottom: 140px;
  272. }
  273. }
  274. /* Medium devices (landscape tablets, 768px and up) */
  275. @media only screen and (min-width: 768px) {
  276. .resPortfolioSection {
  277. margin-bottom: 50px;
  278. }
  279. }
  280. /* Large devices (laptops/desktops, 992px and up) */
  281. @media only screen and (min-width: 992px) {
  282. .resPortfolioSection {
  283. margin-bottom: 60px;
  284. }
  285. }
  286. /* Extra large devices (large laptops and desktops, 1200px and up) */
  287. @media only screen and (min-width: 1200px) {
  288. .resPortfolioSection {
  289. margin-bottom: 80px;
  290. }
  291. }
  292. </style>