Kaynağa Gözat

Timeshare chages to Vuex

Added Proxy file
master
Kobus 5 yıl önce
ebeveyn
işleme
5d78b9e71b

+ 81
- 159
package-lock.json
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 2
- 1
package.json Dosyayı Görüntüle

@@ -9,6 +9,7 @@
9 9
     "lint": "vue-cli-service lint"
10 10
   },
11 11
   "dependencies": {
12
+    "@nuxtjs/axios": "^5.6.0",
12 13
     "animate.css": "^3.7.2",
13 14
     "axios": "^0.19.0",
14 15
     "core-js": "^2.6.5",
@@ -33,4 +34,4 @@
33 34
     "vue-cli-plugin-vuetify": "^0.5.0",
34 35
     "vue-template-compiler": "^2.6.10"
35 36
   }
36
-}
37
+}

+ 1
- 0
src/components/misc/contactUs.vue Dosyayı Görüntüle

@@ -22,6 +22,7 @@
22 22
       <br />
23 23
       <br />
24 24
     </div>
25
+
25 26
     <div class="row mb-8">
26 27
       <div class="col-md-6">
27 28
         <form action="mailto:info@univateproperties.co.za" method="post" enctype="text/plain">

+ 19
- 25
src/components/timeshare/sell/sellPage.vue Dosyayı Görüntüle

@@ -14,6 +14,7 @@
14 14
         <hr />
15 15
       </div>
16 16
     </div>
17
+    <div v-for="(item, i) in unitConfigurationList" :key="i">{{item}}</div>
17 18
     <div class="row mb-4">
18 19
       <div class="col-md-12">
19 20
         <form
@@ -89,15 +90,7 @@
89 90
               <label for="Region"></label>
90 91
               <select class="form-control" name="region" id="region">
91 92
                 <option value>Please select Region</option>
92
-                <option value="gauteng">Gauteng</option>
93
-                <option value="Kwazulu Natal">Kwazulu Natal</option>
94
-                <option value="mpumalanga">Mpumalanga</option>
95
-                <option value="north west">North West</option>
96
-                <option value="free state">Free State</option>
97
-                <option value="eastern cape">Eastern Cape</option>
98
-                <option value="western cape">Western Cape</option>
99
-                <option value="northern cape">Northern Cape</option>
100
-                <option value="limpopo">Limpopo</option>
93
+                <option v-for="(region, r) in regions" :key="r">{{region.regionName}}</option>
101 94
               </select>
102 95
             </div>
103 96
             <div class="col-md-6">
@@ -385,35 +378,36 @@
385 378
   </div>
386 379
 </template>
387 380
 <script>
388
-import { mapState, mapActions } from "vuex";
381
+import { mapState, mapActions } from 'vuex';
389 382
 
390 383
 export default {
391
-  name: "TimeshareToSell",
384
+  name: 'TimeshareToSell',
392 385
   created() {
393 386
     this.initTimeshare();
394 387
   },
395 388
   computed: {
396
-    ...mapState("timeshare", [
397
-      "resorts",
398
-      "regions",
399
-      "detailedRegion",
400
-      "seasons",
401
-      "resortBedrooms",
402
-      "maxBedrooms",
403
-      "bankedEntities",
404
-      "sellItem",
405
-      "agencies",
406
-      "agents"
389
+    ...mapState('timeshare', [
390
+      'resorts',
391
+      'regions',
392
+      'detailedRegion',
393
+      'seasons',
394
+      'unitConfigurationList',
395
+      'resortBedrooms',
396
+      'maxBedrooms',
397
+      'bankedEntities',
398
+      'sellItem',
399
+      'agencies',
400
+      'agents',
407 401
     ]),
408 402
     refAgent() {
409 403
       return this.sellItem && this.sellItem.referedByAgent;
410
-    }
404
+    },
411 405
   },
412 406
   methods: {
413 407
     changeRef() {
414 408
       this.sellItem.referedByAgent = !this.sellItem.referedByAgent;
415 409
     },
416
-    ...mapActions("timeshare", ["initTimeshare"])
417
-  }
410
+    ...mapActions('timeshare', ['initTimeshare']),
411
+  },
418 412
 };
419 413
 </script>

+ 1
- 1
src/store/modules/timeshare/status.js Dosyayı Görüntüle

@@ -13,7 +13,7 @@ export default {
13 13
   getters: {},
14 14
   actions: {
15 15
     getStatusList({
16
-      commit,
16
+      commit
17 17
     }) {
18 18
       axios.get('http://localhost:57260/api/status')
19 19
         .then(result => commit('setStatusList', result.data))

+ 15
- 0
src/store/modules/timeshare/timeshare.js Dosyayı Görüntüle

@@ -10,6 +10,7 @@ export default {
10 10
     regions: [],
11 11
     detailedRegion: [],
12 12
     seasons: [],
13
+    unitConfigurationList: [],
13 14
     resortBedrooms: [],
14 15
     maxBedrooms: [],
15 16
     bankedEntities: [],
@@ -38,6 +39,9 @@ export default {
38 39
     },
39 40
   },
40 41
   mutations: {
42
+    setUnitConfigurationList(state, list) {
43
+      state.unitConfigurationList = list;
44
+    },
41 45
     setAgency(state, agencies) {
42 46
       state.agencies = agencies;
43 47
     },
@@ -77,12 +81,23 @@ export default {
77 81
       commit('setResortBedrooms', MyData.resortBedrooms);
78 82
       commit('setMaxBedrooms', MyData.maxBedrooms);
79 83
       commit('setBankedEntities', MyData.bankedEntities);
84
+      dispatch('getUnitConfigurationList');
80 85
       dispatch('getSeason');
81 86
       dispatch('getAgents');
82 87
       dispatch('getAgencies');
83 88
       dispatch('getResorts');
84 89
       dispatch('getRegions');
85 90
     },
91
+    getUnitConfigurationList({
92
+      commit,
93
+      state,
94
+    }) {
95
+      console.log(111);
96
+      axios.get('/api/unitConfiguration')
97
+        .then(result => commit('setUnitConfigurationList', result.data))
98
+        .catch(console.error);
99
+      console.log(state.unitConfigurationList);
100
+    },
86 101
     getSeasons({
87 102
       commit,
88 103
     }) {

+ 10
- 0
vue.config.js Dosyayı Görüntüle

@@ -0,0 +1,10 @@
1
+module.exports = {
2
+  devServer: {
3
+    proxy: {
4
+      '/api': {
5
+        target: 'http://localhost:57260',
6
+        changeOrigin: true,
7
+      },
8
+    },
9
+  },
10
+};

Loading…
İptal
Kaydet