30117125 4 gadus atpakaļ
vecāks
revīzija
3f1c44d87e

+ 8
- 0
src/App.vue Parādīt failu

@@ -136,6 +136,14 @@ html {
136 136
   background-color: #ff8344;
137 137
   color: white;
138 138
 }
139
+.redText {
140
+  background-color: #eb5252;
141
+  color: white;
142
+}
143
+.greenText {
144
+  background-color: #43e243;
145
+  color: white;
146
+}
139 147
 .noWeeks {
140 148
   background-color: #ff4444;
141 149
 }

+ 10
- 8
src/components/admin/property/propertyList.vue Parādīt failu

@@ -276,14 +276,16 @@ export default {
276 276
       }
277 277
     });
278 278
   },
279
-  // watch: {
280
-  //   sortKey: {
281
-  //     immediate: true,
282
-  //     handler(val, oldVal) {
283
-  //       return this.FilteredProperties;
284
-  //     },
285
-  //   },
286
-  // },
279
+  watch: {
280
+    filter: {
281
+      immediate: true,
282
+      handler(val, oldVal) {
283
+        if (val != oldVal) {
284
+          this.currentPage = 1;
285
+        }
286
+      },
287
+    },
288
+  },
287 289
 };
288 290
 </script>
289 291
 

+ 30
- 2
src/components/property/editProperty/editProperty.vue Parādīt failu

@@ -26,7 +26,7 @@
26 26
                     v-model="property.statusString"
27 27
                     @change="StatusChanged"
28 28
                   >
29
-                    <option v-for="(item, i) in statuses" :key="i">{{ item }}</option>
29
+                    <option v-for="(item, i) in Statuses" :key="i">{{ item }}</option>
30 30
                   </select>
31 31
                 </div>
32 32
               </div>
@@ -135,8 +135,9 @@
135 135
                       </select>
136 136
                     </div>
137 137
                   </div>
138
-                  <div class="row my-3">
138
+                  <div v-if="!property.isSale" class="row my-3">
139 139
                     <div class="col-md-12">
140
+                      Date Available
140 141
                       <input
141 142
                         type="date"
142 143
                         class="form-control uniInput"
@@ -146,6 +147,21 @@
146 147
                       />
147 148
                     </div>
148 149
                   </div>
150
+                  <div
151
+                    class="row my-3"
152
+                    v-if="property.statusString === 'Sold' || property.statusString ==='Rented Out'"
153
+                  >
154
+                    <div class="col-md-12">
155
+                      Hide Property After
156
+                      <input
157
+                        type="date"
158
+                        class="form-control uniInput"
159
+                        name="date"
160
+                        v-model="property.cutOffDisplayDateString"
161
+                      />
162
+                    </div>
163
+                  </div>
164
+
149 165
                   <div class="row my-3">
150 166
                     <br />
151 167
                   </div>
@@ -540,6 +556,18 @@ export default {
540 556
       }
541 557
       return list;
542 558
     },
559
+    Statuses() {
560
+      const list = [];
561
+      for (let i = 0; i < this.statuses.length; i++) {
562
+        if (this.property.isSale && this.statuses[i] !== "Rented Out") {
563
+          list.push(this.statuses[i]);
564
+        }
565
+        if (!this.property.isSale && this.statuses[i] !== "Sold") {
566
+          list.push(this.statuses[i]);
567
+        }
568
+      }
569
+      return list;
570
+    },
543 571
   },
544 572
 };
545 573
 </script>

+ 14
- 14
src/components/property/propertyCard.vue Parādīt failu

@@ -14,7 +14,7 @@
14 14
                   <h3>{{ currentProperty.displayPrice }}</h3>
15 15
                   <div>
16 16
                     <img
17
-                      style="max-height:165px; object-fit: cover;"
17
+                      style="height:165px; object-fit: cover;"
18 18
                       :src="currentProperty.displayImage"
19 19
                       alt
20 20
                     />
@@ -26,16 +26,10 @@
26 26
                   {{ currentProperty.propertyReference }}
27 27
                 </p>
28 28
                 <p
29
-                  v-if="!currentProperty.isSale"
30
-                  :class="[currentProperty.hasPendingOffer ? 'pendingOffer' : 'normalText']"
29
+                  v-if="currentProperty.displayText != ''"
30
+                  :class="[currentProperty.displayColor === 'green' ? 'greenText' : currentProperty.displayColor === 'orange' ? 'pendingOffer' : currentProperty.displayColor === 'red' ? 'redText' : 'normalText']"
31 31
                 >
