Просмотр исходного кода

Property Search & Carousel Changes

master
George Williams 6 лет назад
Родитель
Сommit
43c6f4fc09

+ 206
- 1
src/components/admin/misc/carousel.vue Просмотреть файл

1
-<!-- Work in Progress -->
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%">Carousel Item</h1>
10
+            </div>
11
+            <br />
12
+          </div>
13
+        </div>
14
+      </div>
15
+      <div class="container col-md-12" style="text-align:left">
16
+        <div class="form-goup row">
17
+          <div class="col-md-4">
18
+            <label>Type</label>
19
+            <div class="input-group-prepend">
20
+              <select class="form-control" v-model="selectedType">
21
+                <option value="Timeshare">Timeshare</option>
22
+                <option value="Property">Property</option>
23
+              </select>
24
+              <button
25
+                type="button"
26
+                class="input-group-text fa fa-search"
27
+                style="color: #60CBEB"
28
+                data-toggle="modal"
29
+                data-target="#myModal"
30
+              ></button>
31
+              <!-- Modal content-->
32
+              <div id="myModal" class="modal fade" role="dialog">
33
+                <div class="modal-dialog modal-lg">
34
+                  <div class="modal-content">
35
+                    <div class="modal-header">
36
+                      <button type="button" class="close" data-dismiss="modal"></button>
37
+                    </div>
38
+                    <div padding-left="20px">
39
+                      <Search :name="selectedType" @onSelected="onSelected" />
40
+                    </div>
41
+                    <div class="modal-footer">
42
+                      <button
43
+                        type="button"
44
+                        class="btn btn-b-n"
45
+                        style="width: 150px; height:40px;"
46
+                        data-dismiss="modal"
47
+                      >Close</button>
48
+                    </div>
49
+                  </div>
50
+                </div>
51
+              </div>
52
+              <!-- Modal content END-->
53
+            </div>
54
+          </div>
55
+        </div>
56
+        <div class="form-goup row">
57
+          <div class="col-md-4">
58
+            <br />
59
+            <label>Header</label>
60
+            <input class="form-control" type="text" v-model="carousel.header" />
61
+          </div>
62
+        </div>
63
+        <div class="form-goup row">
64
+          <div class="col-md-4">
65
+            <br />
66
+            <label>Description</label>
67
+            <p v-if="selectedType === 'Property'" v-html="propDescription" />
68
+            <ul v-if="selectedType === 'Timeshare' && bedrooms" class="list">
69
+              <li class="d-flex justify-content-between">
70
+                <strong>
71
+                  <i class="fa fa-bed"></i>
72
+                  &nbsp&nbsp&nbspBedrooms:
73
+                </strong>
74
+                <span>{{ bedrooms }}</span>
75
+              </li>
76
+              <li class="d-flex justify-content-between">
77
+                <strong>
78
+                  <i class="fa fa-users"></i>&nbsp&nbsp&nbspSleeps:
79
+                </strong>
80
+                <span>{{ sleeps }}</span>
81
+              </li>
82
+              <li class="d-flex justify-content-between">
83
+                <strong>
84
+                  <i class="fa fa-calendar"></i>&nbsp&nbsp&nbspCheck in:
85
+                </strong>
86
+                <span>{{ arrival }}</span>
87
+              </li>
88
+              <li class="d-flex justify-content-between">
89
+                <strong>
90
+                  <i class="fa fa-calendar"></i>&nbsp&nbsp&nbspCheck out:
91
+                </strong>
92
+                <span>{{ departure }}</span>
93
+              </li>
94
+            </ul>
95
+          </div>
96
+        </div>
97
+        <div class="form-group row">
98
+          <div class="col-md-2">
99
+            <label>Image</label>
100
+          </div>
101
+        </div>
102
+        <div v-if="selectedType === 'Timeshare'">
103
+          <div>
104
+            <Images :allowMultiple="false" :loadedImages="loadedImages" />
105
+          </div>
106
+        </div>
107
+        <div class="form-group row" v-if="selectedType === 'Property'">
108
+          <div class="col-md-2" v-for="(img, i) in propertyImages" :key="i">
109
+            <input type="radio" name="image" @click="setImage(img)" />
110
+            <label for="checkbox" style="margin: 10px;">Set</label>
111
+            <br />
112
+            <img :src="img.image" style="height:200px; width:150px; object-fit: cover;" />
113
+          </div>
114
+        </div>
115
+        <div class="form-group row">
116
+          <button
117
+            type="button"
118
+            @click="SaveData()"
119
+            class="btn btn-b-n"
120
+            style="width: 85px; height:40px;"
121
+          >Save</button>
122
+          <button
123
+            type="button"
124
+            @click="Close()"
125
+            class="btn btn-b-n"
126
+            style="width: 85px; height:40px;"
127
+          >Close</button>
128
+        </div>
129
+      </div>
130
+    </div>
131
+  </div>
132
+</template>
133
+
134
+<script>
135
+import { mapState, mapActions } from 'vuex';
136
+import Search from './carouselSearch.vue';
137
+import Images from '../../property/propertyImage.vue';
138
+
139
+export default {
140
+  name: 'CarouselItem',
141
+  components: {
142
+    Search,
143
+    Images,
144
+  },
145
+  data() {
146
+    return {
147
+      selectedType: 'Timeshare',
148
+      propDescription: '',
149
+      bedrooms: '',
150
+      sleeps: '',
151
+      arrival: Date,
152
+      departure: Date,
153
+      images: [],
154
+    };
155
+  },
156
+  computed: {
157
+    ...mapState('carousel', ['carousel']),
158
+    ...mapState('property', ['propertyImages']),
159
+  },
160
+  mounted() {
161
+    this.getCarouselItem(this.$route.params.id);
162
+  },
163
+  methods: {
164
+    ...mapActions('carousel', ['saveCarouselItem', 'getCarouselItem']),
165
+    ...mapActions('property', ['getSavedPropertyImages']),
166
+    onSelected(item) {
167
+      if (this.selectedType === 'Timeshare') {
168
+        this.carousel.header = item.resort.resortName;
169
+        this.bedrooms = item.bedrooms;
170
+        this.sleeps = item.maxSleep;
171
+        this.arrival = item.arrivalDate;
172
+        this.departure = item.departureDate;
173
+        this.carousel.timeshareID = item.id;
174
+      } else {
175
+        this.propertyImages = [];
176
+        this.carousel.header = item.name;
177
+        this.propDescription = item.carouselDescription;
178
+        this.carousel.propertyID = item.id;
179
+        this.getSavedPropertyImages(item.id);
180
+      }
181
+    },
182
+    setImage(img) {
183
+      this.carousel.image = img.image;
184
+    },
185
+    loadedImages(values) {
186
+      this.images = values;
187
+    },
188
+    Close() {
189
+      this.$router.push('/carousel');
190
+    },
191
+    SaveData() {
192
+      if (this.selectedType === 'Timeshare') {
193
+        // eslint-disable-next-line no-plusplus
194
+        for (let i = 0; i < this.images.length; i++) {
195
+          this.carousel.image = this.images[i];
196
+        }
197
+      }
198
+      if (this.carousel.id === 0) {
199
+        this.saveCarouselItem(this.carousel);
200
+        this.$router.push('/carousel');
201
+      }
202
+      // Else update
203
+    },
204
+  },
205
+};
206
+</script>

