Browse Source

Query: 41933 & Query: 41932

master
George Williams 5 years ago
parent
commit
05fe36dbdf

+ 54
- 2
package-lock.json View File

@@ -3731,8 +3731,7 @@
3731 3731
     "deep-equal": {
3732 3732
       "version": "1.0.1",
3733 3733
       "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
3734
-      "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=",
3735
-      "dev": true
3734
+      "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
3736 3735
     },
3737 3736
     "deep-is": {
3738 3737
       "version": "0.1.3",
@@ -5020,6 +5019,11 @@
5020 5019
       "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
5021 5020
       "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
5022 5021
     },
5022
+    "fast-diff": {
5023
+      "version": "1.1.2",
5024
+      "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
5025
+      "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
5026
+    },
5023 5027
     "fast-glob": {
5024 5028
       "version": "2.2.7",
5025 5029
       "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz",
@@ -8492,6 +8496,11 @@
8492 8496
         "no-case": "^2.2.0"
8493 8497
       }
8494 8498
     },
8499
+    "parchment": {
8500
+      "version": "1.1.4",
8501
+      "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
8502
+      "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
8503
+    },
8495 8504
     "parent-module": {
8496 8505
       "version": "1.0.1",
8497 8506
       "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -9450,6 +9459,41 @@
9450 9459
       "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
9451 9460
       "dev": true
9452 9461
     },
9462
+    "quill": {
9463
+      "version": "1.3.7",
9464
+      "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
9465
+      "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
9466
+      "requires": {
9467
+        "clone": "^2.1.1",
9468
+        "deep-equal": "^1.0.1",
9469
+        "eventemitter3": "^2.0.3",
9470
+        "extend": "^3.0.2",
9471
+        "parchment": "^1.1.4",
9472
+        "quill-delta": "^3.6.2"
9473
+      },
9474
+      "dependencies": {
9475
+        "clone": {
9476
+          "version": "2.1.2",
9477
+          "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
9478
+          "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
9479
+        },
9480
+        "eventemitter3": {
9481
+          "version": "2.0.3",
9482
+          "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
9483
+          "integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo="
9484
+        }
9485
+      }
9486
+    },
9487
+    "quill-delta": {
9488
+      "version": "3.6.3",
9489
+      "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
9490
+      "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
9491
+      "requires": {
9492
+        "deep-equal": "^1.0.1",
9493
+        "extend": "^3.0.2",
9494
+        "fast-diff": "1.1.2"
9495
+      }
9496
+    },
9453 9497
     "randombytes": {
9454 9498
       "version": "2.1.0",
9455 9499
       "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@@ -11892,6 +11936,14 @@
11892 11936
         "trix": "^1.1.1"
11893 11937
       }
11894 11938
     },
11939
+    "vue2-editor": {
11940
+      "version": "2.10.2",
11941
+      "resolved": "https://registry.npmjs.org/vue2-editor/-/vue2-editor-2.10.2.tgz",
11942
+      "integrity": "sha512-sjHTPdRoiB9VK9HLSOjFgubxBWHxRydvykqBCNaX7Sv+2KpdWu6AoyguvP5tyEp4ECX7z6PnbBluyD5M57QOng==",
11943
+      "requires": {
11944
+        "quill": "^1.3.6"
11945
+      }
11946
+    },
11895 11947
     "vuetify": {
11896 11948
       "version": "1.5.16",
11897 11949
       "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-1.5.16.tgz",

+ 1
- 0
package.json View File

@@ -28,6 +28,7 @@
28 28
     "vue-excel-export": "^0.1.3",
29 29
     "vue-router": "^3.0.7",
30 30
     "vue-trix": "^1.0.0",
31
+    "vue2-editor": "^2.10.2",
31 32
     "vuetify": "^1.5.5",
32 33
     "vuex": "^3.1.1"
33 34
   },

BIN
public/img/no-homes.png View File


BIN
public/img/propertyListings.png View File


+ 63
- 61
src/components/property/propertyCard.vue View File

@@ -23,73 +23,75 @@
23 23
     </div>
