Quellcode durchsuchen

Listing Fee Update

master
30117125 vor 4 Jahren
Ursprung
Commit
53b9152343

+ 27
- 2
src/components/admin/fees/listingFee.vue Datei anzeigen

10
       id="price"
10
       id="price"
11
       class="form-control uniInput"
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
   </section>
14
   </section>
15
 </template>
15
 </template>
16
 
16
 
17
 <script>
17
 <script>
18
 /* eslint-disable */
18
 /* eslint-disable */
19
+import { mapActions, mapGetters, mapState } from "vuex";
19
 export default {
20
 export default {
20
   data() {
21
   data() {
21
     return {
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
 </script>
51
 </script>

+ 4
- 3
src/components/property/commercial/createProperty/commercialCreateNew.vue Datei anzeigen

240
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
240
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
241
             <br />
241
             <br />
242
             <p>
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
             </p>
245
             </p>
246
           </div>
246
           </div>
247
         </div>
247
         </div>
323
 
323
 
324
 <script>
324
 <script>
325
 /* eslint-disable */
325
 /* eslint-disable */
326
-import { mapState, mapActions } from "vuex";
326
+import { mapState, mapActions, mapGetters } from "vuex";
327
 import { VueEditor } from "vue2-editor";
327
 import { VueEditor } from "vue2-editor";
328
 import UserField from "../../propertyUserField.vue";
328
 import UserField from "../../propertyUserField.vue";
329
 import ImageLoad from "../../propertyImage.vue";
329
 import ImageLoad from "../../propertyImage.vue";
527
       "propertyImages"
527
       "propertyImages"
528
     ]),
528
     ]),
529
     ...mapState("authentication", ["user"]),
529
     ...mapState("authentication", ["user"]),
530
+    ...mapGetters("fees", ["getListingFee"]),
530
     SalesTypeChanged() {
531
     SalesTypeChanged() {
531
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
532
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
532
       // this.propertyType = this.$route.params.propType;
533
       // this.propertyType = this.$route.params.propType;

+ 4
- 3
src/components/property/residential/createProperty/residentialCreateNew.vue Datei anzeigen

240
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
240
             <vue-editor v-model="property.description" :editor-toolbar="customToolbar" />
241
             <br />
241
             <br />
242
             <p>
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
             </p>
245
             </p>
246
           </div>
246
           </div>
247
         </div>
247
         </div>
350
 
350
 
351
 <script>
351
 <script>
352
 /* eslint-disable */
352
 /* eslint-disable */
353
-import { mapState, mapActions } from "vuex";
353
+import { mapState, mapActions, mapGetters } from "vuex";
354
 import { VueEditor } from "vue2-editor";
354
 import { VueEditor } from "vue2-editor";
355
 import UserField from "../../propertyUserField.vue";
355
 import UserField from "../../propertyUserField.vue";
356
 import ImageLoad from "../../propertyImage.vue";
356
 import ImageLoad from "../../propertyImage.vue";
567
       "propertyImages"
567
       "propertyImages"
568
     ]),
568
     ]),
569
     ...mapState("authentication", ["user"]),
569
     ...mapState("authentication", ["user"]),
570
+    ...mapGetters("fees", ["getListingFee"]),
570
     SalesTypeChanged() {
571
     SalesTypeChanged() {
571
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
572
       // eslint-disable-next-line vue/no-side-effects-in-computed-properties
572
       // this.propertyType = this.$route.params.propType;
573
       // this.propertyType = this.$route.params.propType;

+ 4
- 0
src/components/shared/navBar.vue Datei anzeigen

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

+ 6
- 2
src/components/timeshare/sell/carouselSection.vue Datei anzeigen

6
           <div class="intro-content box">
6
           <div class="intro-content box">
7
             <h2>Sell your Timeshare</h2>
7
             <h2>Sell your Timeshare</h2>
8
             <p>
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
             </p>
11
             </p>
12
             <div></div>
12
             <div></div>
13
           </div>
13
           </div>
41
 /* eslint-disable */
41
 /* eslint-disable */
42
 
42
 
43
 import carousel from "vue-owl-carousel";
43
 import carousel from "vue-owl-carousel";
44
+import { mapGetters } from "vuex";
44
 export default {
45
 export default {
45
   components: {
46
   components: {
46
     carousel
47
     carousel
48
+  },
49
+  computed: {
50
+    ...mapGetters("fees", ["getListingFee"])
47
   }
51
   }
48
 };
52
 };
49
 </script>
53
 </script>

+ 3
- 1
src/components/timeshare/sell/contentSection.vue Datei anzeigen

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

+ 2
- 2
src/main.js Datei anzeigen

29
 });
29
 });
30
 Vue.config.productionTip = false;
30
 Vue.config.productionTip = false;
31
 //axios.defaults.baseURL = "http://localhost:57260";
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
 Vue.prototype.$axios = axios;
35
 Vue.prototype.$axios = axios;
36
 const pluginOptions = {
36
 const pluginOptions = {

+ 3
- 3
src/store/index.js Datei anzeigen

33
 import PlaceHolderFormat from "./modules/misc/placeHolderFormat";
33
 import PlaceHolderFormat from "./modules/misc/placeHolderFormat";
34
 import Bank from "./modules/user/bank";
34
 import Bank from "./modules/user/bank";
35
 import bank from "./modules/user/bank";
35
 import bank from "./modules/user/bank";
36
-import fees from "./modules/financial/fees";
36
+import Fees from "./modules/financial/fees";
37
 
37
 
38
 Vue.use(Vuex);
38
 Vue.use(Vuex);
39
 /* eslint no-param-reassign: ["error", { "props": false }] */
39
 /* eslint no-param-reassign: ["error", { "props": false }] */
69
     campaign: CampaignModule,
69
     campaign: CampaignModule,
70
     campaignItem: CampaignItemModule,
70
     campaignItem: CampaignItemModule,
71
     placeHolderFormat: PlaceHolderFormat,
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 Datei anzeigen

7
     listingFee: []
7
     listingFee: []
8
   },
8
   },
9
   mutations: {
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
   getters: {
13
   getters: {
13
     getListingFee: state => state.listingFee
14
     getListingFee: state => state.listingFee
17
       await axios.get("api/fees/listingFee").then(res => {
18
       await axios.get("api/fees/listingFee").then(res => {
18
         commit("getListingFee", res.data);
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 Datei anzeigen

2
   devServer: {
2
   devServer: {
3
     proxy: {
3
     proxy: {
4
       "/api": {
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
         changeOrigin: true
7
         changeOrigin: true
8
       },
8
       },
9
       "/nph-srep": {
9
       "/nph-srep": {

Laden…
Abbrechen
Speichern