+ 1
- 16
src/components/admin/misc/carouselList.vue Просмотреть файл

2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div>
3
   <div>
4
     <div class="container">
4
     <div class="container">
5
-      <!-- <section class="intro-single"> -->
6
       <div class="container">
5
       <div class="container">
7
-        <br />
8
-        <br />
9
         <div class="row">
6
         <div class="row">
10
           <div class="col-md-12 col-lg-8">
7
           <div class="col-md-12 col-lg-8">
11
-            <!-- <div class="title-single-box"> -->
12
-            <!-- <h1 class="title-single">Property Types</h1> -->
13
-            <!-- </div> -->
14
             <div class="title-box-d">
8
             <div class="title-box-d">
9
+              <br />
15
               <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
10
               <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
16
             </div>
11
             </div>
17
             <br />
12
             <br />
18
           </div>
13
           </div>
19
         </div>
14
         </div>
20
       </div>
15
       </div>
21
-      <!-- </section> -->
22
     </div>
16
     </div>
23
     <div class="container">
17
     <div class="container">
24
       <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
18
       <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
31
             <th>Header</th>
25
             <th>Header</th>
32
             <th>Type</th>
26
             <th>Type</th>
33
             <th></th>
27
             <th></th>
34
-            <th></th>
35
           </tr>
28
           </tr>
36
         </thead>
29
         </thead>
37
         <tbody>
30
         <tbody>
42
             <td>{{ item.header }}</td>
35
             <td>{{ item.header }}</td>
43
             <td v-if="item.propertyId">Property</td>
36
             <td v-if="item.propertyId">Property</td>
44
             <td v-else>Timeshare Week</td>
37
             <td v-else>Timeshare Week</td>
45
-            <td>
46
-              <button
47
-                type="button"
48
-                @click="Edit(item.id)"
49
-                class="btn"
50
-                style="margin:2px; color: #60CBEB"
51
-              >Edit</button>
52
-            </td>
53
             <td>
38
             <td>
54
               <button
39
               <button
55
                 type="button"
40
                 type="button"

+ 11
- 12
src/components/admin/misc/carouselSearch.vue Просмотреть файл

15
             <ListView
15
             <ListView
16
               v-if="name === 'Timeshare'"
16
               v-if="name === 'Timeshare'"
17
               :items="items"
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'"
18
+              :showNew="false"
19
+              @onRowClick="onRowClick"
28
             />
20
             />
21
+            <ListView v-else :items="properties" :showNew="false" @onRowClick="onRowClick" />
29
           </div>
22
           </div>
30
         </div>
23
         </div>
31
       </div>
24
       </div>
89
   methods: {
82
   methods: {
90
     ...mapActions('myWeeks', ['getItems']),
83
     ...mapActions('myWeeks', ['getItems']),
91
     ...mapActions('propertyList', ['getProperties']),
84
     ...mapActions('propertyList', ['getProperties']),
92
-    onEdit(item) {
93
-      this.$emit('onSelected', item);
85
+    onRowClick(item) {
86
+      if (this.name === 'Timeshare') {
87
+        const week = this.items[item];
88
+        this.$emit('onSelected', week);
89
+      } else {
90
+        const prop = this.properties[item];
91
+        this.$emit('onSelected', prop);
92
+      }
94
     },
93
     },
95
   },
94
   },
