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.

propertySearchResults.vue 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <div class="container">
  4. <br />
  5. <div class="container col-md-12">
  6. <div class="col-sm-12">
  7. <div class="about-img-box">
  8. <img
  9. v-if="propertySearch.propertyUsageType === 'Residential'"
  10. src="img/Pretoria-South-Africa.jpg"
  11. alt="Property Listing"
  12. class="img-fluid"
  13. style="width:800px;height:400px; border-radius:10px"
  14. />
  15. <img
  16. v-else
  17. src="img/Johannesburg-south-africa-1.jpg"
  18. alt="Property Listing"
  19. class="img-fluid"
  20. style="width:800px;height:400px; border-radius:10px"
  21. />
  22. </div>
  23. <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
  24. <h3 class="sinse-title">Property Listing</h3>
  25. </div>
  26. </div>
  27. <br />
  28. <div>
  29. <propertyCard
  30. v-if="properties.length > 0"
  31. name="propertyholder"
  32. :properties="properties"
  33. :salesType="propertySearch.salesType"
  34. />
  35. <!-- <div v-if="loading">
  36. <img
  37. class="img-fluid"
  38. src="/img/kloader.gif"
  39. alt="UVProp logo"
  40. style="width:128px;height:128px;"
  41. />
  42. </div>-->
  43. <div v-if="properties.length === 0">
  44. <img src="../../../public/img/no-homes.png" />
  45. <br />
  46. <br />
  47. <p>Sorry no listing where found matching your search</p>
  48. </div>
  49. </div>
  50. <br />
  51. <div class="row">
  52. <div class="col-md-2 offset-5">
  53. <button type="button" @click="SearchPage" class="btn btn-b-n">Back to Search</button>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import { mapState, mapActions } from 'vuex';
  61. import propertyCard from './propertyCard.vue';
  62. export default {
  63. name: 'propertysearch',
  64. components: {
  65. propertyCard,
  66. },
  67. data() {
  68. return {};
  69. },
  70. mounted() {
  71. if (typeof this.propertySearch.propertyUsageType === 'undefined') {
  72. this.propertySearch.propertyUsageType = 'Residential';
  73. }
  74. if (this.user) {
  75. this.propertySearch.userName = this.user.username;
  76. }
  77. this.searchProperties(this.propertySearch);
  78. },
  79. methods: {
  80. ...mapActions('propertySearch', [
  81. 'searchProperties',
  82. 'clearProperties',
  83. 'updateResultsShowing',
  84. ]),
  85. SetType(item) {
  86. this.propertySearch.propertyUsageType = item;
  87. },
  88. SearchPage() {
  89. this.clearProperties();
  90. this.$router.push('/property/search');
  91. },
  92. },
  93. computed: {
  94. ...mapState('propertySearch', [
  95. 'properties',
  96. 'propertySearch',
  97. 'resultsShowing',
  98. ]),
  99. ...mapState('authentication', ['user']),
  100. ParamsChanged() {
  101. if (this.resultsShowing) {
  102. if (typeof this.propertySearch.propertyUsageType === 'undefined') {
  103. // eslint-disable-next-line vue/no-side-effects-in-computed-properties
  104. this.propertySearch.propertyUsageType = 'Residential';
  105. }
  106. this.searchProperties(this.propertySearch);
  107. }
  108. return null;
  109. },
  110. },
  111. watch: {
  112. ParamsChanged() {
  113. return null;
  114. },
  115. },
  116. };
  117. </script>