24 24
     <div class="form-group row">
25 25
       <div class="col-md-4" v-for="currentProperty in properties" :key="currentProperty.id">
26
-        <div class="card-box-a card-shadow">
27
-          <div class="img-box-a">
28
-            <img
29
-              :src="currentProperty.displayImage"
30
-              alt
31
-              class="img-a img-fluid"
32
-              style="height:466px; width:350px; object-fit: cover;"
33
-            />
34
-          </div>
35
-          <div class="card-overlay">
36
-            <div class="card-overlay-a-content">
37
-              <div class="card-header-a">
38
-                <h4 class="card-title-a">
39
-                  <router-link
40
-                    :to="`/property/property/${currentProperty.id}`"
41
-                    class="link-a"
42
-                  >{{ currentProperty.shortDescription }}</router-link>
43
-                </h4>
44
-                <h4 class="card-title-c">
26
+        <router-link :to="`/property/property/${currentProperty.id}`">
27
+          <div class="card-box-a card-shadow">
28
+            <div class="img-box-a">
29
+              <img
30
+                :src="currentProperty.displayImage"
31
+                alt
32
+                class="img-a img-fluid"
33
+                style="height:466px; width:350px; object-fit: cover;"
34
+              />
35
+            </div>
36
+            <div class="card-overlay">
37
+              <div class="card-overlay-a-content">
38
+                <div class="card-header-a">
39
+                  <h4 class="card-title-a">
40
+                    <router-link
41
+                      :to="`/property/property/${currentProperty.id}`"
42
+                      class="link-a"
43
+                    >{{ currentProperty.shortDescription }}</router-link>
44
+                  </h4>
45
+                  <h4 class="card-title-c">
46
+                    <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
47
+                      {{ currentProperty.province }}
48
+                      <br />
49
+                      {{ currentProperty.city }}
50
+                      <br />
51
+                      {{ currentProperty.suburb }}
52
+                    </router-link>
53
+                  </h4>
54
+                </div>
55
+                <div class="card-body-a">
56
+                  <div class="price-box d-flex">
57
+                    <span
58
+                      v-if="currentProperty.isSale"
59
+                      class="price-a"
60
+                    >sale | {{ currentProperty.displayPrice }}</span>
61
+                    <span
62
+                      v-if="!currentProperty.isSale"
63
+                      class="price-a"
64
+                    >rent | {{ currentProperty.displayPrice }}</span>
65
+                  </div>
45 66
                   <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
46
-                    {{ currentProperty.province }}
47
-                    <br />
48
-                    {{ currentProperty.city }}
49
-                    <br />
50
-                    {{ currentProperty.suburb }}
67
+                    Click here to view
68
+                    <span class="ion-ios-arrow-forward"></span>
51 69
                   </router-link>
52
-                </h4>
53
-              </div>
54
-              <div class="card-body-a">
55
-                <div class="price-box d-flex">
56
-                  <span
57
-                    v-if="currentProperty.isSale"
58
-                    class="price-a"
59
-                  >sale | {{ currentProperty.displayPrice }}</span>
60
-                  <span
61
-                    v-if="!currentProperty.isSale"
62
-                    class="price-a"
63
-                  >rent | {{ currentProperty.displayPrice }}</span>
64 70
                 </div>
