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.

residentialSearchResults.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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'">RESIDENTIAL PROPERTIES FOR SALE</h3>
  6. <h3 v-else-if="propertySearch.salesType === 'Rent'">RESIDENTIAL 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-else id="intro" style="margin-bottom:-50px">
  15. <br/>
  16. <div class="container">
  17. <div class="row d-flex justify-content-center">
  18. <div class="col-md-8">
  19. <div class="intro-content box text-center">
  20. <h2>Sorry no listing where found matching your search</h2>
  21. <a class="btn-white-border" href="javascript:history.back()">BACK TO SEARCH</a>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <carousel
  27. :nav="false"
  28. :dots="false"
  29. :items="1"
  30. :autoplay="true"
  31. :loop="true"
  32. id="intro-carousel_residential"
  33. style="margin-top:-50px"
  34. :responsive="{ 0: { items: 1, nav: false }, 600: { items: 1, nav: false } }"
  35. >
  36. <img class="item" src="img/intro-carousel/comm-1.jpg" alt />
  37. <img class="item" src="img/intro-carousel/comm-2.jpg" alt />
  38. <img class="item" src="img/intro-carousel/comm-3.jpg" alt />
  39. <img class="item" src="img/intro-carousel/comm-4.jpg" alt />
  40. <img class="item" src="img/intro-carousel/comm-5.jpg" alt />
  41. <img class="item" src="img/intro-carousel/comm-6.jpg" alt />
  42. </carousel>
  43. </section>
  44. </main>
  45. </template>
  46. <script>
  47. /* eslint-disable */
  48. import { mapState, mapActions } from "vuex";
  49. import propertyCard from "../propertyCardSearch";
  50. import carousel from "vue-owl-carousel";
  51. export default {
  52. name: "propertysearch",
  53. components: {
  54. propertyCard,
  55. carousel
  56. },
  57. data() {
  58. return {
  59. wait: true
  60. };
  61. },
  62. mounted() {
  63. this.wait = true;
  64. console.log(this.propertySearch.salesType);
  65. if (typeof this.propertySearch.propertyUsageType === "undefined") {
  66. this.propertySearch.propertyUsageType = "Residential";
  67. }
  68. if (this.user) {
  69. this.propertySearch.userName = this.user.username;
  70. }
  71. this.searchProperties(this.propertySearch).then(fulfilled => {
  72. this.wait = false;
  73. });
  74. },
  75. methods: {
  76. ...mapActions("propertySearch", [
  77. "searchProperties",
  78. "clearProperties",
  79. "updateResultsShowing"
  80. ]),
  81. SetType(item) {
  82. this.propertySearch.propertyUsageType = item;
  83. },
  84. SearchPage() {
  85. this.clearProperties();
  86. this.$router.push("/property/search");
  87. }
  88. },
  89. computed: {
  90. ...mapState("propertySearch", ["properties", "propertySearch", "resultsShowing"]),
  91. ...mapState("authentication", ["user"]),
  92. ParamsChanged() {
  93. console.log(JSON.stringify(this.propertySearch));
  94. if (typeof this.propertySearch.propertyUsageType === "undefined") {
  95. // eslint-disable-next-line vue/no-side-effects-in-computed-properties
  96. this.propertySearch.propertyUsageType = "Residential";
  97. }
  98. this.searchProperties(this.propertySearch).then(fulfilled => {
  99. this.wait = false;
  100. });
  101. return null;
  102. }
  103. },
  104. watch: {
  105. ParamsChanged() {
  106. return null;
  107. }
  108. },
  109. beforeDestroy(){
  110. this.propertySearch.city = "All";
  111. this.propertySearch.suburb = "All";
  112. this.propertySearch.province = "All";
  113. }
  114. };
  115. </script>
  116. <style lang="scss" scoped></style>