Bläddra i källkod

Query: 41933 & Query: 41932

master
George Williams 5 år sedan
förälder
incheckning
05fe36dbdf

+ 54
- 2
package-lock.json Visa fil

3731
     "deep-equal": {
3731
     "deep-equal": {
3732
       "version": "1.0.1",
3732
       "version": "1.0.1",
3733
       "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
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
     "deep-is": {
3736
     "deep-is": {
3738
       "version": "0.1.3",
3737
       "version": "0.1.3",
5020
       "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
5019
       "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
5021
       "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
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
     "fast-glob": {
5027
     "fast-glob": {
5024
       "version": "2.2.7",
5028
       "version": "2.2.7",
5025
       "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz",
5029
       "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz",
8492
         "no-case": "^2.2.0"
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
     "parent-module": {
8504
     "parent-module": {
8496
       "version": "1.0.1",
8505
       "version": "1.0.1",
8497
       "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
8506
       "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
9450
       "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
9459
       "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
9451
       "dev": true
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
     "randombytes": {
9497
     "randombytes": {
9454
       "version": "2.1.0",
9498
       "version": "2.1.0",
9455
       "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
9499
       "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
11892
         "trix": "^1.1.1"
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
     "vuetify": {
11947
     "vuetify": {
11896
       "version": "1.5.16",
11948
       "version": "1.5.16",
11897
       "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-1.5.16.tgz",
11949
       "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-1.5.16.tgz",

+ 1
- 0
package.json Visa fil

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

Binär
public/img/no-homes.png Visa fil


Binär
public/img/propertyListings.png Visa fil


+ 63
- 61
src/components/property/propertyCard.vue Visa fil

23
     </div>
23
     </div>
24
     <div class="form-group row">
24
     <div class="form-group row">
25
       <div class="col-md-4" v-for="currentProperty in properties" :key="currentProperty.id">
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
                   <router-link :to="`/property/property/${currentProperty.id}`" class="link-a">
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
                   </router-link>
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
                 </div>
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
               </div>
91
               </div>
90
             </div>
92
             </div>
91
           </div>
93
           </div>
92
-        </div>
94
+        </router-link>
93
         <br />
95
         <br />
94
       </div>
96
       </div>
95
     </div>
97
     </div>

+ 1
- 0
src/components/property/propertyImage.vue Visa fil

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

+ 30
- 24
src/components/property/propertyList.vue Visa fil

12
           <div class="col-md-12 col-lg-8">
12
           <div class="col-md-12 col-lg-8">
13
             <div class="title-box-d">
13
             <div class="title-box-d">
14
               <h1
14
               <h1
15
-                v-if="user !== 'All'"
15
+                v-if="showAdmin"
16
                 class="title-d"
16
                 class="title-d"
17
                 style="text-align:left; font-size: 250%"
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
             </div>
20
             </div>
25
           </div>
21
           </div>
26
         </div>
22
         </div>
35
             <th>Property ID</th>
31
             <th>Property ID</th>
36
             <th>Size</th>
32
             <th>Size</th>
37
             <th>Price</th>
33
             <th>Price</th>
34
+            <th>Usage Type</th>
38
             <th>Type</th>
35
             <th>Type</th>
36
+            <th>Sale Type</th>
39
             <th>Publish</th>
37
             <th>Publish</th>
40
             <th>Status</th>
38
             <th>Status</th>
41
             <th></th>
39
             <th></th>
48
             <td>{{ item.id }}</td>
46
             <td>{{ item.id }}</td>
49
             <td v-html="item.size" />
47
             <td v-html="item.size" />
50
             <td>{{ item.price }}</td>
48
             <td>{{ item.price }}</td>
49
+            <td>{{ item.usageType }}</td>
51
             <td>{{ item.type }}</td>
50
             <td>{{ item.type }}</td>
51
+            <td>{{ item.saleType }}</td>
52
             <!-- <td>{{ item.publish }}</td> -->
52
             <!-- <td>{{ item.publish }}</td> -->
53
             <td></td>
53
             <td></td>
54
             <td>{{ item.status }}</td>
54
             <td>{{ item.status }}</td>
58
                 @click="Edit(item)"
58
                 @click="Edit(item)"
59
                 class="btn btn-b-n"
59
                 class="btn btn-b-n"
60
                 style="width: 85px; height:40px;"
60
                 style="width: 85px; height:40px;"
61
-                disabled
62
               >Edit</button>
61
               >Edit</button>
63
             </td>
62
             </td>
64
             <td>
63
             <td>
86
     return {
85
     return {
87
       propertyType: '',
86
       propertyType: '',
88
       user: '',
87
       user: '',
88
+      showAdmin: false,
89
     };
89
     };
90
   },
90
   },
91
   methods: {
91
   methods: {
99
     },
99
     },
100
   },
100
   },
101
   mounted() {
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
     this.getProperties(
112
     this.getProperties(
110
       Object.assign(
113
       Object.assign(
111
         {},
114
         {},
112
         {
115
         {
113
-          propertyType: this.propertyType,
116
+          propertyType: this.showAdmin ? 'Admin' : 'My',
114
           user: this.user,
117
           user: this.user,
115
         },
118
         },
116
       ),
119
       ),
118
   },
121
   },
119
   computed: {
122
   computed: {
120
     ...mapState('propertyList', ['properties']),
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
       this.getProperties(
132
       this.getProperties(
127
         Object.assign(
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
   watch: {
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 Visa fil

127
                             name="MakeOffer"
127
                             name="MakeOffer"
128
                             :isMakeOffer="true"
128
                             :isMakeOffer="true"
129
                             :isProperty="true"
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
                         </div>
132
                         </div>
133
                       </div>
133
                       </div>

+ 26
- 10
src/components/property/propertySearchPage.vue Visa fil

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

+ 48
- 16
src/components/property/propertyeditPage.vue Visa fil

3
   <div>
3
   <div>
4
     <div class="container">
4
     <div class="container">
5
       <div class="col-sm-12">
5
       <div class="col-sm-12">
6
+        <br />
6
         <div class="tobuy-img-box">
7
         <div class="tobuy-img-box">
7
           <img
8
           <img
8
             v-if="propertyType === 'Commercial'"
9
             v-if="propertyType === 'Commercial'"
34
       <div class="row mb-3">
35
       <div class="row mb-3">
35
         <div class="container col-md-10" style="text-align:left">
36
         <div class="container col-md-10" style="text-align:left">
36
           <form id="mainForm">
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
             <div class="form-group row">
58
             <div class="form-group row">
38
               <div class="col-md-4">
59
               <div class="col-md-4">
39
                 <label>Property Type</label>
60
                 <label>Property Type</label>
240
             <div class="form-group row">
261
             <div class="form-group row">
241
               <div class="col-md-12">
262
               <div class="col-md-12">
242
                 <label for="Property Description">Description</label>
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
                 <br />
265
                 <br />
250
                 <p>* A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate website</p>
266
                 <p>* A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate website</p>
251
               </div>
267
               </div>
258
               :id="1"
274
               :id="1"
259
             ></UserField>
275
             ></UserField>
260
             <div class="form-group row" />
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
               <div class="row">
278
               <div class="row">
263
                 <div class="col-sm-12">
279
                 <div class="col-sm-12">
264
                   <div class="title-box-d">
280
                   <div class="title-box-d">
302
 
318
 
303
 <script>
319
 <script>
304
 import { mapState, mapActions } from 'vuex';
320
 import { mapState, mapActions } from 'vuex';
305
-import TextEditor from 'vue-trix';
321
+import { VueEditor } from 'vue2-editor';
306
 import { setTimeout } from 'timers';
322
 import { setTimeout } from 'timers';
307
 import UserField from './propertyUserField.vue';
323
 import UserField from './propertyUserField.vue';
308
 import ImageLoad from './propertyImage.vue';
324
 import ImageLoad from './propertyImage.vue';
312
   components: {
328
   components: {
313
     UserField,
329
     UserField,
314
     ImageLoad,
330
     ImageLoad,
315
-    TextEditor,
331
+    VueEditor,
316
   },
332
   },
317
   data() {
333
   data() {
318
     return {
334
     return {
324
       propertyFieldValues: [],
340
       propertyFieldValues: [],
325
       defaultImage: 0,
341
       defaultImage: 0,
326
       wait: false,
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
   methods: {
358
   methods: {
342
       'getPropertySavedFields',
371
       'getPropertySavedFields',
343
       'getSavedPropertyData',
372
       'getSavedPropertyData',
344
     ]),
373
     ]),
374
+    TypeChanged() {},
345
     SubmitData() {
375
     SubmitData() {
346
       this.wait = true;
376
       this.wait = true;
347
       if (this.salesType === 'Sale') {
377
       if (this.salesType === 'Sale') {
363
 
393
 
364
       setTimeout(
394
       setTimeout(
365
         () => this.$router.push({
395
         () => this.$router.push({
366
-            path: '/property/search',
396
+            path: '/property/Search',
367
             query: {
397
             query: {
368
               salesType: this.salesType,
398
               salesType: this.salesType,
369
               propertyUsageType: this.propertyType,
399
               propertyUsageType: this.propertyType,
434
       this.property.description = '';
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
     this.salesType = this.$route.params.saleType;
470
     this.salesType = this.$route.params.saleType;
439
 
471
 
440
-    this.getPropertyTypes(this.$route.params.propType);
472
+    this.getPropertyTypes(this.propertyType);
441
 
473
 
442
     this.getProvince();
474
     this.getProvince();
443
     if (this.$route.query.id) {
475
     if (this.$route.query.id) {
447
       );
479
       );
448
     } else {
480
     } else {
449
       this.getPropertyOverviewFields();
481
       this.getPropertyOverviewFields();
450
-      this.getPropertyFields(this.$route.params.propType);
482
+      this.getPropertyFields(this.propertyType);
451
     }
483
     }
452
     // if (this.$route.params.id) {
484
     // if (this.$route.params.id) {
453
     //   this.getPropertyEditDisplay(4); // (this.$route.params.id);
485
     //   this.getPropertyEditDisplay(4); // (this.$route.params.id);
483
     ]),
515
     ]),
484
     SalesTypeChanged() {
516
     SalesTypeChanged() {
485
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
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
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
519
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
488
       this.salesType = this.$route.params.saleType;
520
       this.salesType = this.$route.params.saleType;
489
       if (!this.$route.query.id) {
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
       return this.propertyType;
526
       return this.propertyType;

+ 8
- 27
src/components/shared/navBar.vue Visa fil

81
               <div class="dropdown-menu" aria-labelledby="navbarDropdown">
81
               <div class="dropdown-menu" aria-labelledby="navbarDropdown">
82
                 <a
82
                 <a
83
                   class="dropdown-item cursor-pointer"
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
                 <a
86
                 <a
87
                   class="dropdown-item cursor-pointer"
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
                 <a
90
                 <a
105
                   class="dropdown-item cursor-pointer"
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
                 <hr v-if="showLogout" />
94
                 <hr v-if="showLogout" />
109
                 <a
95
                 <a
110
                   v-if="showLogout"
96
                   v-if="showLogout"
111
                   class="dropdown-item cursor-pointer"
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
               </div>
100
               </div>
120
             </li>
101
             </li>
121
 
102
 

+ 8
- 3
src/router/index.js Visa fil

114
       component: PropertySearch,
114
       component: PropertySearch,
115
     },
115
     },
116
     {
116
     {
117
-      path: '/property/:propType/:saleType',
117
+      path: '/property/new/:saleType',
118
       name: 'PropertyNew',
118
       name: 'PropertyNew',
119
       component: PropertyEdit,
119
       component: PropertyEdit,
120
     },
120
     },
121
+    {
122
+      path: '/property/new/:propertyUsageType/:saleType',
123
+      name: 'PropertyNewFromSearch',
124
+      component: PropertyEdit,
125
+    },
121
     {
126
     {
122
       path: '/property/edit/:id/:propType/:saleType',
127
       path: '/property/edit/:id/:propType/:saleType',
123
       name: 'PropertyEdit',
128
       name: 'PropertyEdit',
124
       component: PropertyEdit,
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
       component: PropertyList,
134
       component: PropertyList,
130
     },
135
     },
131
     {
136
     {

+ 2
- 1
src/store/modules/property/propertyLists.js Visa fil

13
   getters: {},
13
   getters: {},
14
   actions: {
14
   actions: {
15
     getProperties({ commit }, item) {
15
     getProperties({ commit }, item) {
16
+      console.log(`/api/property/${item.propertyType}/${item.user}`);
16
       axios
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
         .then(result => commit('setProperties', result.data))
19
         .then(result => commit('setProperties', result.data))
19
         .catch(console.error);
20
         .catch(console.error);
20
     },
21
     },

+ 0
- 56
src/store/modules/property/propertySearch.js Visa fil

35
       state.propertySearch[filter] = 'All';
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
   actions: {
38
   actions: {
95
     clearFilter({ commit }, filter) {
39
     clearFilter({ commit }, filter) {
96
       commit('onClearFilter', filter);
40
       commit('onClearFilter', filter);

Laddar…
Avbryt
Spara