65
-                <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
66
-                  Click here to view
67
-                  <span class="ion-ios-arrow-forward"></span>
68
-                </router-link>
69
-              </div>
70
-              <div class="card-footer-a" v-if="currentProperty.showFooter">
71
-                <ul class="card-info d-flex justify-content-around">
72
-                  <li v-if="currentProperty.area !== null">
73
-                    <h4 class="card-info-title">Area</h4>
74
-                    <span v-html="currentProperty.area"></span>
75
-                  </li>
76
-                  <li v-if="currentProperty.beds !== null">
77
-                    <h4 class="card-info-title">Beds</h4>
78
-                    <span>{{ currentProperty.beds }}</span>
79
-                  </li>
80
-                  <li v-if="currentProperty.baths !== null">
81
-                    <h4 class="card-info-title">Baths</h4>
82
-                    <span>{{ currentProperty.baths }}</span>
83
-                  </li>
84
-                  <li v-if="currentProperty.garages !== null">
85
-                    <h4 class="card-info-title">Garages</h4>
86
-                    <span>{{ currentProperty.garages }}</span>
87
-                  </li>
88
-                </ul>
71
+                <div class="card-footer-a" v-if="currentProperty.showFooter">
72
+                  <ul class="card-info d-flex justify-content-around">
73
+                    <li v-if="currentProperty.area !== null">
74
+                      <h4 class="card-info-title">Area</h4>
75
+                      <span v-html="currentProperty.area"></span>
76
+                    </li>
77
+                    <li v-if="currentProperty.beds !== null">
78
+                      <h4 class="card-info-title">Beds</h4>
79
+                      <span>{{ currentProperty.beds }}</span>
80
+                    </li>
81
+                    <li v-if="currentProperty.baths !== null">
82
+                      <h4 class="card-info-title">Baths</h4>
83
+                      <span>{{ currentProperty.baths }}</span>
84
+                    </li>
85
+                    <li v-if="currentProperty.garages !== null">
86
+                      <h4 class="card-info-title">Garages</h4>
87
+                      <span>{{ currentProperty.garages }}</span>
88
+                    </li>
89
+                  </ul>
90
+                </div>
89 91
               </div>
90 92
             </div>
91 93
           </div>
92
-        </div>
94
+        </router-link>
93 95
         <br />
94 96
       </div>
95 97
     </div>

+ 1
- 0
src/components/property/propertyImage.vue View File

@@ -5,6 +5,7 @@
5 5
         Upload
6 6
         <input
7 7
           type="file"
8
+          accept=".jpeg, .jpg, .gif, .png"
8 9
           value="Upload Photo"
9 10
           style="width: 0px;height: 0px;overflow: hidden;"
10 11
           name="images[]"

+ 30
- 24
src/components/property/propertyList.vue View File

@@ -12,15 +12,11 @@
12 12
           <div class="col-md-12 col-lg-8">
13 13
             <div class="title-box-d">
14 14
               <h1
15
-                v-if="user !== 'All'"
15
+                v-if="showAdmin"
16 16
                 class="title-d"
17 17
                 style="text-align:left; font-size: 250%"
18
-              >My {{ propertyType }} Properties</h1>
19
-              <h1
20
-                v-else
21
-                class="title-d"
22
-                style="text-align:left; font-size: 250%"
23
-              >All {{ propertyType }} Properties</h1>
18
+              >Admin Properties</h1>
19
+              <h1 v-else class="title-d" style="text-align:left; font-size: 250%">My Properties</h1>
24 20
             </div>
25 21
           </div>
26 22
         </div>
@@ -35,7 +31,9 @@
35 31
             <th>Property ID</th>
36 32
             <th>Size</th>
37 33
             <th>Price</th>
34
+            <th>Usage Type</th>
38 35
             <th>Type</th>
36
+            <th>Sale Type</th>
39 37
             <th>Publish</th>
40 38
             <th>Status</th>
41 39
             <th></th>
@@ -48,7 +46,9 @@
48 46
             <td>{{ item.id }}</td>
49 47
             <td v-html="item.size" />
50 48
             <td>{{ item.price }}</td>
49
+            <td>{{ item.usageType }}</td>
51 50
             <td>{{ item.type }}</td>
51
+            <td>{{ item.saleType }}</td>
52 52
             <!-- <td>{{ item.publish }}</td> -->
53 53
             <td></td>
54 54
             <td>{{ item.status }}</td>
@@ -58,7 +58,6 @@
58 58
                 @click="Edit(item)"
59 59
                 class="btn btn-b-n"
60 60
                 style="width: 85px; height:40px;"
61
-                disabled
62 61
               >Edit</button>
63 62
             </td>
64 63
             <td>
@@ -86,6 +85,7 @@ export default {
86 85
     return {
87 86
       propertyType: '',
88 87
       user: '',
88
+      showAdmin: false,
89 89
     };
90 90
   },
