|
@@ -0,0 +1,127 @@
|
|
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 v-if="properties.length > 0" name="propertyholder" :properties="properties" />
|
|
30
|
+ <div v-if="properties.length === 0">
|
|
31
|
+ <img src="../../../public/img/no-homes.png" />
|
|
32
|
+ <br />
|
|
33
|
+ <br />
|
|
34
|
+ <p>Sorry no listing where found matching your search</p>
|
|
35
|
+ </div>
|
|
36
|
+ </div>
|
|
37
|
+ <br />
|
|
38
|
+ </div>
|
|
39
|
+ </div>
|
|
40
|
+</template>
|
|
41
|
+<script>
|
|
42
|
+import { mapState, mapActions } from 'vuex';
|
|
43
|
+import propertyCard from './propertyCard.vue';
|
|
44
|
+
|
|
45
|
+export default {
|
|
46
|
+ name: 'propertysearch',
|
|
47
|
+ components: {
|
|
48
|
+ propertyCard,
|
|
49
|
+ },
|
|
50
|
+ data() {
|
|
51
|
+ return {
|
|
52
|
+ propertySearch: {
|
|
53
|
+ userName: '',
|
|
54
|
+ salesType: 'All',
|
|
55
|
+ propertyUsageType: 'All',
|
|
56
|
+ propertyType: 'All',
|
|
57
|
+ province: 'All',
|
|
58
|
+ city: 'All',
|
|
59
|
+ suburb: 'All',
|
|
60
|
+ minPrice: 0,
|
|
61
|
+ maxPrice: 0,
|
|
62
|
+ },
|
|
63
|
+ };
|
|
64
|
+ },
|
|
65
|
+ mounted() {
|
|
66
|
+ if (typeof this.propertySearch.propertyUsageType === 'undefined') {
|
|
67
|
+ this.propertySearch.propertyUsageType = 'Residential';
|
|
68
|
+ }
|
|
69
|
+ this.searchProperties(this.propertySearch);
|
|
70
|
+ },
|
|
71
|
+ methods: {
|
|
72
|
+ ...mapActions('propertySearch', ['searchProperties']),
|
|
73
|
+ SetType(item) {
|
|
74
|
+ this.propertySearch.propertyUsageType = item;
|
|
75
|
+ },
|
|
76
|
+ },
|
|
77
|
+ computed: {
|
|
78
|
+ ...mapState('propertySearch', ['properties', 'propertySearch']),
|
|
79
|
+ ...mapState('authentication', ['username']),
|
|
80
|
+ // ParamsChanged() {
|
|
81
|
+ // if (Object.keys(this.$route.query).length === 0) {
|
|
82
|
+ // if (this.propertySearch.propertyUsageType === 'All') {
|
|
83
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
84
|
+ // this.propertySearch.propertyUsageType = 'Residential';
|
|
85
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
86
|
+ // this.propertySearch.keyword = 'All';
|
|
87
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
88
|
+ // this.propertySearch.salesType = 'All';
|
|
89
|
+ // }
|
|
90
|
+ // }
|
|
91
|
+ // if (Object.keys(this.$route.query).length > 0) {
|
|
92
|
+ // if (Object.keys(this.$route.query).length > 2) {
|
|
93
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
94
|
+ // this.propertySearch = this.$route.query;
|
|
95
|
+ // } else {
|
|
96
|
+ // if (this.$route.query.salesType) {
|
|
97
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
98
|
+ // this.propertySearch.salesType = this.$route.query.salesType;
|
|
99
|
+ // }
|
|
100
|
+ // if (this.$route.query.propertyUsageType) {
|
|
101
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
102
|
+ // this.propertySearch.propertyUsageType = this.$route.query.propertyUsageType;
|
|
103
|
+ // }
|
|
104
|
+ // }
|
|
105
|
+ // }
|
|
106
|
+ // if (this.propertySearch.keyword === '') {
|
|
107
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
108
|
+ // this.propertySearch.keyword = 'All';
|
|
109
|
+ // }
|
|
110
|
+ // if (this.username) {
|
|
111
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
112
|
+ // this.propertySearch.userName = this.username;
|
|
113
|
+ // } else {
|
|
114
|
+ // // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
115
|
+ // this.propertySearch.userName = 'Unknown';
|
|
116
|
+ // }
|
|
117
|
+ // this.searchProperties(this.propertySearch);
|
|
118
|
+ // return null;
|
|
119
|
+ // },
|
|
120
|
+ },
|
|
121
|
+ // watch: {
|
|
122
|
+ // ParamsChanged() {
|
|
123
|
+ // return null;
|
|
124
|
+ // },
|
|
125
|
+ // },
|
|
126
|
+};
|
|
127
|
+</script>
|