Browse Source

Listing Fee Update

master
30117125 4 years ago
parent
commit
53b9152343

+ 27
- 2
src/components/admin/fees/listingFee.vue View File

@@ -10,17 +10,42 @@
10 10
       id="price"
11 11
       class="form-control uniInput"
12 12
     />
13
-    <button class="btn-solid-blue mt-4">Save</button>
13
+    <button @click="saveListingFee" class="btn-solid-blue mt-4">Save</button>
14 14
   </section>
15 15
 </template>
16 16
 
17 17
 <script>
18 18
 /* eslint-disable */
19
+import { mapActions, mapGetters, mapState } from "vuex";
19 20
 export default {
20 21
   data() {
21 22
     return {
22
-      fee: 0
23
+      fee: 0.0
23 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"])
24 49
   }
25 50
 };
26 51
 </script>

+ 4
- 3
src/components/property/commercial/createProperty/commercialCreateNew.vue View File

@@ -240,8 +240,8 @@
240 240
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
241 241
             <br />
242 242
             <p>
243
-              * A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate
244
-              website
243
+              * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
244
+              Property on the Uni-Vate website
245 245
             </p>
246 246
           </div>
247 247
         </div>
@@ -323,7 +323,7 @@
323 323
 
324 324
 <script>
325 325
 /* eslint-disable */
326
-import { mapState, mapActions } from "vuex";
326
+import { mapState, mapActions, mapGetters } from "vuex";
327 327
 import { VueEditor } from "vue2-editor";
328 328
 import UserField from "../../propertyUserField.vue";
329 329
 import ImageLoad from "../../propertyImage.vue";
@@ -527,6 +527,7 @@ export default {
527 527
       "propertyImages"
528 528
     ]),
529 529
     ...mapState("authentication", ["user"]),
530
+    ...mapGetters("fees", ["getListingFee"]),
530 531
     SalesTypeChanged() {
531 532
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
532 533
       // this.propertyType = this.$route.params.propType;

+ 4
- 3
src/components/property/residential/createProperty/residentialCreateNew.vue View File

@@ -240,8 +240,8 @@
240 240
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
241 241
             <br />
242 242
             <p>
243
-              * A listing fee of R380 including VAT is payable to list your Property on the Uni-Vate
244
-              website
243
+              * A listing fee of R{{ getListingFee.amount }} including VAT is payable to list your
244
+              Property on the Uni-Vate website
245 245
             </p>
246 246
           </div>
247 247
         </div>
@@ -350,7 +350,7 @@
350 350
 
351 351
 <script>
352 352
 /* eslint-disable */
353
-import { mapState, mapActions } from "vuex";
353
+import { mapState, mapActions, mapGetters } from "vuex";
354 354
 import { VueEditor } from "vue2-editor";
355 355
 import UserField from "../../propertyUserField.vue";
356 356
 import ImageLoad from "../../propertyImage.vue";
@@ -567,6 +567,7 @@ export default {
567 567
       "propertyImages"
568 568
     ]),
569 569
     ...mapState("authentication", ["user"]),
570
+    ...mapGetters("fees", ["getListingFee"]),
570 571
     SalesTypeChanged() {
571 572
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
572 573
       // this.propertyType = this.$route.params.propType;

+ 4
- 0
src/components/shared/navBar.vue View File

@@ -375,6 +375,7 @@ export default {
375 375
   },
376 376
   methods: {
377 377
     ...mapActions("authentication", ["logout"]),
378
+    ...mapActions("fees", ["retrieveListingFee"]),
378 379
     showDropDown() {
379 380
       if (!this.hover) {
380 381
         this.timeShareClass = "ts-display";
@@ -384,6 +385,9 @@ export default {
384 385
       this.$emit("routerGoTo", goTo);
385 386
     }
386 387
   },
388
+  mounted() {
389
+    this.retrieveListingFee();
390
+  },
387 391
   computed: {
388 392
     ...mapState("authentication", ["user", "flag", "status", "person", "token"]),
389 393
     isLoggedIn() {

+ 6
- 2
src/components/timeshare/sell/carouselSection.vue View File

@@ -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 View File

@@ -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
       };

+ 2
- 2
src/main.js View File

@@ -29,8 +29,8 @@ Vue.use(VueGoogleMaps, {
29 29
 });
30 30
 Vue.config.productionTip = false;
31 31
 //axios.defaults.baseURL = "http://localhost:57260";
32
-axios.defaults.baseURL = "http://training.provision-sa.com:82";
33
-//axios.defaults.baseURL = "http://localhost:8080/";
32
+//axios.defaults.baseURL = "http://training.provision-sa.com:82";
33
+axios.defaults.baseURL = "http://localhost:8080/";
34 34
 
35 35
 Vue.prototype.$axios = axios;
36 36
 const pluginOptions = {

+ 3
- 3
src/store/index.js View File

@@ -33,7 +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
+import Fees from "./modules/financial/fees";
37 37
 
38 38
 Vue.use(Vuex);
39 39
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -69,7 +69,7 @@ export default new Vuex.Store({
69 69
     campaign: CampaignModule,
70 70
     campaignItem: CampaignItemModule,
71 71
     placeHolderFormat: PlaceHolderFormat,
72
-    bank: bank,
73
-    fees: fees
72
+    fees: Fees,
73
+    bank: bank
74 74
   }
75 75
 });

+ 7
- 1
src/store/modules/financial/fees.js View File

@@ -7,7 +7,8 @@ export default {
7 7
     listingFee: []
8 8
   },
9 9
   mutations: {
10
-    getListingFee: (state, fee) => (state.listingFee = fee)
10
+    getListingFee: (state, fee) => (state.listingFee = fee),
11
+    newListingFee: (state, fee) => (state.listingFee = fee)
11 12
   },
12 13
   getters: {
13 14
     getListingFee: state => state.listingFee
@@ -17,6 +18,11 @@ export default {
17 18
       await axios.get("api/fees/listingFee").then(res => {
18 19
         commit("getListingFee", res.data);
19 20
       });
21
+    },
22
+    async setListingFee({ commit }, fee) {
23
+      await axios.post("api/fees/listingFee", fee).then(res => {
24
+        commit("newListingFee", res.data);
25
+      });
20 26
     }
21 27
   }
22 28
 };

+ 2
- 2
vue.config.js View File

@@ -2,8 +2,8 @@ module.exports = {
2 2
   devServer: {
3 3
     proxy: {
4 4
       "/api": {
5
-        //target: "http://localhost:57260/",
6
-        target: "http://training.provision-sa.com:82",
5
+        target: "http://localhost:57260/",
6
+        //target: "http://training.provision-sa.com:82",
7 7
         changeOrigin: true
8 8
       },
9 9
       "/nph-srep": {

Loading…
Cancel
Save