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.

commercialSearchResults.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <main id="main" style="margin-top:-20px; padding-bottom:50px">
  3. <div v-if="wait" id="preloader"></div>
  4. <div class="row pt-5 justify-content-md-center">
  5. <h3 v-if="propertySearch.salesType === 'Sale'">COMMERCIAL PROPERTIES FOR SALE</h3>
  6. <h3 v-else-if="propertySearch.salesType === 'Rent'">COMMERCIAL PROPERTIES FOR RENT</h3>
  7. </div>
  8. <propertyCard
  9. v-if="properties.length > 0"
  10. name="propertyholder"
  11. :properties="properties"
  12. :showSort="false"
  13. />
  14. <!-- <section v-if="properties.length > 0">
  15. <div class="container">
  16. <div class="row justify-content-md-center">
  17. <div
  18. class="col-lg-3 col-md-6 col-sm-6"
  19. v-for="currentProperty in properties"
  20. :key="currentProperty.id"
  21. >
  22. <div>
  23. <div class="portfolio-item">
  24. <img style="width:255px; height:255px" :src="currentProperty.displayImage" alt />
  25. <h4>{{ currentProperty.displayPrice }}</h4>
  26. <p>
  27. {{ currentProperty.suburb }}, {{ currentProperty.city }} |
  28. {{ currentProperty.area }}
  29. </p>
  30. <p>{{ currentProperty.shortDescription }}</p>
  31. <br />
  32. <a href="commercialproperty-page.php" class="btn-white-border">VIEW</a>
  33. <router-link
  34. class="btn-white-border"
  35. :to="`/property/commercial/property/${currentProperty.id}`"
  36. >VIEW</router-link
  37. >
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </section> -->
  44. <section v-else id="intro" style="margin-bottom:-50px">
  45. <div class="container">
  46. <div class="row d-flex justify-content-center">
  47. <div class="col-md-8">
  48. <div class="intro-content box text-center">
  49. <h2>Sorry no listing where found matching your search</h2>
  50. <a class="btn-white-border" href="javascript:history.back()">BACK TO SEARCH</a>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <carousel
  56. :nav="false"
  57. :dots="false"
  58. :items="1"
  59. :autoplay="true"
  60. :loop="true"
  61. id="intro-carousel"
  62. style="margin-top:-50px"
  63. :responsive="{ 0: { items: 1, nav: false }, 600: { items: 1, nav: false } }"
  64. >
  65. <img class="item" src="img/intro-carousel/comm-1.jpg" alt />
  66. <img class="item" src="img/intro-carousel/comm-2.jpg" alt />
  67. <img class="item" src="img/intro-carousel/comm-3.jpg" alt />
  68. <img class="item" src="img/intro-carousel/comm-4.jpg" alt />
  69. <img class="item" src="img/intro-carousel/comm-5.jpg" alt />
  70. <img class="item" src="img/intro-carousel/comm-6.jpg" alt />
  71. </carousel>
  72. </section>
  73. </main>
  74. </template>
  75. <script>
  76. /* eslint-disable */
  77. import { mapState, mapActions } from "vuex";
  78. import propertyCard from "../propertyCardSearch";
  79. import carousel from "vue-owl-carousel";
  80. export default {
  81. name: "propertysearch",
  82. components: {
  83. propertyCard,
  84. carousel
  85. },
  86. data() {
  87. return {
  88. wait: true
  89. };
  90. },
  91. mounted() {
  92. this.wait = true;
  93. if (typeof this.propertySearch.propertyUsageType === "undefined") {
  94. this.propertySearch.propertyUsageType = "Commercial";
  95. }
  96. if (this.user) {
  97. this.propertySearch.userName = this.user.username;
  98. }
  99. this.searchProperties(this.propertySearch).then(fulfilled => {
  100. this.wait = false;
  101. });
  102. },
  103. methods: {
  104. ...mapActions("propertySearch", [
  105. "searchProperties",
  106. "clearProperties",
  107. "updateResultsShowing"
  108. ]),
  109. SetType(item) {
  110. this.propertySearch.propertyUsageType = item;
  111. },
  112. SearchPage() {
  113. this.clearProperties();
  114. this.$router.push("/property/search");
  115. }
  116. },
  117. computed: {
  118. ...mapState("propertySearch", ["properties", "propertySearch", "resultsShowing"]),
  119. ...mapState("authentication", ["user"]),
  120. ParamsChanged() {
  121. console.log(JSON.stringify(this.propertySearch));
  122. if (typeof this.propertySearch.propertyUsageType === "undefined") {
  123. // eslint-disable-next-line vue/no-side-effects-in-computed-properties
  124. this.propertySearch.propertyUsageType = "Residential";
  125. }
  126. this.searchProperties(this.propertySearch).then(fulfilled => {
  127. this.wait = false;
  128. });
  129. return null;
  130. }
  131. },
  132. watch: {
  133. ParamsChanged() {
  134. return null;
  135. }
  136. }
  137. };
  138. </script>
  139. <style lang="scss" scoped></style>