91 91
   methods: {
@@ -99,18 +99,21 @@ export default {
99 99
     },
100 100
   },
101 101
   mounted() {
102
-    this.propertyType = this.$route.params.propertyType;
103
-    this.user = this.$route.params.user;
104
-
105
-    if (this.user === 'MyListings') {
106
-      this.user = 'GeorgeW';
102
+    if (this.$route.params.by === 'my') {
103
+      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
104
+      this.showAdmin = false;
105
+    } else {
106
+      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
107
+      this.showAdmin = true;
107 108
     }
108 109
 
110
+    this.user = 28; // user id
111
+
109 112
     this.getProperties(
110 113
       Object.assign(
111 114
         {},
112 115
         {
113
-          propertyType: this.propertyType,
116
+          propertyType: this.showAdmin ? 'Admin' : 'My',
114 117
           user: this.user,
115 118
         },
116 119
       ),
@@ -118,26 +121,29 @@ export default {
118 121
   },
119 122
   computed: {
120 123
     ...mapState('propertyList', ['properties']),
121
-    TypeChanged() {
122
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
123
-      this.propertyType = this.$route.params.propertyType;
124
-      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
125
-      this.user = this.$route.params.user;
124
+    UserChanged() {
125
+      if (this.$route.params.by === 'my') {
126
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
127
+        this.showAdmin = false;
128
+      } else {
129
+        // eslint-disable-next-line vue/no-side-effects-in-computed-properties
130
+        this.showAdmin = true;
131
+      }
126 132
       this.getProperties(
127 133
         Object.assign(
128 134
           {},
129 135
           {
130
-            propertyType: this.$route.params.propertyType,
131
-            user: this.$route.params.user,
136
+            propertyType: this.showAdmin ? 'Admin' : 'My',
137
+            user: this.user,
132 138
           },
133 139
         ),
134 140
       );
135
-      return this.propertyType;
141
+      return this.user;
136 142
     },
137 143
   },
138 144
   watch: {
139
-    TypeChanged() {
140
-      console.log(this.propertyType);
145
+    UserChanged() {
146
+      console.log(this.user);
141 147
     },
142 148
   },
143 149
 };

+ 1
- 1
src/components/property/propertyPage.vue View File

@@ -127,7 +127,7 @@
127 127
                             name="MakeOffer"
128 128
                             :isMakeOffer="true"
129 129
                             :isProperty="true"
130
-                            :item="{id: property.id, shortDescription: property.shortDescription, description: property.description, price: property.price}"
130
+                            :item="{id: property.id, shortDescription: property.shortDescription, description: property.description, sellPrice: property.price}"
131 131
                           />
132 132
                         </div>
133 133
                       </div>

+ 26
- 10
src/components/property/propertySearchPage.vue View File

@@ -1,6 +1,15 @@
1 1
 <template>
2 2
   <!-- eslint-disable max-len -->
3 3
   <div class="container">
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>
4 13
     <div class="container col-md-12" v-if="propertySearch.propertyUsageType === 'Residential'">
5 14
       <div class="col-sm-12">
6 15
         <div class="about-img-box">
@@ -38,11 +47,11 @@
38 47
           </p>
39 48
           <p>
40 49
             Wish to RENT your property?
41
-            <router-link to="/property/Residential/Rental">Click Here</router-link>
50
+            <router-link to="/property/new/Residential/Rental">Click Here</router-link>
42 51
           </p>
43 52
           <p>
44 53
             Wish to SELL your property?
45
-            <router-link to="/property/Residential/Sale">Click Here</router-link>
54
+            <router-link to="/property/new/Residential/Sale">Click Here</router-link>
46 55
           </p>
47 56
         </div>
48 57
         <div class="col-md-4">
@@ -59,7 +68,7 @@
59 68
       <div>
60 69
         <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
61 70
         <div v-if="properties.length === 0">
62
-          <img src="../../../public/img/no-homes.gif" />
71
+          <img src="../../../public/img/no-homes.png" />
63 72
           <br />
64 73
           <br />
65 74
           <p>Sorry no listing where found matching your search</p>
@@ -103,11 +112,11 @@
103 112
           </p>
104 113
           <p>
105 114
             Wish to RENT your property?
106
-            <router-link to="/property/Commercial/Rental">Click Here</router-link>
115
+            <router-link to="/property/new/Commercial/Rental">Click Here</router-link>
107 116
           </p>
108 117
           <p>
109 118
             Wish to SELL your property?
110
-            <router-link to="/property/Commercial/Sale">Click Here</router-link>
119
+            <router-link to="/property/new/Commercial/Sale">Click Here</router-link>
111 120
           </p>
112 121
         </div>
113 122
         <div class="col-md-4">
@@ -124,7 +133,7 @@
124 133
       <div>
125 134
         <propertyCard v-if="properties.length > 0" name="propertyholder" :properties="properties" />
126 135
         <div v-if="properties.length === 0">
127
-          <img src="../../../public/img/no-homes.gif" />
136
+          <img src="../../../public/img/no-homes.png" />
128 137
           <br />
129 138
           <br />
130 139
           <p>Sorry no listing where found matching your search</p>
@@ -158,16 +167,24 @@ export default {
158 167
       },
159 168
     };
160 169
   },
170
+  mounted() {
171
+    if (typeof this.propertySearch.propertyUsageType === 'undefined') {
172
+      this.propertySearch.propertyUsageType = 'Residential';
173
+    }
174
+  },
161 175
   methods: {
162 176
     ...mapActions('propertySearch', ['searchProperties']),
177
+    SetType(item) {
178
+      this.propertySearch.propertyUsageType = item;
179
+    },
163 180
   },
164 181
   computed: {
165 182
     ...mapState('propertySearch', ['properties']),
166 183
     ParamsChanged() {
167
-      if (Object.keys(this.$route.params).length > 0) {
168
-        if (this.$route.params.propertyUsageType) {
184
+      if (Object.keys(this.$route.query).length === 0) {
185
+        if (this.propertySearch.propertyUsageType === 'All') {
169 186
           // eslint-disable-next-line vue/no-side-effects-in-computed-properties
170
-          this.propertySearch.propertyUsageType = this.$route.params.propertyUsageType;
187
+          this.propertySearch.propertyUsageType = 'Residential';
171 188
           // eslint-disable-next-line vue/no-side-effects-in-computed-properties
172 189
           this.propertySearch.keyword = 'All';
173 190
           // eslint-disable-next-line vue/no-side-effects-in-computed-properties
@@ -193,7 +210,6 @@ export default {
193 210
         // eslint-disable-next-line vue/no-side-effects-in-computed-properties
194 211
         this.propertySearch.keyword = 'All';
195 212
       }
196
-
197 213
       this.searchProperties(this.propertySearch);
198 214
       return null;
199 215
     },

+ 48
- 16
src/components/property/propertyeditPage.vue View File

@@ -3,6 +3,7 @@
3 3
   <div>
4 4
     <div class="container">
5 5
       <div class="col-sm-12">
6
+        <br />
6 7
         <div class="tobuy-img-box">
7 8
           <img
8 9
             v-if="propertyType === 'Commercial'"
@@ -34,6 +35,26 @@
34 35
       <div class="row mb-3">
35 36
         <div class="container col-md-10" style="text-align:left">
36 37
           <form id="mainForm">
38
+            <div class="form-goup row">
39
+              <div class="col-md-4">
40
+                <label>Usage Type</label>
41
+                <div class="input-group-prepend">
42
+                  <span class="input-group-text" style="color: #60CBEB">
43
+                    <b>U</b>
44
+                  </span>
45
+                  <select
46
+                    class="form-control"
47
+                    name="propertyUsageType"
48
+                    id="propertyUsageType"
49
+                    v-model="propertyType"
50
+                    @change="TypeChanged"
51
+                  >
52
+                    <option value="Residential">Residential</option>
53
+                    <option value="Commercial">Commercial</option>
54
+                  </select>
55
+                </div>
56
+              </div>
57
+            </div>
37 58
             <div class="form-group row">
38 59
               <div class="col-md-4">
39 60
                 <label>Property Type</label>
@@ -240,12 +261,7 @@
240 261
             <div class="form-group row">
241 262
               <div class="col-md-12">
242 263
                 <label for="Property Description">Description</label>
243
-                <TextEditor
244
-                  name="description"
245
-                  v-model="property.description"
246
-                  id="description"
247
-                  style="text-align:left"
248
-                />
264
+                <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
249 265
                 <br />
250 266
                 <p>* A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate website</p>
251 267
               </div>
@@ -258,7 +274,7 @@
258 274
               :id="1"
259 275
             ></UserField>
260 276
             <div class="form-group row" />
261
-            <div v-for="(item, i) in propertyFields" :key="item.id">
277
+            <div v-for="item in propertyFields" :key="item.id">
262 278
               <div class="row">
263 279
                 <div class="col-sm-12">
264 280
                   <div class="title-box-d">
@@ -302,7 +318,7 @@
302 318
 
303 319
 <script>
304 320
 import { mapState, mapActions } from 'vuex';
305
-import TextEditor from 'vue-trix';
321
+import { VueEditor } from 'vue2-editor';
306 322
 import { setTimeout } from 'timers';
307 323
 import UserField from './propertyUserField.vue';
308 324
 import ImageLoad from './propertyImage.vue';
@@ -312,7 +328,7 @@ export default {
312 328
   components: {
313 329
     UserField,
314 330
     ImageLoad,
315
-    TextEditor,
331
+    VueEditor,
316 332
   },
317 333
   data() {
318 334
     return {
@@ -324,6 +340,19 @@ export default {
324 340
       propertyFieldValues: [],
325 341
       defaultImage: 0,
326 342
       wait: false,
343
+      customToolbar: [
344
+        [{ header: [false, 1, 2, 3, 4, 5, 6] }],
345
+        ['bold', 'italic', 'underline', 'strike'],
346
+        [
347
+          { align: '' },
348
+          { align: 'center' },
349
+          { align: 'right' },
350
+          { align: 'justify' },
351
+        ],
352
+        [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],
353
+        [{ script: 'sub' }, { script: 'super' }],
354
+        [{ indent: '-1' }, { indent: '+1' }],
355
+      ],
327 356
     };
328 357
   },
329 358
   methods: {
@@ -342,6 +371,7 @@ export default {
342 371
       'getPropertySavedFields',
343 372
       'getSavedPropertyData',
344 373
     ]),
374
+    TypeChanged() {},
345 375
     SubmitData() {
346 376
       this.wait = true;
347 377
       if (this.salesType === 'Sale') {
@@ -363,7 +393,7 @@ export default {
363 393
 
364 394
       setTimeout(
365 395
         () => this.$router.push({
366
-            path: '/property/search',
396
+            path: '/property/Search',
367 397
             query: {
368 398
               salesType: this.salesType,
369 399
               propertyUsageType: this.propertyType,
@@ -434,10 +464,12 @@ export default {
434 464
       this.property.description = '';
435 465
     }
436 466
 
437
-    this.propertyType = this.$route.params.propType;
467
+    if (this.$route.params.propertyUsageType) {
468
+      this.propertyType = this.$route.params.propertyUsageType;
469
+    }
438 470
     this.salesType = this.$route.params.saleType;
439 471
 
440
-    this.getPropertyTypes(this.$route.params.propType);
472
+    this.getPropertyTypes(this.propertyType);
441 473
 
442 474
     this.getProvince();
443 475
     if (this.$route.query.id) {
@@ -447,7 +479,7 @@ export default {
447 479
       );
448 480
     } else {
449 481
       this.getPropertyOverviewFields();
450
-      this.getPropertyFields(this.$route.params.propType);
482
+      this.getPropertyFields(this.propertyType);
451 483
     }
452 484
     // if (this.$route.params.id) {
453 485
     //   this.getPropertyEditDisplay(4); // (this.$route.params.id);
@@ -483,12 +515,12 @@ export default {
483 515
     ]),
484 516
     SalesTypeChanged() {
485 517
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
486
-      this.propertyType = this.$route.params.propType;
518
+      // this.propertyType = this.$route.params.propType;
487 519
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
488 520
       this.salesType = this.$route.params.saleType;
489 521
       if (!this.$route.query.id) {
490
-        this.getPropertyTypes(this.$route.params.propType);
491
-        this.getPropertyFields(this.$route.params.propType);
522
+        this.getPropertyTypes(this.propertyType);
523
+        this.getPropertyFields(this.propertyType);
492 524
       }
493 525
 
494 526
       return this.propertyType;

+ 8
- 27
src/components/shared/navBar.vue View File

@@ -81,41 +81,22 @@
81 81
               <div class="dropdown-menu" aria-labelledby="navbarDropdown">
82 82
                 <a
83 83
                   class="dropdown-item cursor-pointer"
84
-                  @click="routerGoTo('/property/Commercial/Search')"
85
-                >Search Commercial Properties</a>
84
+                  @click="routerGoTo('/property/Search')"
85
+                >Search</a>
86 86
                 <a
87 87
                   class="dropdown-item cursor-pointer"
88
-                  @click="routerGoTo('/property/Commercial/Sale')"
89
-                >To Sell Commercial Properties</a>
90
-                <a
91
-                  class="dropdown-item cursor-pointer"
92
-                  @click="routerGoTo('/property/Commercial/Rental')"
93
-                >To Rent Commercial Properties</a>
94
-                <hr />
95
-
96
-                <a
97
-                  class="dropdown-item cursor-pointer"
98
-                  @click="routerGoTo('/property/Residential/Search')"
99
-                >Search Residential Properties</a>
100
-                <a
101
-                  class="dropdown-item cursor-pointer"
102
-                  @click="routerGoTo('/property/Residential/Sale')"
103
-                >To Sell Residential Properties</a>
88
+                  @click="routerGoTo('/property/new/Sale')"
89
+                >To Sell</a>
104 90
                 <a
105 91
                   class="dropdown-item cursor-pointer"
106
-                  @click="routerGoTo('/property/Residential/Rental')"
107
-                >To Rent Residential Properties</a>
92
+                  @click="routerGoTo('/property/new/Rental')"
93
+                >To Rent</a>
108 94
                 <hr v-if="showLogout" />
109 95
                 <a
110 96
                   v-if="showLogout"
111 97
                   class="dropdown-item cursor-pointer"
112
-                  @click="routerGoTo('/property/list/Commercial/MyListings')"
113
-                >My Commercial Properties</a>
114
-                <a
115
-                  v-if="showLogout"
116
-                  class="dropdown-item cursor-pointer"
117
-                  @click="routerGoTo('/property/list/Residential/MyListings')"
118
-                >My Residential Properties</a>
98
+                  @click="routerGoTo('/property/admin/list/my')"
99
+                >My Properties</a>
119 100
               </div>
120 101
             </li>
121 102
 

+ 8
- 3
src/router/index.js View File

@@ -114,18 +114,23 @@ export default new Router({
114 114
       component: PropertySearch,
115 115
     },
116 116
     {
117
-      path: '/property/:propType/:saleType',
117
+      path: '/property/new/:saleType',
118 118
       name: 'PropertyNew',
119 119
       component: PropertyEdit,
120 120
     },
121
+    {
122
+      path: '/property/new/:propertyUsageType/:saleType',
123
+      name: 'PropertyNewFromSearch',
124
+      component: PropertyEdit,
125
+    },
121 126
     {
122 127
       path: '/property/edit/:id/:propType/:saleType',
123 128
       name: 'PropertyEdit',
124 129
       component: PropertyEdit,
125 130
     },
126 131
     {
127
-      path: '/property/list/:propertyType/:user',
128
-      name: 'PropertyList',
132
+      path: '/property/admin/list/:by',
133
+      name: 'PropertyListAdmin',
129 134
       component: PropertyList,
130 135
     },
131 136
     {

+ 2
- 1
src/store/modules/property/propertyLists.js View File

@@ -13,8 +13,9 @@ export default {
13 13
   getters: {},
14 14
   actions: {
15 15
     getProperties({ commit }, item) {
16
+      console.log(`/api/property/${item.propertyType}/${item.user}`);
16 17
       axios
17
-        .get(`/api/property/${item.propertyType}/All`) // .get(`/api/property/${item.propertyType}/${item.user}`)
18
+        .get(`/api/property/${item.propertyType}/${item.user}`) // .get(`/api/property/${item.propertyType}/${item.user}`)
18 19
         .then(result => commit('setProperties', result.data))
19 20
         .catch(console.error);
20 21
     },

+ 0
- 56
src/store/modules/property/propertySearch.js View File

@@ -35,62 +35,6 @@ export default {
35 35
       state.propertySearch[filter] = 'All';
36 36
     },
37 37
   },
38
-  // getters: {
39
-  //   filterProperties: (state) => {
40
-  //     let list = state.properties;
41
-  //     const { propertySearch } = state;
42
-  //     if (propertySearch) {
43
-  //       if (propertySearch.salesType === 'Sale') {
44
-  //         list = _.filter(list, x => x.isSale);
45
-  //       } else {
46
-  //         list = _.filter(list, x => !x.isSale);
47
-  //       }
48
-  //       if (propertySearch.propertyUsageType && propertySearch.propertyUsageType !== 'All') {
49
-  //         list = _.filter(list, x => x.propertyUsageType
50
-  //             .toUpperCase()
51
-  //             // eslint-disable-next-line comma-dangle
52
-  //             .includes(propertySearch.propertyUsageType.toUpperCase()));
53
-  //       }
54
-  //       if (propertySearch.propertyType && propertySearch.propertyType !== 'All') {
55
-  //         list = _.filter(list, x => x.propertyType
56
-  //             .toUpperCase()
57
-  //             // eslint-disable-next-line comma-dangle
58
-  //             .includes(propertySearch.propertyType.toUpperCase()));
59
-  //       }
60
-  //       if (propertySearch.province && propertySearch.province !== 'All') {
61
-  //         list = _.filter(list, x => x.province
62
-  //             .toUpperCase()
63
-  //             // eslint-disable-next-line comma-dangle
64
-  //             .includes(propertySearch.province.toUpperCase()));
65
-  //       }
66
-  //       if (propertySearch.city && propertySearch.city !== 'All') {
67
-  //         list = _.filter(list, x => x.city
68
-  //             .toUpperCase()
69
-  //             // eslint-disable-next-line comma-dangle
70
-  //             .includes(propertySearch.city.toUpperCase()));
71
-  //       }
72
-  //       if (propertySearch.suburb && propertySearch.suburb !== 'All') {
73
-  //         list = _.filter(list, x => x.suburb
74
-  //             .toUpperCase()
75
-  //             // eslint-disable-next-line comma-dangle
76
-  //             .includes(propertySearch.suburb.toUpperCase()));
77
-  //       }
78
-  //       if (propertySearch.suburb && propertySearch.suburb !== 'All') {
79
-  //         list = _.filter(list, x => x.suburb
80
-  //             .toUpperCase()
81
-  //             // eslint-disable-next-line comma-dangle
82
-  //             .includes(propertySearch.suburb.toUpperCase()));
83
-  //       }
84
-  //       if (propertySearch.minPrice) {
85
-  //         list = _.filter(list, x => x.price >= propertySearch.minPrice);
86
-  //       }
87
-  //       if (propertySearch.maxPrice) {
88
-  //         list = _.filter(list, x => x.price <= propertySearch.maxPrice);
89
-  //       }
90
-  //     }
91
-  //     return list;
92
-  //   },
93
-  // },
94 38
   actions: {
95 39
     clearFilter({ commit }, filter) {
96 40
       commit('onClearFilter', filter);

Loading…
Cancel
Save