ソースを参照

Merge branch 'master' into master

master
George Williams 4年前
コミット
badbfdbae7

+ 5
- 0
package-lock.json ファイルの表示

@@ -12315,6 +12315,11 @@
12315 12315
       "integrity": "sha512-TigfiZUs7SN3Z6uxKilqJUtYxte8vp0F4QxabCli6hkKPqU97JzAZc3P7AL6omkRAd2DMI26fOrIGjuALTvXww==",
12316 12316
       "dev": true
12317 12317
     },
12318
+    "vue-currency-input": {
12319
+      "version": "1.22.3",
12320
+      "resolved": "https://registry.npmjs.org/vue-currency-input/-/vue-currency-input-1.22.3.tgz",
12321
+      "integrity": "sha512-vrOaaiCSG8Hh7Fw7CYROIymFvVprWKaze3h67sihqJ4QAI9F+YElTQYv0fJwFK1NkKUS8H/MvAL0mwg9qrUfgg=="
12322
+    },
12318 12323
     "vue-disable-autocomplete": {
12319 12324
       "version": "0.0.4",
12320 12325
       "resolved": "https://registry.npmjs.org/vue-disable-autocomplete/-/vue-disable-autocomplete-0.0.4.tgz",

+ 1
- 0
package.json ファイルの表示

@@ -28,6 +28,7 @@
28 28
     "v-file-upload": "^3.1.7",
29 29
     "vue": "^2.6.11",
30 30
     "vue-carousel": "^0.18.0",
31
+    "vue-currency-input": "^1.22.3",
31 32
     "vue-disable-autocomplete": "0.0.4",
32 33
     "vue-eva-icons": "^1.1.1",
33 34
     "vue-js-modal": "^1.3.33",

+ 22
- 0
src/components/admin/fees/feesPage.vue ファイルの表示

@@ -0,0 +1,22 @@
1
+<template>
2
+  <main id="main" style="padding-top:50px; padding-bottom:100px">
3
+    <div class="container">
4
+      <div class="section-header">
5
+        <h2>Fees</h2>
6
+      </div>
7
+      <listingFee />
8
+    </div>
9
+  </main>
10
+</template>
11
+
12
+<script>
13
+/* eslint-disable */
14
+import listingFee from "./listingFee";
15
+export default {
16
+  components: {
17
+    listingFee
18
+  }
19
+};
20
+</script>
21
+
22
+<style lang="scss" scoped></style>

+ 53
- 0
src/components/admin/fees/listingFee.vue ファイルの表示

@@ -0,0 +1,53 @@
1
+<template>
2
+  <section id="content">
3
+    <label for="fee" class="uniLabel">LISTING FEE</label>
4
+    <currency-input
5
+      onClick="this.setSelectionRange(0, this.value.length)"
6
+      name="fee"
7
+      :value="value"
8
+      @input="value = $event"
9
+      v-model="fee"
10
+      id="price"
11
+      class="form-control uniInput"
12
+    />
13
+    <button @click="saveListingFee" class="btn-solid-blue mt-4">Save</button>
14
+  </section>
15
+</template>
16
+
17
+<script>
18
+/* eslint-disable */
19
+import { mapActions, mapGetters, mapState } from "vuex";
20
+export default {
21
+  data() {
22
+    return {
23
+      fee: 0.0
24
+    };
25
+  },
26
+  mounted() {
27
+    this.pullListingFee();
28
+  },
29
+  methods: {
30
+    ...mapActions("fees", ["retrieveListingFee", "setListingFee"]),
31
+    saveListingFee() {
32
+      var feeObj = {
33
+        amount: parseFloat(this.fee),
34
+        name: "Listing Fee"
35
+      };
36
+
37
+      this.setListingFee(feeObj);
38
+    },
39
+    async pullListingFee() {
40
+      await this.retrieveListingFee();
41
+      console.log(this.getListingFee);
42
+
43
+      this.fee = this.getListingFee.amount;
44
+    }
45
+  },
46
+  computed: {
47
+    ...mapGetters("fees", ["getListingFee"]),
48
+    ...mapState("fees", ["listingFee"])
49
+  }
50
+};
51
+</script>
52
+
53
+<style lang="scss" scoped></style>

+ 27
- 25
src/components/admin/property/userDefinedGroupPage.vue ファイルの表示

@@ -124,21 +124,21 @@
124 124
 </template>
125 125
 
126 126
 <script>
127
-import { mapState, mapActions } from 'vuex';
128
-import userFields from './userDefinedField.vue';
129
-import listView from '../../shared/listView.vue';
127
+import { mapState, mapActions } from "vuex";
128
+import userFields from "./userDefinedField.vue";
129
+import listView from "../../shared/listView.vue";
130 130
 
131 131
 export default {
132
-  name: 'UserDefinedGroup',
132
+  name: "UserDefinedGroup",
133 133
   components: {
134 134
     userFields,
135
-    listView,
135
+    listView
136 136
   },
137 137
   data() {
138 138
     return {
139 139
       item: {},
140 140
       showField: false,
141
-      columns: ['fieldName', 'fieldType', 'rank'],
141
+      columns: ["fieldName", "fieldType", "rank"]
142 142
     };
143 143
   },
144 144
   mounted() {
@@ -151,27 +151,27 @@ export default {
151 151
     }
152 152
   },
153 153
   computed: {
154
-    ...mapState('propertyAdmin', ['userDefinedGroup', 'userFields', 'userField']),
154
+    ...mapState("propertyAdmin", ["userDefinedGroup", "userFields", "userField"])
155 155
   },
156 156
   methods: {
157
-    ...mapActions('propertyAdmin', [
158
-      'getUserDefinedGroup',
159
-      'getUserFields',
160
-      'saveUserDefinedGroup',
161
-      'updateUserDefinedGroup',
162
-      'clearUserGroup',
163
-      'clearUserFields',
164
-      'clearUserField',
165
-      'saveUserField',
166
-      'updateUserField',
167
-      'deleteUserField',
157
+    ...mapActions("propertyAdmin", [
158
+      "getUserDefinedGroup",
159
+      "getUserFields",
160
+      "saveUserDefinedGroup",
161
+      "updateUserDefinedGroup",
162
+      "clearUserGroup",
163
+      "clearUserFields",
164
+      "clearUserField",
165
+      "saveUserField",
166
+      "updateUserField",
167
+      "deleteUserField"
168 168
     ]),
169 169
     SubmitData() {
170 170
       this.userDefinedGroup.fields = [];
171 171
       let reload = false;
172 172
       if (this.$route.params.id > 0) {
173 173
         this.updateUserDefinedGroup(this.userDefinedGroup);
174
-        this.userFields.forEach((fieldData) => {
174
+        this.userFields.forEach(fieldData => {
175 175
           if (fieldData.id === 0) {
176 176
             fieldData.groupId = this.userDefinedGroup.id;
177 177
             this.saveUserField(fieldData);
@@ -181,16 +181,16 @@ export default {
181 181
         });
182 182
       } else {
183 183
         reload = true;
184
-        this.userFields.forEach((fieldData) => {
184
+        this.userFields.forEach(fieldData => {
185 185
           this.userDefinedGroup.fields.push({
186 186
             fieldName: fieldData.fieldName,
187 187
             fieldType: fieldData.fieldType,
188
-            rank: fieldData.rank,
188
+            rank: fieldData.rank
189 189
           });
190 190
         });
191 191
         this.saveUserDefinedGroup(this.userDefinedGroup);
192 192
       }
193
-      this.$router.push('/userDefinedGroups/list');
193
+      this.$router.push("/userDefinedGroups/list");
194 194
       // this.$router.push({
195 195
       //   path: '/userDefinedGroups/list',
196 196
       //   query: { reload },
@@ -207,7 +207,7 @@ export default {
207 207
       this.showField = true;
208 208
     },
209 209
     Close() {
210
-      this.$router.push('/userDefinedGroups/list');
210
+      this.$router.push("/userDefinedGroups/list");
211 211
     },
212 212
     UpdateUserField(item) {
213 213
       if (item.id === 0) {
@@ -216,12 +216,14 @@ export default {
216 216
       this.showField = false;
217 217
     },
218 218
     Delete(item) {
219
+      console.log(item);
220
+
219 221
       if (item.id === 0) {
220 222
         this.userFields.pop(this.userFields.find(p => p.id === item.id));
221 223
       } else {
222 224
         this.deleteUserField(item.id);
223 225
       }
224
-    },
225
-  },
226
+    }
227
+  }
226 228
 };
227 229
 </script>

+ 6
- 32
src/components/misc/bondCaclculator.vue ファイルの表示

@@ -6,19 +6,19 @@
6 6
       type="text"
7 7
       class="form-control mb-2"
8 8
       name="income"
9
+      v-currency="{ currency: ['ZAR', null, { prefix: 'R' }][2] }"
9 10
       id="gross-income"
10 11
       placeholder="Gross Monthly Household Income"
11 12
       v-model="amount"
12
-      @input="displayValue()"
13 13
     />
14 14
     <input
15 15
       type="text"
16 16
       class="form-control mb-2"
17 17
       name="deposit"
18
+      v-currency="{ currency: ['ZAR', null, { prefix: 'R' }][2] }"
18 19
       id="deposit"
19 20
       placeholder="Deposit Amount – May be Required"
20 21
       v-model="deposit"
21
-      @input="displayDeposit()"
22 22
     />
23 23
     <div class="slidecontainer mt-4">
24 24
       <input type="range" min="5" max="30" value="10" class="slider" id="myRange" v-model="term" />
@@ -60,8 +60,8 @@
60 60
 export default {
61 61
   data() {
62 62
     return {
63
-      amount: "R1000000",
64
-      deposit: "R0",
63
+      amount: 1000000,
64
+      deposit: 0,
65 65
       term: 10,
66 66
       rate: 7,
67 67
       isInputActive: false
@@ -70,34 +70,12 @@ export default {
70 70
   props: ["value"],
71 71
   methods: {
72 72
     calculate() {
73
-      var rate = this.calcRate();
73
+      var rate = this.rate / 100 / 12;
74 74
       var years = this.term * 12;
75 75
       var topPart = rate * Math.pow(1 + rate, years);
76 76
       var bottomPart = Math.pow(1 + rate, years) - 1;
77 77
       var netAmnt = this.amount - this.deposit;
78 78
       var bond = (netAmnt * topPart) / bottomPart;
79
-    },
80
-    calcRate() {
81
-      var answer = this.rate / 100 / 12;
82
-      return answer;
83
-    },
84
-    displayValue() {
85
-      const formatter = new Intl.NumberFormat("en-US", {
86
-        minimumFractionDigits: 2
87
-      });
88
-      if (this.amount.charAt(0) !== "R") {
89
-        this.amount = "R" + formatter.format(this.amount);
90
-        if (this.amount < 1) {
91
-          this.amount = "R" + 0;
92
-        }
93
-      }
94
-    },
95
-    displayDeposit() {
96
-      if (this.deposit.charAt(0) !== "R") {
97
-        if (this.deposit < 1) {
98
-          this.deposit = "R" + 0;
99
-        }
100
-      }
101 79
     }
102 80
   },
103 81
   computed: {
@@ -107,7 +85,7 @@ export default {
107 85
       var topPart = rate * Math.pow(1 + rate, years);
108 86
       var bottomPart = Math.pow(1 + rate, years) - 1;
109 87
 
110
-      var netAmnt = parseFloat(this.amount.substring(1)) - parseFloat(this.deposit.substring(1));
88
+      var netAmnt = parseFloat(this.amount) - parseFloat(this.deposit);
111 89
       var bond = (netAmnt * topPart) / bottomPart;
112 90
       if (isNaN(bond)) {
113 91
         return 0;
@@ -115,10 +93,6 @@ export default {
115 93
         return bond;
116 94
       }
117 95
     },
118
-    calcRate() {
119
-      var answer = this.rate / 100 / 12;
120
-      return answer;
121
-    },
122 96
     grossIncome() {
123 97
       return this.totalMonthlyPayment * 3.335120643;
124 98
     }

+ 1
- 1
src/components/property/ListProperty/contentSection.vue ファイルの表示

@@ -9,7 +9,7 @@
9 9
         <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
10 10
           <li class="nav-item">
11 11
             <a
12
-              class="nav-link btn-solid-blue"
12
+              class="nav-link btn-solid-blue active"
13 13
               id="pills-residential-tab"
14 14
               data-toggle="pill"
15 15
               href="#pills-residential"

+ 4
- 1
src/components/property/commercial/commercialSearchResults.vue ファイルの表示

@@ -17,7 +17,10 @@
17 17
               <div class="portfolio-item">
18 18
                 <img style="width:255px; height:255px" :src="currentProperty.displayImage" alt />
19 19
                 <h4>{{ currentProperty.displayPrice }}</h4>
20
-                <p>Address | 00m</p>
20
+                <p>
21
+                  {{ currentProperty.suburb }}, {{ currentProperty.city }} |
22
+                  {{ currentProperty.area }}M<sup>2</sup>
23
+                </p>
21 24
                 <p>{{ currentProperty.shortDescription }}</p>
22 25
                 <br />
23 26
 

+ 162
- 27
src/components/property/commercial/createProperty/commercialCreateNew.vue ファイルの表示

@@ -84,12 +84,14 @@
84 84
                     >{{ salesType }} Price</label
85 85
                   >
86 86
                 </div>
87
-                <input
88
-                  class="form-control uniInput"
89
-                  type="number"
87
+                <currency-input
88
+                  onClick="this.setSelectionRange(0, this.value.length)"
90 89
                   name="price"
91
-                  id="price"
90
+                  :value="value"
91
+                  @input="value = $event"
92 92
                   v-model="property.price"
93
+                  id="price"
94
+                  class="form-control uniInput"
93 95
                 />
94 96
               </div>
95 97
               <div v-if="salesType === 'Rental'" class="col-md-6">
@@ -115,35 +117,145 @@
115 117
                 />
116 118
               </div>
117 119
             </div>
118
-            <div class="row">
120
+            <div class="row my-3">
121
+              <br />
122
+            </div>
123
+            <div class="row my-3">
124
+              <div class="col-md-12">
125
+                <div v-if="!property.streetNumber">
126
+                  <label for="streetNumber" class="uniSelectLabel">STREET NUMBER</label>
127
+                </div>
128
+                <input
129
+                  class="form-control uniInput"
130
+                  type="text"
131
+                  name="streetNumber"
132
+                  id="unit"
133
+                  v-model="property.streetNumber"
134
+                  disabled
135
+                />
136
+              </div>
137
+            </div>
138
+            <div class="row my-3">
139
+              <div class="col-md-12">
140
+                <div v-if="!property.streetName">
141
+                  <label for="streetName" class="uniSelectLabel">STREET NAME</label>
142
+                </div>
143
+                <input
144
+                  class="form-control uniInput"
145
+                  type="text"
146
+                  name="streetName"
147
+                  id="unit"
148
+                  v-model="property.streetName"
149
+                  disabled
150
+                />
151
+              </div>
152
+            </div>
153
+            <div class="row my-3">
154
+              <div class="col-md-12">
155
+                <div v-if="!property.suburb">
156
+                  <label for="suburb" class="uniSelectLabel">SUBURB</label>
157
+                </div>
158
+                <input
159
+                  class="form-control uniInput"
160
+                  type="text"
161
+                  name="suburb"
162
+                  id="unit"
163
+                  v-model="property.suburb"
164
+                  disabled
165
+                />
166
+              </div>
167
+            </div>
168
+            <div class="row my-3">
169
+              <div class="col-md-12">
170
+                <div v-if="!property.city">
171
+                  <label for="city" class="uniSelectLabel">CITY</label>
172
+                </div>
173
+                <input
174
+                  class="form-control uniInput"
175
+                  type="text"
176
+                  name="city"
177
+                  id="unit"
178
+                  v-model="property.city"
179
+                  disabled
180
+                />
181
+              </div>
182
+            </div>
183
+            <div class="row my-3">
184
+              <div class="col-md-12">
185
+                <div v-if="!property.province">
186
+                  <label for="province" class="uniSelectLabel">PROVINCE</label>
187
+                </div>
188
+                <input
189
+                  class="form-control uniInput"
190
+                  type="text"
191
+                  name="province"
192
+                  id="unit"
193
+                  v-model="property.province"
194
+                  disabled
195
+                />
196
+              </div>
197
+            </div>
198
+            <div class="row my-3">
119 199
               <div class="col-md-12">
120
-                <label for="Property Description" style="font-family:'muli'">Description:</label>
121
-                <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
122
-                <br />
123
-                <p>
124
-                  * A listing fee of R380 including VAT is payable to list your Property on the
125
-                  Uni-Vate website
126
-                </p>
200
+                <div v-if="!property.postalCode">
201
+                  <label for="postalCode" class="uniSelectLabel">POSTAL CODE</label>
202
+                </div>
203
+                <input
204
+                  class="form-control uniInput"
205
+                  type="text"
206
+                  name="postalCode"
207
+                  id="unit"
208
+                  v-model="property.postalCode"
209
+                  disabled
210
+                />
211
+              </div>
212
+            </div>
213
+            <div class="row my-3">
214
+              <div class="col-md-12">
215
+                <div v-if="!property.country">
216
+                  <label for="country" class="uniSelectLabel">COUNTRY</label>
217
+                </div>
218
+                <input
219
+                  class="form-control uniInput"
220
+                  type="text"
221
+                  name="country"
222
+                  id="unit"
223
+                  v-model="property.country"
224
+                  disabled
225
+                />
226
+              </div>
227
+            </div>
228
+            <div class="row my-3">
229
+              <div class="col-md-12">
230
+                <button type="button" @click="clearAddress()" class="btn-solid-blue">
231
+                  Clear Address
232
+                </button>
127 233
               </div>
128 234
             </div>
129 235
           </div>
130 236
         </div>
131
-        <div class="row" />
132
-
237
+        <div class="row">
238
+          <div class="col-md-12">
239
+            <label for="Property Description" style="font-family:'muli'">Description:</label>
240
+            <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
241
+            <br />
242
+            <p>
243
+              * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
244
+              Property on the Uni-Vate website
245
+            </p>
246
+          </div>
247
+        </div>
133 248
         <div class="section-header">
134 249
           <h2>Property Information</h2>
135 250
         </div>
136
-        <div class="row mb-3" v-for="item in propertyFields" :key="item.id">
137
-          <div class="col-md-6" v-for="field in item.fields" :key="field.id">
138
-            <div v-if="field.type === 'number'">
139
-              {{ field.name }}
140
-              <input type="number" class="form-control uniInput" v-model="field.value" />
141
-            </div>
142
-            <div v-else class="display:none"></div>
143
-            <div v-if="field.type === 'yesno'">
144
-              {{ field.name }}
145
-              <input type="checkbox" v-model="field.value" />
146
-            </div>
251
+        <div v-for="item in propertyFields" :key="item.id">
252
+          <div v-if="item.name === 'Commercial Fields'">
253
+            <UserField
254
+              :fields="item.fields"
255
+              :id="item.name"
256
+              @UpdateUserDefinedFields="UpdateUserDefinedFields"
257
+              :fieldValues="item.fields"
258
+            />
147 259
           </div>
148 260
         </div>
149 261
         <div class="row">
@@ -211,7 +323,7 @@
211 323
 
212 324
 <script>
213 325
 /* eslint-disable */
214
-import { mapState, mapActions } from "vuex";
326
+import { mapState, mapActions, mapGetters } from "vuex";
215 327
 import { VueEditor } from "vue2-editor";
216 328
 import UserField from "../../propertyUserField.vue";
217 329
 import ImageLoad from "../../propertyImage.vue";
@@ -319,9 +431,19 @@ export default {
319 431
         this.property.userId = this.user.id;
320 432
       }
321 433
 
434
+      this.property.propertyUserFields.forEach(item => {
435
+        if (item.value === true) {
436
+          item.value = "yes";
437
+        } else if (item.value === false) {
438
+          item.value = "no";
439
+        }
440
+      });
441
+
442
+      console.log(this.property);
443
+
322 444
       this.saveProperty(this.property)
323 445
         .then(fulfilled => {
324
-          this.$router.push(`/property/residential/property/${fulfilled.data.id}`);
446
+          this.$router.push(`/property/commercial/property/${fulfilled.data.id}`);
325 447
         })
326 448
         .catch(error => {
327 449
           console.log(error.message);
@@ -357,6 +479,18 @@ export default {
357 479
     },
358 480
     UpdateDefaultImage(item) {
359 481
       this.defaultImage = item;
482
+    },
483
+    clearAddress() {
484
+      this.addressSet = false;
485
+      this.property.streetNumber = undefined;
486
+      this.property.streetName = undefined;
487
+      this.property.suburb = undefined;
488
+      this.property.city = undefined;
489
+      this.property.province = undefined;
490
+      this.property.country = undefined;
491
+      this.property.postalCode = undefined;
492
+      this.property.addressUrl = undefined;
493
+      this.property.propertCoords = undefined;
360 494
     }
361 495
   },
362 496
   mounted() {
@@ -393,6 +527,7 @@ export default {
393 527
       "propertyImages"
394 528
     ]),
395 529
     ...mapState("authentication", ["user"]),
530
+    ...mapGetters("fees", ["getListingFee"]),
396 531
     SalesTypeChanged() {
397 532
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
398 533
       // this.propertyType = this.$route.params.propType;

+ 8
- 2
src/components/property/commercial/singleView/contentSection.vue ファイルの表示

@@ -36,7 +36,13 @@
36 36
           <div class="panel-left p-5" style="margin-top:140px;">
37 37
             <h2>Property Detial</h2>
38 38
             <p v-if="property.showAddress">{{ property.streetNumber }} {{ property.streetName }}</p>
39
-            <p>{{ property.suburb }}, {{ property.city }}</p>
39
+            <p>{{ property.city }}, {{ property.suburb }}</p>
40
+            <div v-for="field in property.displayData[0].values" :key="field.id">
41
+              <p v-if="field.name === 'Floor Size'">{{ field.value }}M<sup>2</sup></p>
42
+              <p v-if="field.name === 'Rates & Taxes'">
43
+                Rates & Taxes: R{{ field.value | toCurrency }}
44
+              </p>
45
+            </div>
40 46
             <p>{{ property.shortDescription }}</p>
41 47
             <p>{{ property.price | toCurrency }}</p>
42 48
             <div class="btn-white-border"><i class="fa fa-search"></i>BOOK A VIEWING</div>
@@ -68,7 +74,7 @@
68 74
             </div>
69 75
             {{ property.streetNumber }} {{ property.streetName }}
70 76
           </h2>
71
-          <h2>{{ property.propertyName }}</h2>
77
+          <h2 v-else>{{ property.propertyName }}</h2>
72 78
           <p>{{ property.shortDescription }}</p>
73 79
           <h4>Property Features</h4>
74 80
           <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">

+ 13
- 18
src/components/property/mapSection.vue ファイルの表示

@@ -1,6 +1,8 @@
1 1
 <template>
2 2
   <div>
3
-    <gmap-autocomplete class="form-control mb-3 uniInput" @place_changed="setPlace">*</gmap-autocomplete>
3
+    <gmap-autocomplete class="form-control mb-3 uniInput" @place_changed="setPlace"
4
+      >*</gmap-autocomplete
5
+    >
4 6
     <GmapMap
5 7
       :center="mapCenter"
6 8
       :zoom="mapZoom"
@@ -18,10 +20,10 @@
18 20
 import { gmapApi } from "vue2-google-maps";
19 21
 export default {
20 22
   computed: {
21
-    google: gmapApi,
23
+    google: gmapApi
22 24
   },
23 25
   props: {
24
-    savedCoords: { default: "" },
26
+    savedCoords: { default: "" }
25 27
   },
26 28
   data() {
27 29
     return {
@@ -36,7 +38,7 @@ export default {
36 38
       country: "",
37 39
       postalCode: "",
38 40
       url: "",
39
-      coords: {},
41
+      coords: {}
40 42
     };
41 43
   },
42 44
 
@@ -68,9 +70,7 @@ export default {
68 70
         if (place.address_components[i].types[0] === "locality") {
69 71
           this.city = place.address_components[i].long_name;
70 72
         }
71
-        if (
72
-          place.address_components[i].types[0] === "administrative_area_level_1"
73
-        ) {
73
+        if (place.address_components[i].types[0] === "administrative_area_level_1") {
74 74
           this.province = place.address_components[i].long_name;
75 75
         }
76 76
         if (place.address_components[i].types[0] === "country") {
@@ -82,10 +82,6 @@ export default {
82 82
         this.url = place.url;
83 83
       }
84 84
 
85
-      var coords =
86
-        place.geometry.viewport.Za.j + "," + place.geometry.viewport.Va.j;
87
-      this.coords = coords;
88
-
89 85
       this.$emit("map-location", {
90 86
         streetNumber: this.streetNumber,
91 87
         streetName: this.streetName,
@@ -94,10 +90,9 @@ export default {
94 90
         province: this.province,
95 91
         country: this.country,
96 92
         postalCode: this.postalCode,
97
-        url: this.url,
98
-        coords: this.coords,
93
+        url: this.url
99 94
       });
100
-    },
95
+    }
101 96
   },
102 97
   watch: {
103 98
     savedCoords: {
@@ -107,13 +102,13 @@ export default {
107 102
           var array = val.split(",");
108 103
           this.mapCenter = {
109 104
             lat: Number(array[0]),
110
-            lng: Number(array[1]),
105
+            lng: Number(array[1])
111 106
           };
112 107
           this.mapZoom = 17;
113 108
         }
114
-      },
115
-    },
116
-  },
109
+      }
110
+    }
111
+  }
117 112
 };
118 113
 </script>
119 114
 

+ 11
- 3
src/components/property/propertyCard.vue ファイルの表示

@@ -3,7 +3,7 @@
3 3
     <div class="container-fluid">
4 4
       <div class="row">
5 5
         <div
6
-          class="col-lg-3 col-md-6 col-sm-6"
6
+          class="col-lg-3 col-md-6 col-sm-6 my-3"
7 7
           v-for="currentProperty in properties"
8 8
           :key="currentProperty.id"
9 9
         >
@@ -12,7 +12,11 @@
12 12
               <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
13 13
                 <div class="feature-top pt-3 mb-2">
14 14
                   <h3>{{ currentProperty.displayPrice }}</h3>
15
-                  <img :src="currentProperty.displayImage" alt="" />
15
+                  <img
16
+                    style="max-height:165px; object-fit: cover;"
17
+                    :src="currentProperty.displayImage"
18
+                    alt=""
19
+                  />
16 20
                 </div>
17 21
                 <h1>{{ currentProperty.suburb }}</h1>
18 22
                 <p><strong>Property Reference</strong> #{{ currentProperty.id }}</p>
@@ -24,7 +28,11 @@
24 28
               <div class="portfolio-item p-4 wow fadeInUp justify-content-md-center">
25 29
                 <div class="feature-top pt-3 mb-2">
26 30
                   <h3>{{ currentProperty.displayPrice }}</h3>
27
-                  <img :src="currentProperty.displayImage" alt="" />
31
+                  <img
32
+                    style="max-height:165px; object-fit: cover;"
33
+                    :src="currentProperty.displayImage"
34
+                    alt=""
35
+                  />
28 36
                 </div>
29 37
                 <h1>{{ currentProperty.suburb }}</h1>
30 38
                 <p><strong>Property Reference</strong> #{{ currentProperty.id }}</p>

+ 20
- 10
src/components/property/propertyUserField.vue ファイルの表示

@@ -1,14 +1,13 @@
1 1
 <template>
2 2
   <div class="row">
3 3
     <div class="col-md-4 mb-2" v-for="(currentField, i) in fields" :key="i">
4
-      <div v-if="!setFields[i]">
5
-        <label class="uniSelectLabel">{{ currentField.name }}</label>
6
-      </div>
7
-
8 4
       <div class="input-group-prepend">
9 5
         <!-- <span class="input-group-text" style="color: #60CBEB">
10 6
           <b>{{ GetFirstLetter(currentField.name) }}</b>
11 7
         </span> -->
8
+        <div v-if="!setFields[i] && currentField.type !== 'yesno'">
9
+          <label class="uniSelectLabel">{{ currentField.name }}</label>
10
+        </div>
12 11
         <input
13 12
           v-if="currentField.type === 'number'"
14 13
           class="form-control uniInput"
@@ -18,6 +17,7 @@
18 17
           v-model="setFields[i]"
19 18
           @change="UpdateSetFields(currentField, i)"
20 19
         />
20
+
21 21
         <input
22 22
           v-if="currentField.type === 'text'"
23 23
           class="form-control uniInput"
@@ -27,16 +27,26 @@
27 27
           v-model="setFields[i]"
28 28
           @change="UpdateSetFields(currentField, i)"
29 29
         />
30
-        <select
30
+      </div>
31
+    </div>
32
+
33
+    <div class="col-md-4 mb-2" v-for="(currentField, i) in fields" :key="'checkField' + i">
34
+      <div class="input-group-prepend">
35
+        <!-- <span class="input-group-text" style="color: #60CBEB">
36
+          <b>{{ GetFirstLetter(currentField.name) }}</b>
37
+        </span> -->
38
+        <div v-if="currentField.type === 'yesno'">
39
+          <label class="uniSelectLabel">{{ currentField.name }}</label>
40
+        </div>
41
+
42
+        <input
31 43
           v-if="currentField.type === 'yesno'"
32
-          class="form-control uniSelect"
44
+          type="checkbox"
33 45
           id="currentField.id"
46
+          style="margin-left:-5px; margin-top:10px"
34 47
           v-model="setFields[i]"
35 48
           @change="UpdateSetFields(currentField, i)"
36
-        >
37
-          <option value="yes">Yes</option>
38
-          <option value="no">No</option>
39
-        </select>
49
+        />
40 50
       </div>
41 51
     </div>
42 52
   </div>

+ 39
- 41
src/components/property/residential/createProperty/residentialCreate.vue ファイルの表示

@@ -38,11 +38,9 @@
38 38
               @change="PropertyTypeSelected"
39 39
             >
40 40
               <option value="0">Please select type *</option>
41
-              <option
42
-                v-for="item in propertyTypes"
43
-                :value="item.id"
44
-                :key="item.id"
45
-              >{{ item.description }}</option>
41
+              <option v-for="item in propertyTypes" :value="item.id" :key="item.id">{{
42
+                item.description
43
+              }}</option>
46 44
             </select>
47 45
           </div>
48 46
           <div v-if="propertyType === 'Commercial'" class="col-md-2">
@@ -76,7 +74,8 @@
76 74
                     for="price"
77 75
                     class="uniSelectLabel"
78 76
                     style="text-transform:uppercase; margin-left:17px; background-color:white"
79
-                  >{{ salesType }} Price</label>
77
+                    >{{ salesType }} Price</label
78
+                  >
80 79
                 </div>
81 80
                 <input
82 81
                   class="form-control uniInput"
@@ -219,7 +218,9 @@
219 218
             </div>
220 219
             <div class="row my-3">
221 220
               <div class="col-md-12">
222
-                <button type="button" @click="clearAddress()" class="btn-solid-blue">Clear Address</button>
221
+                <button type="button" @click="clearAddress()" class="btn-solid-blue">
222
+                  Clear Address
223
+                </button>
223 224
               </div>
224 225
             </div>
225 226
           </div>
@@ -230,8 +231,8 @@
230 231
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
231 232
             <br />
232 233
             <p>
233
-              * A listing fee of R380 including VAT is payable to list your Property on the
234
-              Uni-Vate website
234
+              * A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate
235
+              website
235 236
             </p>
236 237
           </div>
237 238
         </div>
@@ -315,9 +316,13 @@
315 316
           :savedImages="propertyImages"
316 317
           @DefaultImage="UpdateDefaultImage"
317 318
         />
318
-        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">Save</button>
319
+        <button v-if="!wait" type="button" @click="SubmitData()" class="btn-solid-blue">
320
+          Save
321
+        </button>
319 322
         <div v-if="showPropertyTypeError">
320
-          <p class="alert myError">Missing fields. Please fill in all required fields. Marked with *</p>
323
+          <p class="alert myError">
324
+            Missing fields. Please fill in all required fields. Marked with *
325
+          </p>
321 326
         </div>
322 327
         <div v-if="wait" id="preloader"></div>
323 328
       </div>
@@ -342,7 +347,7 @@ export default {
342 347
     ImageLoad,
343 348
     VueEditor,
344 349
     carouselSection,
345
-    mapSection,
350
+    mapSection
346 351
   },
347 352
   data() {
348 353
     return {
@@ -355,22 +360,17 @@ export default {
355 360
       customToolbar: [
356 361
         [{ header: [false, 1, 2, 3, 4, 5, 6] }],
357 362
         ["bold", "italic", "underline", "strike"],
358
-        [
359
-          { align: "" },
360
-          { align: "center" },
361
-          { align: "right" },
362
-          { align: "justify" },
363
-        ],
363
+        [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
364 364
         [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
365 365
         [{ script: "sub" }, { script: "super" }],
366
-        [{ indent: "-1" }, { indent: "+1" }],
366
+        [{ indent: "-1" }, { indent: "+1" }]
367 367
       ],
368 368
       error: "",
369 369
       addressSet: false,
370 370
       showPropertyTypeError: false,
371 371
       showDateError: false,
372 372
       user: Log.getUser(),
373
-      mayEdit: Log.isLoggedIn(),
373
+      mayEdit: Log.isLoggedIn()
374 374
     };
375 375
   },
376 376
   methods: {
@@ -385,7 +385,7 @@ export default {
385 385
       "getPropertyEditDisplay",
386 386
       "getPropertySavedOverviewFields",
387 387
       "getPropertySavedFields",
388
-      "getSavedPropertyData",
388
+      "getSavedPropertyData"
389 389
     ]),
390 390
     updateLocation(place) {
391 391
       this.addressSet = true;
@@ -407,10 +407,7 @@ export default {
407 407
         this.showPropertyTypeError = true;
408 408
       }
409 409
 
410
-      if (
411
-        this.salesType === "Rental" &&
412
-        this.property.dateAvailable === "undef"
413
-      ) {
410
+      if (this.salesType === "Rental" && this.property.dateAvailable === "undef") {
414 411
         this.showDateError = true;
415 412
       }
416 413
 
@@ -434,7 +431,7 @@ export default {
434 431
         }
435 432
         this.property.propertyImages.push({
436 433
           image: this.images[i],
437
-          isDefault: setAsDefault,
434
+          isDefault: setAsDefault
438 435
         });
439 436
       }
440 437
       this.property.propertyUserFields = this.propertyFieldValues;
@@ -442,16 +439,17 @@ export default {
442 439
       if (this.user) {
443 440
         this.property.userId = this.user.id;
444 441
       }
442
+      console.log(this.propertyFieldValues);
445 443
 
446
-      this.saveProperty(this.property)
447
-        .then((fulfilled) => {
448
-          this.$router.push(
449
-            `/property/residential/property/${fulfilled.data.id}`
450
-          );
451
-        })
452
-        .catch((error) => {
453
-          console.log(error.message);
454
-        });
444
+      // this.saveProperty(this.property)
445
+      //   .then((fulfilled) => {
446
+      //     this.$router.push(
447
+      //       `/property/residential/property/${fulfilled.data.id}`
448
+      //     );
449
+      //   })
450
+      //   .catch((error) => {
451
+      //     console.log(error.message);
452
+      //   });
455 453
     },
456 454
     Close() {
457 455
       this.$router.push("/property/admin/list/my");
@@ -471,7 +469,7 @@ export default {
471 469
     },
472 470
     UpdateUserDefinedFields(item) {
473 471
       let update = false;
474
-      this.propertyFieldValues.forEach((element) => {
472
+      this.propertyFieldValues.forEach(element => {
475 473
         if (element.userDefinedFieldId === item.userDefinedFieldId) {
476 474
           element.value = item.value;
477 475
           update = true;
@@ -495,7 +493,7 @@ export default {
495 493
       this.property.postalCode = undefined;
496 494
       this.property.addressUrl = undefined;
497 495
       this.property.propertCoords = undefined;
498
-    },
496
+    }
499 497
   },
500 498
   mounted() {
501 499
     this.wait = false;
@@ -530,7 +528,7 @@ export default {
530 528
       "propertyOverviewFields",
531 529
       "propertyFields",
532 530
       "property",
533
-      "propertyImages",
531
+      "propertyImages"
534 532
     ]),
535 533
     ...mapState("authentication", ["user"]),
536 534
     SalesTypeChanged() {
@@ -550,13 +548,13 @@ export default {
550 548
       this.getPropertyTypes(this.propertyType);
551 549
 
552 550
       return this.propertyType;
553
-    },
551
+    }
554 552
   },
555 553
   watch: {
556 554
     SalesTypeChanged() {
557 555
       return null;
558
-    },
559
-  },
556
+    }
557
+  }
560 558
 };
561 559
 </script>
562 560
 

+ 157
- 35
src/components/property/residential/createProperty/residentialCreateNew.vue ファイルの表示

@@ -84,12 +84,14 @@
84 84
                     >{{ salesType }} Price</label
85 85
                   >
86 86
                 </div>
87
-                <input
88
-                  class="form-control uniInput"
89
-                  type="number"
87
+                <currency-input
88
+                  onClick="this.setSelectionRange(0, this.value.length)"
90 89
                   name="price"
91
-                  id="price"
90
+                  :value="value"
91
+                  @input="value = $event"
92 92
                   v-model="property.price"
93
+                  id="price"
94
+                  class="form-control uniInput"
93 95
                 />
94 96
               </div>
95 97
               <div v-if="salesType === 'Rental'" class="col-md-6">
@@ -115,36 +117,147 @@
115 117
                 />
116 118
               </div>
117 119
             </div>
118
-            <div class="row">
120
+            <div class="row my-3">
121
+              <br />
122
+            </div>
123
+            <div class="row my-3">
124
+              <div class="col-md-12">
125
+                <div v-if="!property.streetNumber">
126
+                  <label for="streetNumber" class="uniSelectLabel">STREET NUMBER</label>
127
+                </div>
128
+                <input
129
+                  class="form-control uniInput"
130
+                  type="text"
131
+                  name="streetNumber"
132
+                  id="unit"
133
+                  v-model="property.streetNumber"
134
+                  disabled
135
+                />
136
+              </div>
137
+            </div>
138
+            <div class="row my-3">
139
+              <div class="col-md-12">
140
+                <div v-if="!property.streetName">
141
+                  <label for="streetName" class="uniSelectLabel">STREET NAME</label>
142
+                </div>
143
+                <input
144
+                  class="form-control uniInput"
145
+                  type="text"
146
+                  name="streetName"
147
+                  id="unit"
148
+                  v-model="property.streetName"
149
+                  disabled
150
+                />
151
+              </div>
152
+            </div>
153
+            <div class="row my-3">
119 154
               <div class="col-md-12">
120
-                <label for="Property Description" style="font-family:'muli'">Description:</label>
121
-                <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
122
-                <br />
123
-                <p>
124
-                  * A listing fee of R380 including VAT is payable to list your Property on the
125
-                  Uni-Vate website
126
-                </p>
155
+                <div v-if="!property.suburb">
156
+                  <label for="suburb" class="uniSelectLabel">SUBURB</label>
157
+                </div>
158
+                <input
159
+                  class="form-control uniInput"
160
+                  type="text"
161
+                  name="suburb"
162
+                  id="unit"
163
+                  v-model="property.suburb"
164
+                  disabled
165
+                />
127 166
               </div>
128 167
             </div>
168
+            <div class="row my-3">
169
+              <div class="col-md-12">
170
+                <div v-if="!property.city">
171
+                  <label for="city" class="uniSelectLabel">CITY</label>
172
+                </div>
173
+                <input
174
+                  class="form-control uniInput"
175
+                  type="text"
176
+                  name="city"
177
+                  id="unit"
178
+                  v-model="property.city"
179
+                  disabled
180
+                />
181
+              </div>
182
+            </div>
183
+            <div class="row my-3">
184
+              <div class="col-md-12">
185
+                <div v-if="!property.province">
186
+                  <label for="province" class="uniSelectLabel">PROVINCE</label>
187
+                </div>
188
+                <input
189
+                  class="form-control uniInput"
190
+                  type="text"
191
+                  name="province"
192
+                  id="unit"
193
+                  v-model="property.province"
194
+                  disabled
195
+                />
196
+              </div>
197
+            </div>
198
+            <div class="row my-3">
199
+              <div class="col-md-12">
200
+                <div v-if="!property.postalCode">
201
+                  <label for="postalCode" class="uniSelectLabel">POSTAL CODE</label>
202
+                </div>
203
+                <input
204
+                  class="form-control uniInput"
205
+                  type="text"
206
+                  name="postalCode"
207
+                  id="unit"
208
+                  v-model="property.postalCode"
209
+                  disabled
210
+                />
211
+              </div>
212
+            </div>
213
+            <div class="row my-3">
214
+              <div class="col-md-12">
215
+                <div v-if="!property.country">
216
+                  <label for="country" class="uniSelectLabel">COUNTRY</label>
217
+                </div>
218
+                <input
219
+                  class="form-control uniInput"
220
+                  type="text"
221
+                  name="country"
222
+                  id="unit"
223
+                  v-model="property.country"
224
+                  disabled
225
+                />
226
+              </div>
227
+            </div>
228
+            <div class="row my-3">
229
+              <div class="col-md-12">
230
+                <button type="button" @click="clearAddress()" class="btn-solid-blue">
231
+                  Clear Address
232
+                </button>
233
+              </div>
234
+            </div>
235
+          </div>
236
+        </div>
237
+        <div class="row">
238
+          <div class="col-md-12">
239
+            <label for="Property Description" style="font-family:'muli'">Description:</label>
240
+            <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
241
+            <br />
242
+            <p>
243
+              * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
244
+              Property on the Uni-Vate website
245
+            </p>
129 246
           </div>
130 247
         </div>
131
-        <div class="row" />
132 248
 
133 249
         <div class="section-header">
134 250
           <h2>Property Information</h2>
135 251
         </div>
136 252
 
137
-        <div class="row mb-3" v-for="item in propertyFields" :key="item.id">
138
-          <div class="col-md-6" v-for="field in item.fields" :key="field.id">
139
-            <div v-if="field.type === 'number'">
140
-              {{ field.name }}
141
-              <input type="number" class="form-control uniInput" v-model="field.value" />
142
-            </div>
143
-            <div v-else class="display:none"></div>
144
-            <div v-if="field.type === 'yesno'">
145
-              {{ field.name }}
146
-              <input type="checkbox" v-model="field.value" />
147
-            </div>
253
+        <div v-for="item in propertyFields" :key="item.id">
254
+          <div v-if="item.name === 'Residential Fields'">
255
+            <UserField
256
+              :fields="item.fields"
257
+              :id="item.name"
258
+              @UpdateUserDefinedFields="UpdateUserDefinedFields"
259
+              :fieldValues="item.fields"
260
+            />
148 261
           </div>
149 262
         </div>
150 263
         <!-- <UserField
@@ -237,7 +350,7 @@
237 350
 
238 351
 <script>
239 352
 /* eslint-disable */
240
-import { mapState, mapActions } from "vuex";
353
+import { mapState, mapActions, mapGetters } from "vuex";
241 354
 import { VueEditor } from "vue2-editor";
242 355
 import UserField from "../../propertyUserField.vue";
243 356
 import ImageLoad from "../../propertyImage.vue";
@@ -339,21 +452,17 @@ export default {
339 452
           isDefault: setAsDefault
340 453
         });
341 454
       }
342
-      this.property.propertyUserFields = this.propertyFields;
455
+      this.property.propertyUserFields = this.propertyFieldValues;
343 456
 
344 457
       if (this.user) {
345 458
         this.property.userId = this.user.id;
346 459
       }
347 460
       this.property.propertyUserFields.forEach(item => {
348
-        item.fields.forEach(field => {
349
-          if (field.type === "yesno") {
350
-            if (field.value) {
351
-              field.value = "yes";
352
-            } else {
353
-              field.value = "no";
354
-            }
355
-          }
356
-        });
461
+        if (item.value === true) {
462
+          item.value = "yes";
463
+        } else if (item.value === false) {
464
+          item.value = "no";
465
+        }
357 466
       });
358 467
 
359 468
       this.saveProperty(this.property)
@@ -397,6 +506,18 @@ export default {
397 506
     UpdateDefaultImage(item) {
398 507
       this.defaultImage = item;
399 508
     },
509
+    clearAddress() {
510
+      this.addressSet = false;
511
+      this.property.streetNumber = undefined;
512
+      this.property.streetName = undefined;
513
+      this.property.suburb = undefined;
514
+      this.property.city = undefined;
515
+      this.property.province = undefined;
516
+      this.property.country = undefined;
517
+      this.property.postalCode = undefined;
518
+      this.property.addressUrl = undefined;
519
+      this.property.propertCoords = undefined;
520
+    },
400 521
     userFieldsArrFunc(arr, len) {
401 522
       const fields = [];
402 523
       const i = 0;
@@ -446,6 +567,7 @@ export default {
446 567
       "propertyImages"
447 568
     ]),
448 569
     ...mapState("authentication", ["user"]),
570
+    ...mapGetters("fees", ["getListingFee"]),
449 571
     SalesTypeChanged() {
450 572
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
451 573
       // this.propertyType = this.$route.params.propType;

+ 11
- 36
src/components/property/residential/singleView/contentSection.vue ファイルの表示

@@ -36,17 +36,13 @@
36 36
             <p v-if="property.showAddress">{{ property.addressOther }}</p>
37 37
             <p v-if="property.showAddress">{{ property.streetNumber }} {{ property.streetName }}</p>
38 38
             <p>{{ property.city }}, {{ property.suburb }}</p>
39
-            <!-- <div v-for="(data, i) in property.displayData" :key="i">
40
-              {{ data }}
41
-            </div> -->
42
-            <p>
43
-              Bedrooms {{ property.displayData[1].values[0].value }}, Bathrooms
44
-              {{ property.displayData[1].values[1].value }}
45
-            </p>
46
-            <p>
47
-              Yard Size {{ property.displayData[0].values[1].value }}M<sup>2</sup>, Floor Size
48
-              {{ property.displayData[0].values[2].value }}M<sup>2</sup>
49
-            </p>
39
+            <div v-for="(data, i) in property.displayData" :key="i">
40
+              <div v-for="field in data.values" :key="field.id">
41
+                <p v-if="field.name === 'Floor Size'">{{ field.value }}M<sup>2</sup></p>
42
+                <p v-if="field.name === 'Bedrooms'">Bedrooms {{ field.value }}</p>
43
+                <p v-if="field.name === 'Bathrooms'">Bathrooms {{ field.value }}</p>
44
+              </div>
45
+            </div>
50 46
 
51 47
             <div class="btn-white-border"><i class="fa fa-search"></i>BOOK A VIEWING</div>
52 48
           </div>
@@ -76,6 +72,7 @@
76 72
             {{ property.streetNumber }} {{ property.streetName }}
77 73
           </h2>
78 74
           <h2 v-else>{{ property.propertyName }}</h2>
75
+
79 76
           <div class="container">
80 77
             <div class="row">
81 78
               <div class="col">
@@ -84,30 +81,8 @@
84 81
             </div>
85 82
           </div>
86 83
           <div>
87
-            <!-- <table class="table table-striped">
88
-              <thead>
89
-                <tr>
90
-                  <th scope="col">Reference</th>
91
-                  <th scope="col">Size</th>
92
-                  <th scope="col">Rooms</th>
93
-                  <th scope="col">Bathrooms</th>
94
-                  <th scope="col">Garages</th>
95
-                  <th scope="col"></th>
96
-                </tr>
97
-              </thead>
98
-
99
-              <tbody>
100
-                <tr>
101
-                  <td>#{{ property.id }}</td>
102
-                  <td>{{ property.displayData[0].values[2].value }}M<sup>2</sup></td>
103
-                  <td>{{ property.displayData[1].values[0].value }}</td>
104
-                  <td>{{ property.displayData[1].values[1].value }}</td>
105
-                  <td>{{ property.displayData[2].values[0].value }}</td>
106
-                  <td><a href="#" class="btn-solid-blue">BOOK A VIEWING</a></td>
107
-                </tr>
108
-              </tbody>
109
-            </table>-->
110 84
             <h4>Property Features</h4>
85
+
111 86
             <div v-for="(data, i) in property.displayData" :key="i" class="row my-3">
112 87
               <div v-for="(field, j) in data.values" :key="j" class="col-md-6">
113 88
                 <div v-if="field.value.toUpperCase() != 'YES'">
@@ -165,8 +140,8 @@ export default {
165 140
     console.log(this.property.displayData);
166 141
   },
167 142
   mounted() {
168
-    var facebookShare = document.getElementById("fb_share");
169
-    facebookShare.href = "http://www.facebook.com/share.php?u=" + encodeURIComponent(location.href);
143
+    // var facebookShare = document.getElementById("fb_share");
144
+    // facebookShare.href = "http://www.facebook.com/share.php?u=" + encodeURIComponent(location.href);
170 145
   },
171 146
   data() {
172 147
     return {

+ 83
- 40
src/components/shared/navBar.vue ファイルの表示

@@ -40,8 +40,9 @@
40 40
               </div>
41 41
               <nav id="nav-menu-container">
42 42
                 <ul class="nav-menu sf-js-enabled sf-arrows">
43
-                  <li class="menu-has-children" style="margin-left:-20px">
44
-                    <div
43
+                  <li style="margin-left:-20px">
44
+                    <router-link to="/property/commercial">Commercial</router-link>
45
+                    <!-- <div
45 46
                       @mouseover="commercialClass = 'ts-display'"
46 47
                       @mouseleave="commercialClass = 'no-display'"
47 48
                     ></div>
@@ -50,7 +51,7 @@
50 51
                     </a>
51 52
                     <ul style="margin-top:-10px; text-align:left" :class="commercialClass">
52 53
                       <li>
53
-                        <router-link to="/property/commercial">To Buy / To Rent</router-link>
54
+                        
54 55
                       </li>
55 56
                       <hr />
56 57
                       <li>
@@ -61,10 +62,11 @@
61 62
                           >To Rent</a
62 63
                         >
63 64
                       </li>
64
-                    </ul>
65
+                    </ul> -->
65 66
                   </li>
66
-                  <li class="menu-has-children mx-1">
67
-                    <div
67
+                  <li class="mx-1">
68
+                    <router-link to="/property/residential">Residential</router-link>
69
+                    <!-- <div
68 70
                       @mouseover="residentialClass = 'ts-display'"
69 71
                       @mouseleave="residentialClass = 'no-display'"
70 72
                     ></div>
@@ -86,7 +88,7 @@
86 88
                           >To Rent</a
87 89
                         >
88 90
                       </li>
89
-                    </ul>
91
+                    </ul> -->
90 92
                   </li>
91 93
                   <li class="menu-has-children mx-1">
92 94
                     <div
@@ -187,11 +189,9 @@
187 189
                     </a>
188 190
                     <ul style="margin-top:-10px;text-align:left" :class="userClass">
189 191
                       <li>
190
-                        <router-link to="/property/list">List Property</router-link>
191
-                      </li>
192
-                      <li>
193
-                        <router-link to="/status/list">Status</router-link>
192
+                        <router-link to="/property/list">List My Property</router-link>
194 193
                       </li>
194
+
195 195
                       <li>
196 196
                         <router-link to="/status/timeshareAdmin">Timeshare Week Admin</router-link>
197 197
                       </li>
@@ -200,36 +200,72 @@
200 200
                           >Tender Week Management</router-link
201 201
                         >
202 202
                       </li>
203
-                      <li>
204
-                        <router-link to="/unitConfiguration/list">Unit Configuration</router-link>
205
-                      </li>
206
-                      <li>
207
-                        <router-link to="/communication/template">Templates</router-link>
208
-                      </li>
209 203
                       <hr />
210
-                      <li>
211
-                        <router-link to="/status/userManagementPage"
212
-                          >User Management & Access</router-link
204
+                      <li class="menu-has-children">
205
+                        <div
206
+                          @mouseover="submenu1Class = 'ts-display'"
207
+                          @mouseleave="submenu1Class = 'no-display'"
208
+                        ></div>
209
+                        <a href="#" class="sf-with-ul">
210
+                          Website Setup
211
+                        </a>
212
+                        <ul
213
+                          style="margin-top:-10px;text-align:left;width:250px"
214
+                          :class="submenu1Class"
213 215
                         >
214
-                      </li>
215
-                      <li>
216
-                        <router-link to="/status/changeLogPage">Changes Logs</router-link>
217
-                      </li>
218
-                      <li>
219
-                        <router-link to="/PropertyAdmin">Property Admin</router-link>
220
-                      </li>
221
-                      <li>
222
-                        <router-link to="/userDefinedGroups/list"
223
-                          >Property User Defined Groups</router-link
216
+                          <li>
217
+                            <router-link to="/status/list">Status</router-link>
218
+                          </li>
219
+                          <li>
220
+                            <router-link to="/unitConfiguration/list"
221
+                              >Unit Configuration</router-link
222
+                            >
223
+                          </li>
224
+                          <li>
225
+                            <router-link to="/communication/template">Templates</router-link>
226
+                          </li>
227
+                          <li>
228
+                            <router-link to="/status/userManagementPage"
229
+                              >User Management & Access</router-link
230
+                            >
231
+                          </li>
232
+                          <li>
233
+                            <router-link to="/userDefinedGroups/list"
234
+                              >Property User Defined Groups</router-link
235
+                            >
236
+                          </li>
237
+                          <li>
238
+                            <router-link to="/PropertyAdmin">Property Admin</router-link>
239
+                          </li>
240
+                          <li>
241
+                            <router-link to="/propertyTypes/list">Property Types</router-link>
242
+                          </li>
243
+                          <li>
244
+                            <router-link to="/fees">Fees</router-link>
245
+                          </li>
246
+                        </ul>
247
+                      </li>
248
+                      <li class="menu-has-children">
249
+                        <div
250
+                          @mouseover="submenu1Class = 'ts-display'"
251
+                          @mouseleave="submenu1Class = 'no-display'"
252
+                        ></div>
253
+                        <a href="#" class="sf-with-ul">
254
+                          Logs
255
+                        </a>
256
+                        <ul
257
+                          style="margin-top:-10px;text-align:left;width:250px"
258
+                          :class="submenu1Class"
224 259
                         >
225
-                      </li>
226
-                      <li>
227
-                        <router-link to="/propertyTypes/list">Property Types</router-link>
260
+                          <li>
261
+                            <router-link to="/status/changeLogPage">Changes Logs</router-link>
262
+                          </li>
263
+                          <li>
264
+                            <router-link to="/searchLog">Search Logs</router-link>
265
+                          </li>
266
+                        </ul>
228 267
                       </li>
229 268
                       <hr />
230
-                      <li>
231
-                        <router-link to="/searchLog">Search Logs</router-link>
232
-                      </li>
233 269
                       <li>
234 270
                         <router-link to="/Offers">Offers</router-link>
235 271
                       </li>
@@ -335,11 +371,13 @@ export default {
335 371
       registerClass: "no-display",
336 372
       commercialClass: "no-display",
337 373
       residentialClass: "no-display",
338
-      propManClass: "no-display"
374
+      propManClass: "no-display",
375
+      submenu1Class: "no-display"
339 376
     };
340 377
   },
341 378
   methods: {
342 379
     ...mapActions("authentication", ["logout"]),
380
+    ...mapActions("fees", ["retrieveListingFee"]),
343 381
     showDropDown() {
344 382
       if (!this.hover) {
345 383
         this.timeShareClass = "ts-display";
@@ -349,12 +387,12 @@ export default {
349 387
       this.$emit("routerGoTo", goTo);
350 388
     }
351 389
   },
390
+  mounted() {
391
+    this.retrieveListingFee();
392
+  },
352 393
   computed: {
353 394
     ...mapState("authentication", ["user", "flag", "status", "person", "token"]),
354 395
     isLoggedIn() {
355
-      console.log(Log.isLoggedIn());
356
-      console.log(this.user);
357
-
358 396
       return Log.isLoggedIn();
359 397
     },
360 398
     NAME() {
@@ -372,6 +410,11 @@ export default {
372 410
 </script>
373 411
 
374 412
 <style lang="scss" scoped>
413
+.subItem {
414
+  background-color: white;
415
+  margin-top: -10px;
416
+}
417
+
375 418
 .no-display {
376 419
   display: none;
377 420
 }

+ 6
- 2
src/components/timeshare/sell/carouselSection.vue ファイルの表示

@@ -6,8 +6,8 @@
6 6
           <div class="intro-content box">
7 7
             <h2>Sell your Timeshare</h2>
8 8
             <p>
9
-              A listing fee of R380 including VAT is payable to list your timeshare week/module on
10
-              the Uni-Vate website.
9
+              A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
10
+              timeshare week/module on the Uni-Vate website.
11 11
             </p>
12 12
             <div></div>
13 13
           </div>
@@ -41,9 +41,13 @@
41 41
 /* eslint-disable */
42 42
 
43 43
 import carousel from "vue-owl-carousel";
44
+import { mapGetters } from "vuex";
44 45
 export default {
45 46
   components: {
46 47
     carousel
48
+  },
49
+  computed: {
50
+    ...mapGetters("fees", ["getListingFee"])
47 51
   }
48 52
 };
49 53
 </script>

+ 3
- 1
src/components/timeshare/sell/contentSection.vue ファイルの表示

@@ -819,6 +819,7 @@ export default {
819 819
     refAgent() {
820 820
       return this.sellItem && this.sellItem.referedByAgent;
821 821
     },
822
+    ...mapGetters("fees", ["getListingFee"]),
822 823
     filteredResort() {
823 824
       let list = [];
824 825
       if (this.sellItem && this.sellItem.region && this.sellItem.region.regionCode) {
@@ -876,11 +877,12 @@ export default {
876 877
       } else this.$router.push("/user/login");
877 878
     },
878 879
     paygateRedirect() {
880
+      var amount = this.getListingFee.amount;
879 881
       var paymentObj = {
880 882
         timeshareWeekId: this.sellItem.id, // this.sellItem.Id,
881 883
         propertyId: 0,
882 884
         creatydById: Log.getUser().id, //Log.getUser().id,
883
-        amount: 380.0,
885
+        amount: amount,
884 886
         paymentStatus: "",
885 887
         paymentToken: ""
886 888
       };

+ 9
- 3
src/main.js ファイルの表示

@@ -9,10 +9,12 @@ import store from "./store";
9 9
 import * as VueGoogleMaps from "vue2-google-maps";
10 10
 import Vuetify from "vuetify";
11 11
 import VueShareSocial from "vue-share-social";
12
+import VueCurrencyInput from "vue-currency-input";
12 13
 
13 14
 Vue.use(VueShareSocial);
14 15
 Vue.use(EvaIcons);
15 16
 Vue.use(Vuetify);
17
+
16 18
 Vue.use(VueGoogleMaps, {
17 19
   load: {
18 20
     key: "AIzaSyD8k_Kwml_C8IDfs-gX8JFV8acli3L9cAE",
@@ -27,11 +29,15 @@ Vue.use(VueGoogleMaps, {
27 29
 });
28 30
 Vue.config.productionTip = false;
29 31
 //axios.defaults.baseURL = "http://localhost:57260";
30
-//axios.defaults.baseURL = "http://training.provision-sa.com:82";
31
-axios.defaults.baseURL = "http://localhost:8080/";
32
+axios.defaults.baseURL = "http://training.provision-sa.com:82";
33
+//axios.defaults.baseURL = "http://localhost:8080/";
32 34
 
33 35
 Vue.prototype.$axios = axios;
34
-
36
+const pluginOptions = {
37
+  /* see config reference */
38
+  globalOptions: { currency: ["ZAR", null, { prefix: "R" }][2] }
39
+};
40
+Vue.use(VueCurrencyInput, pluginOptions);
35 41
 Vue.prototype.$http = axios;
36 42
 const token = localStorage.getItem("token");
37 43
 if (token) {

+ 6
- 0
src/router/index.js ファイルの表示

@@ -48,6 +48,7 @@ import userManagementPage from "../components/admin/status/userManagementPage.vu
48 48
 import changeLogPage from "../components/admin/status/changeLogPage.vue";
49 49
 import UnitConfiguration from "../components/admin/unitConfiguration/unitConfigurationPage.vue";
50 50
 import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
51
+import Fees from "../components/admin/fees/feesPage.vue";
51 52
 
52 53
 import ResortPage from "../components/timeshare/resort/resortPage.vue";
53 54
 import UnitPage from "../components/timeshare/resort/unit/unitPage.vue";
@@ -371,6 +372,11 @@ export default new Router({
371 372
       name: "SearchLog",
372 373
       component: searchLog
373 374
     },
375
+    {
376
+      path: "/fees",
377
+      name: "fees",
378
+      component: Fees
379
+    },
374 380
     {
375 381
       path: "/carousel",
376 382
       name: "carousel",

+ 2
- 0
src/store/index.js ファイルの表示

@@ -33,6 +33,7 @@ import CampaignItemModule from "./modules/marketing/campaignItems";
33 33
 import PlaceHolderFormat from "./modules/misc/placeHolderFormat";
34 34
 import Bank from "./modules/user/bank";
35 35
 import bank from "./modules/user/bank";
36
+import Fees from "./modules/financial/fees";
36 37
 
37 38
 Vue.use(Vuex);
38 39
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -68,6 +69,7 @@ export default new Vuex.Store({
68 69
     campaign: CampaignModule,
69 70
     campaignItem: CampaignItemModule,
70 71
     placeHolderFormat: PlaceHolderFormat,
72
+    fees: Fees,
71 73
     bank: bank
72 74
   }
73 75
 });

+ 28
- 0
src/store/modules/financial/fees.js ファイルの表示

@@ -0,0 +1,28 @@
1
+/* eslint-disable */
2
+import axios from "axios";
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    listingFee: []
8
+  },
9
+  mutations: {
10
+    getListingFee: (state, fee) => (state.listingFee = fee),
11
+    newListingFee: (state, fee) => (state.listingFee = fee)
12
+  },
13
+  getters: {
14
+    getListingFee: state => state.listingFee
15
+  },
16
+  actions: {
17
+    async retrieveListingFee({ commit }) {
18
+      await axios.get("api/fees/listingFee").then(res => {
19
+        commit("getListingFee", res.data);
20
+      });
21
+    },
22
+    async setListingFee({ commit }, fee) {
23
+      await axios.post("api/fees/listingFee", fee).then(res => {
24
+        commit("newListingFee", res.data);
25
+      });
26
+    }
27
+  }
28
+};

+ 1
- 1
src/store/modules/property/propertySearch.js ファイルの表示

@@ -105,7 +105,7 @@ export default {
105 105
             commit("updateSearch", result.data);
106 106
             resolve();
107 107
           })
108
-          .catch(errro => reject(new Error(error.message)));
108
+          .catch(error => reject(new Error(error.message)));
109 109
       });
110 110
     },
111 111
     searchLatestProperties({ commit }) {

読み込み中…
キャンセル
保存