Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

commercialSearchResults.vue 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <main id="main" style="margin-top:-20px; padding-bottom:50px">
  3. <section>
  4. <div class="container">
  5. <div class="row pt-5 justify-content-md-center">
  6. <h3 v-if="propertySearch.salesType === 'Sale'">COMMERCIAL PROPERTIES FOR SALE</h3>
  7. <h3 v-else-if="propertySearch.salesType === 'Rent'">COMMERCIAL PROPERTIES FOR RENT</h3>
  8. </div>
  9. <div v-if="properties.length > 0" class="row justify-content-md-center">
  10. <div
  11. class="col-lg-3 col-md-6 col-sm-6"
  12. v-for="currentProperty in properties"
  13. :key="currentProperty.id"
  14. >
  15. <div>
  16. <div class="portfolio-item">
  17. <img style="width:255px; height:255px" :src="currentProperty.displayImage" alt />
  18. <h4 class="mt-3">{{ currentProperty.suburb }}</h4>
  19. <p>{{currentProperty.shortDescription }}</p>
  20. <br />
  21. <!-- <a href="commercialproperty-page.php" class="btn-white-border">VIEW</a> -->
  22. <router-link
  23. class="btn-white-border"
  24. :to="`/property/commercial/property/${currentProperty.id}`"
  25. >VIEW</router-link>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <div v-else class="row">
  31. <div align="center" class="col-md-12">
  32. <img src="img/no-homes.png" />
  33. <br />
  34. <br />
  35. <p>Sorry no listings where found matching your search</p>
  36. </div>
  37. </div>
  38. </div>
  39. </section>
  40. </main>
  41. </template>
  42. <script>
  43. /* eslint-disable */
  44. import { mapState, mapActions } from "vuex";
  45. import propertyCard from "../propertyCard";
  46. export default {
  47. name: "propertysearch",
  48. components: {
  49. propertyCard,
  50. },
  51. data() {
  52. return {};
  53. },
  54. mounted() {
  55. console.log(this.propertySearch.salesType);
  56. if (typeof this.propertySearch.propertyUsageType === "undefined") {
  57. this.propertySearch.propertyUsageType = "Residential";
  58. }
  59. if (this.user) {
  60. this.propertySearch.userName = this.user.username;
  61. }
  62. this.searchProperties(this.propertySearch);
  63. },
  64. methods: {
  65. ...mapActions("propertySearch", [
  66. "searchProperties",
  67. "clearProperties",
  68. "updateResultsShowing",
  69. ]),
  70. SetType(item) {
  71. this.propertySearch.propertyUsageType = item;
  72. },
  73. SearchPage() {
  74. this.clearProperties();
  75. this.$router.push("/property/search");
  76. },
  77. },
  78. computed: {
  79. ...mapState("propertySearch", [
  80. "properties",
  81. "propertySearch",
  82. "resultsShowing",
  83. ]),
  84. ...mapState("authentication", ["user"]),
  85. ParamsChanged() {
  86. console.log(JSON.stringify(this.propertySearch));
  87. if (typeof this.propertySearch.propertyUsageType === "undefined") {
  88. // eslint-disable-next-line vue/no-side-effects-in-computed-properties
  89. this.propertySearch.propertyUsageType = "Residential";
  90. }
  91. this.searchProperties(this.propertySearch);
  92. return null;
  93. },
  94. },
  95. watch: {
  96. ParamsChanged() {
  97. return null;
  98. },
  99. },
  100. };
  101. </script>
  102. <style lang="scss" scoped></style>