Pārlūkot izejas kodu

New files for Carousel & prop

master
George Williams 5 gadus atpakaļ
vecāks
revīzija
bda852be5d

Binārs
public/img/icons/area.png Parādīt failu


Binārs
public/img/icons/garage.png Parādīt failu


+ 102
- 0
src/components/admin/misc/carouselSearch.vue Parādīt failu

@@ -0,0 +1,102 @@
1
+<template>
2
+  <div>
3
+    <div class="container">
4
+      <div class="container">
5
+        <div class="row">
6
+          <div class="col-md-12 col-lg-8">
7
+            <div class="title-box-d">
8
+              <br />
9
+              <h1 class="title-d" style="text-align:left; font-size: 250%">Search {{ name }}</h1>
10
+            </div>
11
+          </div>
12
+        </div>
13
+        <div class="row">
14
+          <div class="container">
15
+            <ListView
16
+              v-if="name === 'Timeshare'"
17
+              :items="items"
18
+              :editable="true"
19
+              @onEdit="onEdit"
20
+              :editLabel="'Select'"
21
+            />
22
+            <ListView
23
+              v-else
24
+              :items="properties"
25
+              :editable="true"
26
+              @onEdit="onEdit"
27
+              :editLabel="'Select'"
28
+            />
29
+          </div>
30
+        </div>
31
+      </div>
32
+    </div>
33
+  </div>
34
+</template>
35
+
36
+<script>
37
+import { mapState, mapActions } from 'vuex';
38
+import ListView from '../../shared/listView.vue';
39
+import Log from '../../../assets/Log';
40
+
41
+export default {
42
+  name: 'CarouselSearch',
43
+  props: {
44
+    name: String,
45
+  },
46
+  components: {
47
+    ListView,
48
+  },
49
+  data() {
50
+    return {
51
+      user: Log.getUser(),
52
+    };
53
+  },
54
+  mounted() {
55
+    if (this.name === 'Timeshare') {
56
+      this.getItems(this.user.id);
57
+    } else {
58
+      this.getProperties(
59
+        Object.assign(
60
+          {},
61
+          {
62
+            propertyType: 'Admin',
63
+            user: this.user.id,
64
+          },
65
+        ),
66
+      );
67
+    }
68
+  },
69
+  computed: {
70
+    ...mapState('myWeeks', ['items']),
71
+    ...mapState('propertyList', ['properties']),
72
+    // eslint-disable-next-line vue/return-in-computed-property
73
+    nameChanged() {
74
+      if (this.name === 'Timeshare') {
75
+        this.getItems(this.user.id);
76
+      } else {
77
+        this.getProperties(
78
+          Object.assign(
79
+            {},
80
+            {
81
+              propertyType: 'Admin',
82
+              user: this.user.id,
83
+            },
84
+          ),
85
+        );
86
+      }
87
+    },
88
+  },
89
+  methods: {
90
+    ...mapActions('myWeeks', ['getItems']),
91
+    ...mapActions('propertyList', ['getProperties']),
92
+    onEdit(item) {
93
+      this.$emit('onSelected', item);
94
+    },
95
+  },
96
+  watch: {
97
+    nameChanged() {
98
+      return null;
99
+    },
100
+  },
101
+};
102
+</script>

+ 127
- 0
src/components/property/propertySearchResults.vue Parādīt failu

@@ -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>

Notiek ielāde…
Atcelt
Saglabāt