32
-                  <strong>{{ currentProperty.available }}</strong>
33
-                </p>
34
-                <p
35
-                  v-if="currentProperty.isSale && currentProperty.hasPendingOffer"
36
-                  class="pendingOffer"
37
-                >
38
-                  <strong>{{ currentProperty.available }}</strong>
32
+                  <strong>{{ currentProperty.displayText }}</strong>
39 33
                 </p>
40 34
               </div>
41 35
             </router-link>
@@ -46,7 +40,7 @@
46 40
                 <div class="feature-top pt-3 mb-2">
47 41
                   <h3>{{ currentProperty.displayPrice }}</h3>
48 42
                   <img
49
-                    style="max-height:165px; object-fit: cover;"
43
+                    style="height:165px; object-fit: cover;"
50 44
                     :src="currentProperty.displayImage"
51 45
                     alt
52 46
                   />
@@ -56,6 +50,12 @@
56 50
                   <strong>Property Reference</strong>
57 51
                   {{ currentProperty.propertyReference }}
58 52
                 </p>
53
+                <p
54
+                  v-if="currentProperty.displayText != ''"
55
+                  :class="[currentProperty.displayColor === 'green' ? 'greenText' : currentProperty.displayColor === 'orange' ? 'pendingOffer' : currentProperty.displayColor === 'red' ? 'redText' : 'normalText']"
56
+                >
57
+                  <strong>{{ currentProperty.displayText }}</strong>
58
+                </p>
59 59
               </div>
60 60
             </router-link>
61 61
           </div>
@@ -73,7 +73,7 @@ export default {
73 73
   props: {
74 74
     properties: { type: Array, default: () => [] },
75 75
     showSort: { type: Boolean, default: true },
76
-    salesType: { type: String, default: "Rent" }
76
+    salesType: { type: String, default: "Rent" },
77 77
   },
78 78
   methods: {
79 79
     sortHighPrice() {
@@ -111,8 +111,8 @@ export default {
111 111
       }
112 112
 
113 113
       return this.properties.sort(compare);
114
-    }
115
-  }
114
+    },
115
+  },
116 116
 };
117 117
 </script>
118 118
 

+ 8
- 14
src/components/property/propertyCardSearch.vue Parādīt failu

@@ -13,7 +13,7 @@
13 13
                 <div class="feature-top pt-3 mb-2">
14 14
                   <h3 style="color:white !important">{{ currentProperty.displayPrice }}</h3>
15 15
                   <img
16
-                    style="max-height:165px; object-fit: cover;"
16
+                    style="height:165px; object-fit: cover;"
17 17
                     :src="currentProperty.displayImage"
18 18
                     alt
19 19
                   />
@@ -24,16 +24,10 @@
24 24
                   {{ currentProperty.propertyReference }}
25 25
                 </p>
26 26
                 <p
27
-                  v-if="!currentProperty.isSale"
28
-                  :class="[currentProperty.hasPendingOffer ? 'pendingOffer' : 'normalText']"
27
+                  v-if="currentProperty.displayText != ''"
28
+                  :class="[currentProperty.displayColor === 'green' ? 'greenText' : currentProperty.displayColor === 'orange' ? 'pendingOffer' : currentProperty.displayColor === 'red' ? 'redText' : 'normalText']"
29 29
                 >
30
-                  <strong>{{ currentProperty.available }}</strong>
31
-                </p>
32
-                <p
33
-                  v-if="currentProperty.isSale && currentProperty.hasPendingOffer"
34
-                  class="pendingOffer"
35
-                >
36
-                  <strong>{{ currentProperty.available }}</strong>
30
+                  <strong>{{ currentProperty.displayText }}</strong>
37 31
                 </p>
38 32
               </div>
39 33
             </router-link>
@@ -44,7 +38,7 @@
44 38
                 <div class="feature-top pt-3 mb-2">
45 39
                   <h3>{{ currentProperty.displayPrice }}</h3>
46 40
                   <img
47
-                    style="max-height:165px; object-fit: cover;"
41
+                    style="height:165px; object-fit: cover;"
48 42
                     :src="currentProperty.displayImage"
49 43
                     alt
50 44
                   />
@@ -71,7 +65,7 @@ export default {
71 65
   props: {
72 66
     properties: { type: Array, default: () => [] },
73 67
     showSort: { type: Boolean, default: true },
74
-    salesType: { type: String, default: "Rent" }
68
+    salesType: { type: String, default: "Rent" },
75 69
   },
76 70
   methods: {
77 71
     sortHighPrice() {
@@ -109,8 +103,8 @@ export default {
109 103
       }
110 104
 
111 105
       return this.properties.sort(compare);
112
-    }
113
-  }
106
+    },
107
+  },
114 108
 };
115 109
 </script>
116 110
 

Notiek ielāde…
Atcelt
Saglabāt