96
   watch: {
95
   watch: {

+ 17
- 9
src/components/home/carouselSection.vue Просмотреть файл

22
               <div class="col-lg-8">
22
               <div class="col-lg-8">
23
                 <div
23
                 <div
24
                   class="price-a"
24
                   class="price-a"
25
-                  style="opacity:0.95; border: white solid 3px; border-radius: 15px; background-color: white;"
25
+                  style="opacity:0.7; border: white solid 3px; border-radius: 15px; background-color: white;"
26
                 >
26
                 >
27
                   <h1 class="intro-title mb-4">{{ car.header }}</h1>
27
                   <h1 class="intro-title mb-4">{{ car.header }}</h1>
28
-                  <div v-if="car.isProperty">
29
-                    <p class="color-b" v-html="car.address" />
28
+                  <div class="summary-list" v-if="car.isProperty">
29
+                    <p v-html="car.address" />
30
                   </div>
30
                   </div>
31
-                  <div v-else>
32
-                    <ul class="list color-b">
31
+                  <div class="summary-list" v-else>
32
+                    <ul class="list">
33
                       <li class="d-flex justify-content-between">
33
                       <li class="d-flex justify-content-between">
34
-                        <strong>Bedrooms:</strong>
34
+                        <strong>
35
+                          <i class="fa fa-bed"></i>&nbsp&nbsp&nbspBedrooms:
36
+                        </strong>
35
                         <span>{{ car.bedrooms }}</span>
37
                         <span>{{ car.bedrooms }}</span>
36
                       </li>
38
                       </li>
37
                       <li class="d-flex justify-content-between">
39
                       <li class="d-flex justify-content-between">
38
-                        <strong>Sleeps:</strong>
40
+                        <strong>
41
+                          <i class="fa fa-users"></i>&nbsp&nbsp&nbspSleeps:
42
+                        </strong>
39
                         <span>{{ car.sleeps }}</span>
43
                         <span>{{ car.sleeps }}</span>
40
                       </li>
44
                       </li>
41
                       <li class="d-flex justify-content-between">
45
                       <li class="d-flex justify-content-between">
42
-                        <strong>Check in:</strong>
46
+                        <strong>
47
+                          <i class="fa fa-calendar"></i>&nbsp&nbsp&nbspCheck in:
48
+                        </strong>
43
                         <span>{{ car.arrival | toDate }}</span>
49
                         <span>{{ car.arrival | toDate }}</span>
44
                       </li>
50
                       </li>
45
                       <li class="d-flex justify-content-between">
51
                       <li class="d-flex justify-content-between">
46
-                        <strong>Check out:</strong>
52
+                        <strong>
53
+                          <i class="fa fa-calendar"></i>&nbsp&nbsp&nbspCheck out:
54
+                        </strong>
47
                         <span>{{ car.departure | toDate}}</span>
55
                         <span>{{ car.departure | toDate}}</span>
48
                       </li>
56
                       </li>
49
                     </ul>
57
                     </ul>

+ 14
- 4
src/components/property/propertyCard.vue Просмотреть файл

71
                 <div class="card-footer-a" v-if="currentProperty.showFooter">
71
                 <div class="card-footer-a" v-if="currentProperty.showFooter">
72
                   <ul class="card-info d-flex justify-content-around">
72
                   <ul class="card-info d-flex justify-content-around">
73
                     <li v-if="currentProperty.area !== null">
73
                     <li v-if="currentProperty.area !== null">
74
-                      <h4 class="card-info-title">Area</h4>
74
+                      <h4 class="card-info-title">
75
+                        <img src="../../../public/img/icons/area.png" height="16px" width="16px" />
76
+                        <!-- <i class="fa fa-ruler-combined"></i> -->
77
+                      </h4>
75
                       <span v-html="currentProperty.area"></span>
78
                       <span v-html="currentProperty.area"></span>
76
                     </li>
79
                     </li>
77
                     <li v-if="currentProperty.beds !== null">
80
                     <li v-if="currentProperty.beds !== null">
78
-                      <h4 class="card-info-title">Beds</h4>
81
+                      <h4 class="card-info-title">
82
+                        <i class="fa fa-bed"></i>
83
+                      </h4>
79
                       <span>{{ currentProperty.beds }}</span>
84
                       <span>{{ currentProperty.beds }}</span>
80
                     </li>
85
                     </li>
81
                     <li v-if="currentProperty.baths !== null">
86
                     <li v-if="currentProperty.baths !== null">
82
-                      <h4 class="card-info-title">Baths</h4>
87
+                      <h4 class="card-info-title">
88
+                        <i class="fa fa-bath"></i>
89
+                      </h4>
83
                       <span>{{ currentProperty.baths }}</span>
90
                       <span>{{ currentProperty.baths }}</span>
84
                     </li>
91
                     </li>
85
                     <li v-if="currentProperty.garages !== null">
92
                     <li v-if="currentProperty.garages !== null">
86
-                      <h4 class="card-info-title">Garages</h4>
93
+                      <h4 class="card-info-title">
94
+                        <!-- <i class="fa fa-warehouse"></i> -->
95
+                        <img src="../../../public/img/icons/garage.png" height="16px" width="16px" />
96
+                      </h4>
87
                       <span>{{ currentProperty.garages }}</span>
97
                       <span>{{ currentProperty.garages }}</span>
88
                     </li>
98
                     </li>
89
                   </ul>
99
                   </ul>

+ 8
- 3
src/components/property/propertyFieldEditor.vue Просмотреть файл

11
           v-model="display"
11
           v-model="display"
12
           disabled
12
           disabled
13
         />
13
         />
14
-        <span v-if="mayEdit" @click="EditClick()" class="input-group-text" style="color: #60CBEB">
14
+        <span
15
+          v-if="mayEdit"
16
+          @click="EditClick()"
17
+          class="input-group-text spanCursor"
18
+          style="color: #60CBEB"
19
+        >
15
           <eva-icon name="edit-outline" fill="#60CBEB"></eva-icon>
20
           <eva-icon name="edit-outline" fill="#60CBEB"></eva-icon>
16
         </span>
21
         </span>
17
       </div>
22
       </div>
50
           <option value="yes">Yes</option>
55
           <option value="yes">Yes</option>
51
           <option value="no">No</option>
56
           <option value="no">No</option>
52
         </select>
57
         </select>
53
-        <span @click="UpdateValue()" class="input-group-text" style="color: #60CBEB">
58
+        <span @click="UpdateValue()" class="input-group-text spanCursor" style="color: #60CBEB">
54
           <eva-icon name="checkmark-outline" fill="#60CBEB"></eva-icon>
59
           <eva-icon name="checkmark-outline" fill="#60CBEB"></eva-icon>
55
         </span>
60
         </span>
56
-        <span @click="Close()" class="input-group-text" style="color: #60CBEB">
61
+        <span @click="Close()" class="input-group-text spanCursor" style="color: #60CBEB">
57
           <eva-icon name="close-outline" fill="#60CBEB"></eva-icon>
62
           <eva-icon name="close-outline" fill="#60CBEB"></eva-icon>
58
         </span>
63
         </span>
59
       </div>
64
       </div>

+ 15
- 3
src/components/property/propertyImage.vue Просмотреть файл

10
           style="width: 0px;height: 0px;overflow: hidden;"
10
           style="width: 0px;height: 0px;overflow: hidden;"
11
           name="images[]"
11
           name="images[]"
12
           @change="imagesAdd"
12
           @change="imagesAdd"
13
-          multiple
13
+          :multiple="allowMultiple"
14
           :disabled="!mayEdit"
14
           :disabled="!mayEdit"
15
         />
15
         />
16
       </label>
16
       </label>
18
     <br />
18
     <br />
19
     <div class="form-group row">
19
     <div class="form-group row">
20
       <div v-for="(img, i) in image" class="col-md-2" :key="i">
20
       <div v-for="(img, i) in image" class="col-md-2" :key="i">
21
-        <input type="checkbox" id="checkbox" v-model="imagesDefault[i]" @change="updateList(i)" />
22
-        <label for="checkbox" style="margin: 10px;">Main Image</label>
21
+        <input
22
+          v-if="allowMultiple"
23
+          type="checkbox"
24
+          id="checkbox"
25
+          v-model="imagesDefault[i]"
26
+          @change="updateList(i)"
27
+        />
28
+        <label v-if="allowMultiple" for="checkbox" style="margin: 10px;">Main Image</label>
23
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
29
         <img :src="img" style="height:200px; width:150px; object-fit: cover;" />
24
         <br />
30
         <br />
25
         <span class="input-group-text" align="center" @click="removeImage(key)">
31
         <span class="input-group-text" align="center" @click="removeImage(key)">
36
   props: {
42
   props: {
37
     loadedImages: Function,
43
     loadedImages: Function,
38
     mayEdit: { type: Boolean, default: () => true },
44
     mayEdit: { type: Boolean, default: () => true },
45
+    allowMultiple: { type: Boolean, default: () => true },
39
   },
46
   },
40
   data() {
47
   data() {
41
     return {
48
     return {
54
   // },
61
   // },
55
   methods: {
62
   methods: {
56
     imagesAdd(e) {
63
     imagesAdd(e) {
64
+      if (!this.allowMultiple) {
65
+        this.images = {};
66
+        this.image = [];
67
+      }
68
+
57
       const files = e.target.files || e.dataTransfer.files;
69
       const files = e.target.files || e.dataTransfer.files;
58
 
70
 
59
       this.images = [];
71
       this.images = [];

+ 105
- 131
src/components/property/propertySearchPage.vue Просмотреть файл

2
   <!-- eslint-disable max-len -->
2
   <!-- eslint-disable max-len -->
3
   <div class="container">
3
   <div class="container">
4
     <br />
4
     <br />
5
-    <div class="row">
6
-      <div class="col-md-2 offset-4">
7
-        <button type="button" @click="SetType('Residential')" class="btn btn-b-n">Residential</button>
8
-      </div>
9
-      <div class="col-md-2">
10
-        <button type="button" @click="SetType('Commercial')" class="btn btn-b-n">Commercial</button>
11
-      </div>
12
-    </div>
13
-    <div class="container col-md-12" v-if="propertySearch.propertyUsageType === 'Residential'">
5
+    <div class="container col-md-12">
14
       <div class="col-sm-12">
6
       <div class="col-sm-12">
15
         <div class="about-img-box">
7
         <div class="about-img-box">
16
           <img
8
           <img
9
+            v-if="propertyUsageType === 'Residential'"
17
             src="img/Pretoria-South-Africa.jpg"
10
             src="img/Pretoria-South-Africa.jpg"
18
             alt="Property Listing"
11
             alt="Property Listing"
19
             class="img-fluid"
12
             class="img-fluid"
20
             style="width:800px;height:400px; border-radius:10px"
13
             style="width:800px;height:400px; border-radius:10px"
21
           />
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>
22
         </div>
23
         <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
23
         <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
24
           <h3 class="sinse-title">Property Listing</h3>
24
           <h3 class="sinse-title">Property Listing</h3>
25
         </div>
25
         </div>
26
       </div>
26
       </div>
27
       <br />
27
       <br />
28
+      <div class="row">
29
+        <div class="col-md-2 offset-4">
30
+          <button type="button" @click="SetType('Residential')" class="btn btn-b-n">Residential</button>
31
+        </div>
32
+        <div class="col-md-2">
33
+          <button type="button" @click="SetType('Commercial')" class="btn btn-b-n">Commercial</button>
34
+        </div>
35
+      </div>
36
+      <br />
37
+      <div class="col-md-10 offset-1">
38
+        <ul class="nav nav-pills-a nav-pills mb-3 section-t3" id="pills-tab" role="tablist">
39
+          <li class="nav-item">
40
+            <a
41
+              class="nav-link active"
42
+              id="pills-video-tab"
43
+              data-toggle="pill"
44
+              href="#pills-video"
45
+              role="tab"
46
+              aria-controls="pills-video"
47
+              aria-selected="true"
48
+              v-on:click="SetSalesType('Sale')"
49
+            >For Sale</a>
50
+          </li>
51
+          <li class="nav-item">
52
+            <a
53
+              class="nav-link"
54
+              id="pills-plans-tab"
55
+              data-toggle="pill"
56
+              href="#pills-plans"
57
+              role="tab"
58
+              aria-controls="pills-plans"
59
+              aria-selected="false"
60
+              v-on:click="SetSalesType('Rent')"
61
+            >To Rent</a>
62
+          </li>
63
+        </ul>
64
+      </div>
65
+      <br />
66
+      <div class="row">
67
+        <div class="col-md-10 offset-1">
68
+          <div class="input-group-prepend">
69
+            <span class="input-group-text" style="color: #60CBEB">
70
+              <b v-if="salesType === 'Sale'">S</b>
71
+              <b v-else>R</b>
72
+            </span>
73
+            <select class="form-control browser-default custom-select" v-model="searchText">
74
+              <option value="0">Please select</option>
75
+              <option v-for="item in suburbs" :value="item.id" :key="item.id">{{item.display}}</option>
76
+            </select>
77
+            <button
78
+              type="button"
79
+              class="input-group-text fa fa-search"
80
+              style="color: #60CBEB"
81
+              @click="SearchClick"
82
+            ></button>
83
+          </div>
84
+        </div>
85
+      </div>
28
       <div class="row">
86
       <div class="row">
29
         <div class="col-md-12">
87
         <div class="col-md-12">
30
-          <h1 class="my-4">About Residential Properties</h1>
88
+          <h1 class="my-4" v-if="propertyUsageType === 'Residential'">About Residential Properties</h1>
89
+          <h1 class="my-4" v-else>About Commercial Properties</h1>
31
         </div>
90
         </div>
32
-        <div class="container col-md-6 text-left">
91
+        <div class="container col-md-6 text-left" v-if="propertyUsageType === 'Residential'">
33
           <p>
92
           <p>
34
             Uni-Vate Properties understands the necessity in property-seekers
93
             Uni-Vate Properties understands the necessity in property-seekers
35
             to find that perfect fit;
94
             to find that perfect fit;
54
             <router-link to="/property/new/Residential/Sale">Click Here</router-link>
113
             <router-link to="/property/new/Residential/Sale">Click Here</router-link>
55
           </p>
114
           </p>
56
         </div>
115
         </div>
57
-        <div class="col-md-4">
58
-          <p>
59
-            <img
60
-              class="img-fluid"
61
-              src="./../../../public/img/residential.jpg"
62
-              alt="About Resale"
63
-              style="border-radius:10px"
64
-            />
65
-          </p>
66
-        </div>
67
-      </div>
68
-      <div>
69
-        <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
70
-        <div v-if="properties.length === 0">
71
-          <img src="../../../public/img/no-homes.png" />
72
-          <br />
73
-          <br />
74
-          <p>Sorry no listing where found matching your search</p>
75
-        </div>
76
-      </div>
77
-      <br />
78
-    </div>
79
-
80
-    <div class="container col-md-12" v-if="propertySearch.propertyUsageType === 'Commercial'">
81
-      <div class="col-sm-12">
82
-        <div class="about-img-box">
83
-          <img
84
-            src="img/Johannesburg-south-africa-1.jpg"
85
-            alt="Property Listing"
86
-            class="img-fluid"
87
-            style="width:800px;height:400px; border-radius:10px"
88
-          />
89
-        </div>
90
-        <div class="sinse-box" style="opacity:0.7; border: white solid 3px; border-radius: 15px">
91
-          <h3 class="sinse-title">Property Listing</h3>
92
-        </div>
93
-      </div>
94
-      <br />
95
-      <div class="row">
96
-        <div class="col-md-12">
97
-          <h1 class="my-4">About Commercial Properties</h1>
98
-        </div>
99
-        <div class="container col-md-6 text-left">
116
+        <div class="container col-md-6 text-left" v-else>
100
           <p>
117
           <p>
101
             Commercial properties are characteristically any larger properties that
118
             Commercial properties are characteristically any larger properties that
102
             generate profit through leasing or rental activities. These properties
119
             generate profit through leasing or rental activities. These properties
122
         <div class="col-md-4">
139
         <div class="col-md-4">
123
           <p>
140
           <p>
124
             <img
141
             <img
142
+              v-if="propertyUsageType === 'Residential'"
143
+              class="img-fluid"
144
+              src="./../../../public/img/residential.jpg"
145
+              alt="About Resale"
146
+              style="border-radius:10px"
147
+            />
148
+            <img
149
+              v-else
125
               class="img-fluid"
150
               class="img-fluid"
126
               src="./../../../public/img/commercial.jpg"
151
               src="./../../../public/img/commercial.jpg"
127
               alt="About Resale"
152
               alt="About Resale"
130
           </p>
155
           </p>
131
         </div>
156
         </div>
132
       </div>
157
       </div>
133
-      <div>
134
-        <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
135
-        <div v-if="properties.length === 0">
136
-          <img src="../../../public/img/no-homes.png" />
137
-          <br />
138
-          <br />
139
-          <p>Sorry no listing where found matching your search</p>
140
-        </div>
141
-      </div>
142
       <br />
158
       <br />
143
     </div>
159
     </div>
144
   </div>
160
   </div>
145
 </template>
161
 </template>
146
 <script>
162
 <script>
147
 import { mapState, mapActions } from 'vuex';
163
 import { mapState, mapActions } from 'vuex';
148
-import propertyCard from './propertyCard.vue';
149
 
164
 
150
 export default {
165
 export default {
151
   name: 'propertysearch',
166
   name: 'propertysearch',
152
-  components: {
153
-    propertyCard,
154
-  },
155
   data() {
167
   data() {
156
     return {
168
     return {
157
-      propertySearch: {
158
-        userName: '',
159
-        salesType: 'All',
160
-        propertyUsageType: 'All',
161
-        propertyType: 'All',
162
-        province: 'All',
163
-        city: 'All',
164
-        suburb: 'All',
165
-        minPrice: 0,
166
-        maxPrice: 0,
167
-      },
169
+      propertyUsageType: 'Residential',
170
+      salesType: 'Sale',
171
+      searchText: '',
172
+      options: ['bla', 'boo', 'buz'],
168
     };
173
     };
169
   },
174
   },
170
-  mounted() {
171
-    if (typeof this.propertySearch.propertyUsageType === 'undefined') {
172
-      this.propertySearch.propertyUsageType = 'Residential';
173
-    }
175
+  computed: {
176
+    ...mapState('propertySearch', ['suburbs', 'propertySearch']),
174
   },
177
   },
175
   methods: {
178
   methods: {
176
-    ...mapActions('propertySearch', ['searchProperties']),
179
+    ...mapActions('propertySearch', ['getSuburbs', 'applyFilter']),
177
     SetType(item) {
180
     SetType(item) {
178
-      this.propertySearch.propertyUsageType = item;
181
+      this.propertyUsageType = item;
179
     },
182
     },
180
-  },
181
-  computed: {
182
-    ...mapState('propertySearch', ['properties']),
183
-    ...mapState('authentication', ['username']),
184
-    ParamsChanged() {
185
-      if (Object.keys(this.$route.query).length === 0) {
186
-        if (this.propertySearch.propertyUsageType === 'All') {
187
-          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
188
-          this.propertySearch.propertyUsageType = 'Residential';
189
-          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
190
-          this.propertySearch.keyword = 'All';
191
-          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
192
-          this.propertySearch.salesType = 'All';
193
-        }
194
-      }
195
-      if (Object.keys(this.$route.query).length > 0) {
196
-        if (Object.keys(this.$route.query).length > 2) {
197
-          // eslint-disable-next-line vue/no-side-effects-in-computed-properties
198
-          this.propertySearch = this.$route.query;
199
-        } else {
200
-          if (this.$route.query.salesType) {
201
-            // eslint-disable-next-line vue/no-side-effects-in-computed-properties
202
-            this.propertySearch.salesType = this.$route.query.salesType;
203
-          }
204
-          if (this.$route.query.propertyUsageType) {
205
-            // eslint-disable-next-line vue/no-side-effects-in-computed-properties
206
-            this.propertySearch.propertyUsageType = this.$route.query.propertyUsageType;
207
-          }
208
-        }
209
-      }
210
-      if (this.propertySearch.keyword === '') {
211
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
212
-        this.propertySearch.keyword = 'All';
213
-      }
214
-      if (this.username) {
215
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
216
-        this.propertySearch.userName = this.username;
217
-      } else {
218
-        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
219
-        this.propertySearch.userName = 'Unknown';
220
-      }
221
-      this.searchProperties(this.propertySearch);
222
-      return null;
183
+    SearchClick() {
184
+      const item = this.suburbs.find(s => s.id === this.searchText);
185
+      console.log(JSON.stringify(item));
186
+      this.propertySearch.province = item.province;
187
+      this.propertySearch.city = item.city;
188
+      this.propertySearch.suburb = item.suburb;
189
+      this.propertySearch.propertyUsageType = this.propertyUsageType;
190
+      this.propertySearch.salesType = this.salesType;
191
+
192
+      this.$router.push('/property/propertySearch/results');
223
     },
193
     },
224
-  },
225
-  watch: {
226
-    ParamsChanged() {
227
-      return null;
194
+    Filter() {
195
+      this.applyFilter(this.searchText);
196
+    },
197
+    SetSalesType(value) {
198
+      this.salesType = value;
228
     },
199
     },
229
   },
200
   },
201
+  mounted() {
202
+    this.getSuburbs();
203
+  },
230
 };
204
 };
231
 </script>
205
 </script>

+ 1
- 13
src/components/property/propertySearchResults.vue Просмотреть файл

48
     propertyCard,
48
     propertyCard,
49
   },
49
   },
50
   data() {
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
-    };
51
+    return {};
64
   },
52
   },
65
   mounted() {
53
   mounted() {
66
     if (typeof this.propertySearch.propertyUsageType === 'undefined') {
54
     if (typeof this.propertySearch.propertyUsageType === 'undefined') {

+ 2
- 2
src/components/property/propertyeditPage.vue Просмотреть файл

300
                 />
300
                 />
301
                 <span
301
                 <span
302
                   v-if="!img.isDeleted && mayEdit"
302
                   v-if="!img.isDeleted && mayEdit"
303
-                  class="input-group-text"
303
+                  class="input-group-text spanCursor"
304
                   align="center"
304
                   align="center"
305
                   @click="DeleteImage(img)"
305
                   @click="DeleteImage(img)"
306
                 >
306
                 >
625
 </script>
625
 </script>
626
 
626
 
627
 <style>
627
 <style>
628
-span {
628
+.spanCursor {
629
   cursor: pointer;
629
   cursor: pointer;
630
 }
630
 }
631
 .opacity {
631
 .opacity {

+ 6
- 17
src/components/shared/searchTab.vue Просмотреть файл

115
     return {
115
     return {
116
       selectedPropertyType: 'timeshare',
116
       selectedPropertyType: 'timeshare',
117
       keyword: '',
117
       keyword: '',
118
-      propertySearch: {
119
-        keyword: '',
120
-        userName: '',
121
-        salesType: 'Sale',
122
-        propertyUsageType: 'All',
123
-        propertyType: 'All',
124
-        province: 'All',
125
-        city: 'All',
126
-        suburb: 'All',
127
-        minPrice: 0,
128
-        maxPrice: 0,
129
-      },
130
     };
118
     };
131
   },
119
   },
132
   computed: {
120
   computed: {
133
     ...mapState('weekList', ['filter']),
121
     ...mapState('weekList', ['filter']),
122
+    ...mapState('propertySearch', ['propertySearch']),
134
   },
123
   },
135
   methods: {
124
   methods: {
136
     updateType(item) {
125
     updateType(item) {
145
       if (this.selectedPropertyType === 'timeshare') {
134
       if (this.selectedPropertyType === 'timeshare') {
146
         this.$router.push('/timesharesearch');
135
         this.$router.push('/timesharesearch');
147
       } else {
136
       } else {
148
-        // this.$router.push('/property/search');
149
-        this.$router.push({
150
-          path: '/property/search',
151
-          query: this.propertySearch,
152
-        });
137
+        this.$router.push('/property/propertySearch/results');
138
+        // this.$router.push({
139
+        //   path: '/property/search',
140
+        //   query: this.propertySearch,
141
+        // });
153
       }
142
       }
154
     },
143
     },
155
   },
144
   },

+ 225
- 218
src/router/index.js Просмотреть файл

50
 import TemplatePage from '../components/communication/templatePage.vue';
50
 import TemplatePage from '../components/communication/templatePage.vue';
51
 import CarouselList from '../components/admin/misc/carouselList.vue';
51
 import CarouselList from '../components/admin/misc/carouselList.vue';
52
 import CarouselDetail from '../components/admin/misc/carousel.vue';
52
 import CarouselDetail from '../components/admin/misc/carousel.vue';
53
+import PropertySearchResults from '../components/property/propertySearchResults.vue';
53
 
54
 
54
 Vue.use(Router);
55
 Vue.use(Router);
55
 
56
 
61
       y: 0,
62
       y: 0,
62
     };
63
     };
63
   },
64
   },
64
-  routes: [{
65
-    path: '/',
66
-    name: 'Home',
67
-    component: HomePage,
68
-  },
69
-  {
70
-    path: '/about/us',
71
-    name: 'aboutus',
72
-    component: AboutUs,
73
-  },
74
-  {
75
-    path: '/about/timeshare',
76
-    name: 'abouttimeshare',
77
-    component: AboutTimeshare,
78
-  },
79
-  {
80
-    path: '/communication/template',
81
-    name: 'template',
82
-    component: TemplatePage,
83
-  },
84
-  {
85
-    path: '/timeshare/sell',
86
-    name: 'TimeshareSell',
87
-    component: TimeshareSell,
88
-  },
89
-  {
90
-    path: '/timeshare/buy',
91
-    name: 'TimeshareBuy',
92
-    component: TimeshareBuy,
93
-  },
94
-  {
95
-    path: '/timeshare/faq',
96
-    name: 'TimeshareFAQ',
97
-    component: TimeshareFAQ,
98
-  },
99
-  {
100
-    path: '/timeshare/myWeeks',
101
-    name: 'MyWeeks',
102
-    component: MyWeeksPage,
103
-  },
104
-  {
105
-    path: '/user/login',
106
-    name: 'Login',
107
-    component: Login,
108
-  },
109
-  {
110
-    path: '/user/updateProfileInfo',
111
-    name: 'UpdateInfo',
112
-    component: UpdateInfo,
113
-  },
114
-  {
115
-    path: '/user/register',
116
-    name: 'PrivateIndividual',
117
-    component: PrivateIndividual,
118
-  },
119
-  {
120
-    path: '/user/registeragency',
121
-    name: 'Agency',
122
-    component: Agency,
123
-  },
124
-  {
125
-    path: '/property/property/:id',
126
-    name: 'PropertyPage',
127
-    component: PropertyPage,
128
-  },
129
-  {
130
-    path: '/property/:propertyUsageType/search',
131
-    name: 'PropertySearch',
132
-    component: PropertySearch,
133
-  },
134
-  {
135
-    path: '/property/search',
136
-    name: 'PropertySearchTab',
137
-    component: PropertySearch,
138
-  },
139
-  {
140
-    path: '/property/new/:saleType',
141
-    name: 'PropertyNew',
142
-    component: PropertyCreate,
143
-  },
144
-  {
145
-    path: '/property/new/:propertyUsageType/:saleType',
146
-    name: 'PropertyNewFromSearch',
147
-    component: PropertyCreate,
148
-  },
149
-  {
150
-    path: '/property/edit',
151
-    name: 'PropertyEdit',
152
-    component: PropertyEdit,
153
-  },
154
-  {
155
-    path: '/property/admin/list/:by',
156
-    name: 'PropertyListAdmin',
157
-    component: PropertyList,
158
-  },
159
-  {
160
-    path: '/propertyTypes/list',
161
-    name: 'PropertyTypeList',
162
-    component: PropertyTypeList,
163
-  },
164
-  {
165
-    path: '/propertyType/new',
166
-    name: 'PropertyTypeNew',
167
-    component: PropertyType,
168
-  },
169
-  {
170
-    path: '/propertyType/:id',
171
-    name: 'PropertyTypeEdit',
172
-    component: PropertyType,
173
-  },
174
-  {
175
-    path: '/userDefinedGroups/list',
176
-    name: 'UserDefinedGroupsList',
177
-    component: UserDefinedGroups,
178
-  },
179
-  {
180
-    path: '/userDefinedGroups/userDefinedGroup/:id',
181
-    name: 'UserDefinedGroupEdit',
182
-    component: UserDefinedGroup,
183
-  },
184
-  {
185
-    path: '/userDefinedGroups/userDefinedGroup',
186
-    name: 'UserDefinedGroupNew',
187
-    component: UserDefinedGroup,
188
-  },
189
-  {
190
-    path: '/status/list',
191
-    name: 'StatusList',
192
-    component: Status,
193
-  },
194
-  {
195
-    path: '/status/timeshareAdmin',
196
-    name: 'TimeshareAdmin',
197
-    component: timeshareAdminPage,
198
-  },
199
-  {
200
-    path: '/status/tenderWeekAdmin',
201
-    name: 'TenderWeekAdmin',
202
-    component: tenderWeekAdminPage,
203
-  },
204
-  {
205
-    path: '/status/userManagementPage',
206
-    name: 'userManagementPage',
207
-    component: userManagementPage,
208
-  },
209
-  {
210
-    path: '/status/agentUserManagementPage',
211
-    name: 'agentManagementPage',
212
-    component: agentManagementPage,
213
-  },
214
-  {
215
-    path: '/status/changeLogPage',
216
-    name: 'changeLogPage',
217
-    component: changeLogPage,
218
-  },
219
-  {
220
-    path: '/unitConfiguration/list',
221
-    name: 'UnitConfiguration',
222
-    component: UnitConfiguration,
223
-  },
224
-  {
225
-    path: '/contactus',
226
-    name: 'ContactUs',
227
-    component: ContactUs,
228
-  },
229
-  {
230
-    path: '/privacypolicy',
231
-    name: 'PrivacyPolicy',
232
-    component: PrivacyPolicy,
233
-  },
234
-  {
235
-    path: '/resort/:resortCode',
236
-    name: 'ResortPage',
237
-    component: ResortPage,
238
-    props: true,
239
-  },
240
-  {
241
-    path: '/resort/:resortCode/:unitNumber',
242
-    name: 'UnitPage',
243
-    component: UnitPage,
244
-    props: true,
245
-  },
246
-  {
247
-    path: '/timeshare/:weekId',
248
-    name: 'TimeshareSell',
249
-    component: TimeshareSell,
250
-    props: true,
251
-  },
252
-  {
253
-    path: '/MakeOffer',
254
-    name: 'MakeOffer',
255
-    component: MakeOffer,
256
-  },
257
-  {
258
-    path: '/Offers',
259
-    name: 'Offers',
260
-    component: Offer,
261
-  },
262
-  {
263
-    path: '/timesharesearch',
264
-    name: 'TimeshareSearch',
265
-    component: TimeshareSearch,
266
-  },
267
-  {
268
-    path: '/searchLog',
269
-    name: 'SearchLog',
270
-    component: searchLog,
271
-  },
272
-  {
273
-    path: '/carousel',
274
-    name: 'carousel',
275
-    component: CarouselList,
276
-  },
277
-  {
278
-    path: '/carousel/details/:id',
279
-    name: 'CarouselDetails',
280
-    component: CarouselDetail,
281
-  },
65
+  routes: [
66
+    {
67
+      path: '/',
68
+      name: 'Home',
69
+      component: HomePage,
70
+    },
71
+    {
72
+      path: '/about/us',
73
+      name: 'aboutus',
74
+      component: AboutUs,
75
+    },
76
+    {
77
+      path: '/about/timeshare',
78
+      name: 'abouttimeshare',
79
+      component: AboutTimeshare,
80
+    },
81
+    {
82
+      path: '/communication/template',
83
+      name: 'template',
84
+      component: TemplatePage,
85
+    },
86
+    {
87
+      path: '/timeshare/sell',
88
+      name: 'TimeshareSell',
89
+      component: TimeshareSell,
90
+    },
91
+    {
92
+      path: '/timeshare/buy',
93
+      name: 'TimeshareBuy',
94
+      component: TimeshareBuy,
95
+    },
96
+    {
97
+      path: '/timeshare/faq',
98
+      name: 'TimeshareFAQ',
99
+      component: TimeshareFAQ,
100
+    },
101
+    {
102
+      path: '/timeshare/myWeeks',
103
+      name: 'MyWeeks',
104
+      component: MyWeeksPage,
105
+    },
106
+    {
107
+      path: '/user/login',
108
+      name: 'Login',
109
+      component: Login,
110
+    },
111
+    {
112
+      path: '/user/updateProfileInfo',
113
+      name: 'UpdateInfo',
114
+      component: UpdateInfo,
115
+    },
116
+    {
117
+      path: '/user/register',
118
+      name: 'PrivateIndividual',
119
+      component: PrivateIndividual,
120
+    },
121
+    {
122
+      path: '/user/registeragency',
123
+      name: 'Agency',
124
+      component: Agency,
125
+    },
126
+    {
127
+      path: '/property/property/:id',
128
+      name: 'PropertyPage',
129
+      component: PropertyPage,
130
+    },
131
+    {
132
+      path: '/property/:propertyUsageType/search',
133
+      name: 'PropertySearch',
134
+      component: PropertySearch,
135
+    },
136
+    {
137
+      path: '/property/search',
138
+      name: 'PropertySearchTab',
139
+      component: PropertySearch,
140
+    },
141
+    {
142
+      path: '/property/new/:saleType',
143
+      name: 'PropertyNew',
144
+      component: PropertyCreate,
145
+    },
146
+    {
147
+      path: '/property/new/:propertyUsageType/:saleType',
148
+      name: 'PropertyNewFromSearch',
149
+      component: PropertyCreate,
150
+    },
151
+    {
152
+      path: '/property/edit',
153
+      name: 'PropertyEdit',
154
+      component: PropertyEdit,
155
+    },
156
+    {
157
+      path: '/property/admin/list/:by',
158
+      name: 'PropertyListAdmin',
159
+      component: PropertyList,
160
+    },
161
+    {
162
+      path: '/propertyTypes/list',
163
+      name: 'PropertyTypeList',
164
+      component: PropertyTypeList,
165
+    },
166
+    {
167
+      path: '/propertyType/new',
168
+      name: 'PropertyTypeNew',
169
+      component: PropertyType,
170
+    },
171
+    {
172
+      path: '/propertyType/:id',
173
+      name: 'PropertyTypeEdit',
174
+      component: PropertyType,
175
+    },
176
+    {
177
+      path: '/userDefinedGroups/list',
178
+      name: 'UserDefinedGroupsList',
179
+      component: UserDefinedGroups,
180
+    },
181
+    {
182
+      path: '/userDefinedGroups/userDefinedGroup/:id',
183
+      name: 'UserDefinedGroupEdit',
184
+      component: UserDefinedGroup,
185
+    },
186
+    {
187
+      path: '/userDefinedGroups/userDefinedGroup',
188
+      name: 'UserDefinedGroupNew',
189
+      component: UserDefinedGroup,
190
+    },
191
+    {
192
+      path: '/status/list',
193
+      name: 'StatusList',
194
+      component: Status,
195
+    },
196
+    {
197
+      path: '/status/timeshareAdmin',
198
+      name: 'TimeshareAdmin',
199
+      component: timeshareAdminPage,
200
+    },
201
+    {
202
+      path: '/status/tenderWeekAdmin',
203
+      name: 'TenderWeekAdmin',
204
+      component: tenderWeekAdminPage,
205
+    },
206
+    {
207
+      path: '/status/userManagementPage',
208
+      name: 'userManagementPage',
209
+      component: userManagementPage,
210
+    },
211
+    {
212
+      path: '/status/agentUserManagementPage',
213
+      name: 'agentManagementPage',
214
+      component: agentManagementPage,
215
+    },
216
+    {
217
+      path: '/status/changeLogPage',
218
+      name: 'changeLogPage',
219
+      component: changeLogPage,
220
+    },
221
+    {
222
+      path: '/unitConfiguration/list',
223
+      name: 'UnitConfiguration',
224
+      component: UnitConfiguration,
225
+    },
226
+    {
227
+      path: '/contactus',
228
+      name: 'ContactUs',
229
+      component: ContactUs,
230
+    },
231
+    {
232
+      path: '/privacypolicy',
233
+      name: 'PrivacyPolicy',
234
+      component: PrivacyPolicy,
235
+    },
236
+    {
237
+      path: '/resort/:resortCode',
238
+      name: 'ResortPage',
239
+      component: ResortPage,
240
+      props: true,
241
+    },
242
+    {
243
+      path: '/resort/:resortCode/:unitNumber',
244
+      name: 'UnitPage',
245
+      component: UnitPage,
246
+      props: true,
247
+    },
248
+    {
249
+      path: '/timeshare/:weekId',
250
+      name: 'TimeshareSell',
251
+      component: TimeshareSell,
252
+      props: true,
253
+    },
254
+    {
255
+      path: '/MakeOffer',
256
+      name: 'MakeOffer',
257
+      component: MakeOffer,
258
+    },
259
+    {
260
+      path: '/Offers',
261
+      name: 'Offers',
262
+      component: Offer,
263
+    },
264
+    {
265
+      path: '/timesharesearch',
266
+      name: 'TimeshareSearch',
267
+      component: TimeshareSearch,
268
+    },
269
+    {
270
+      path: '/searchLog',
271
+      name: 'SearchLog',
272
+      component: searchLog,
273
+    },
274
+    {
275
+      path: '/carousel',
276
+      name: 'carousel',
277
+      component: CarouselList,
278
+    },
279
+    {
280
+      path: '/carousel/details/:id',
281
+      name: 'CarouselDetails',
282
+      component: CarouselDetail,
283
+    },
284
+    {
285
+      path: '/property/propertySearch/results',
286
+      name: 'PropertySearchResults',
287
+      component: PropertySearchResults,
288
+    },
282
   ],
289
   ],
283
 });
290
 });

+ 25
- 0
src/store/modules/misc/carousel.js Просмотреть файл

4
   namespaced: true,
4
   namespaced: true,
5
   state: {
5
   state: {
6
     carouselList: [],
6
     carouselList: [],
7
+    carousel: {
8
+      id: 0,
9
+      propertyID: 0,
10
+      timeshareID: 0,
11
+      header: '',
12
+      image: '',
13
+    },
7
   },
14
   },
8
   mutations: {
15
   mutations: {
16
+    setCarouselItem(state, item) {
17
+      state.carousel = item;
18
+    },
9
     setCarouselList(state, items) {
19
     setCarouselList(state, items) {
10
       state.carouselList = items;
20
       state.carouselList = items;
11
     },
21
     },
22
+    addToCarouselList(state, item) {
23
+      state.carouselList.push(item);
24
+    },
12
     removeCarousel(state, id) {
25
     removeCarousel(state, id) {
13
       state.carouselList.pop(state.carouselList.find(p => p.id === id));
26
       state.carouselList.pop(state.carouselList.find(p => p.id === id));
14
     },
27
     },
15
   },
28
   },
16
   getters: {},
29
   getters: {},
17
   actions: {
30
   actions: {
31
+    getCarouselItem({ commit }, id) {
32
+      axios
33
+        .get(`/api/Carousel/${id}`)
34
+        .then(result => commit('setCarouselItem', result.data))
35
+        .catch(console.error);
36
+    },
18
     getCarouselList({ commit }) {
37
     getCarouselList({ commit }) {
19
       axios
38
       axios
20
         .get('/api/Carousel')
39
         .get('/api/Carousel')
21
         .then(result => commit('setCarouselList', result.data))
40
         .then(result => commit('setCarouselList', result.data))
22
         .catch(console.error);
41
         .catch(console.error);
23
     },
42
     },
43
+    saveCarouselItem({ commit }, item) {
44
+      axios
45
+        .post('/api/Carousel', item)
46
+        .then(result => commit('addToCarouselList', result.data))
47
+        .catch(console.error);
48
+    },
24
     deleteCarousel({ commit }, id) {
49
     deleteCarousel({ commit }, id) {
25
       axios
50
       axios
26
         .delete(`/api/Carousel/${id}`)
51
         .delete(`/api/Carousel/${id}`)

+ 6
- 0
src/store/modules/property/property.js Просмотреть файл

183
         .then(response => commit('setPropertyFields', response.data))
183
         .then(response => commit('setPropertyFields', response.data))
184
         .catch(console.error);
184
         .catch(console.error);
185
     },
185
     },
186
+    getSavedPropertyImages({ commit }, id) {
187
+      axios
188
+        .get(`/api/PropertyImage/GetProperySavedImages/${id}`)
189
+        .then(result => commit('setPropertyImages', result.data))
190
+        .catch(console.error);
191
+    },
186
   },
192
   },
187
 };
193
 };

+ 26
- 0
src/store/modules/property/propertySearch.js Просмотреть файл

19
     },
19
     },
20
     properties: [],
20
     properties: [],
21
     latestProperties: [],
21
     latestProperties: [],
22
+    suburbs: [],
23
+    searchText: '',
22
   },
24
   },
23
   mutations: {
25
   mutations: {
24
     updateSearch(state, propertySearch) {
26
     updateSearch(state, propertySearch) {
34
     onClearFilter(state, filter) {
36
     onClearFilter(state, filter) {
35
       state.propertySearch[filter] = 'All';
37
       state.propertySearch[filter] = 'All';
36
     },
38
     },
39
+    setSuburbs(state, items) {
40
+      state.suburbs = items;
41
+    },
42
+    setFilter(state, value) {
43
+      state.searchText = value;
44
+    },
45
+  },
46
+  getters: {
47
+    filterSuburbs: (state) => {
48
+      let subs = state.suburbs;
49
+      if (state.searchText) {
50
+        subs = _.filter(subs, s => s.display.contains(state.searchText));
51
+      }
52
+      return subs;
53
+    },
37
   },
54
   },
38
   actions: {
55
   actions: {
39
     clearFilter({ commit }, filter) {
56
     clearFilter({ commit }, filter) {
73
         .then(response => commit('setLatestProperties', response.data))
90
         .then(response => commit('setLatestProperties', response.data))
74
         .catch(console.error);
91
         .catch(console.error);
75
     },
92
     },
93
+    getSuburbs({ commit }) {
94
+      axios
95
+        .get('/api/suburb/GetSearchList')
96
+        .then(response => commit('setSuburbs', response.data))
97
+        .catch(console.error);
98
+    },
99
+    applyFilter({ commit }, value) {
100
+      commit('setFilter', { value });
101
+    },
76
   },
102
   },
77
 };
103
 };

Загрузка…
Отмена
Сохранить