ソースを参照

Timeshare chages to Vuex

Added Proxy file
master
Kobus 5年前
コミット
5d78b9e71b

+ 81
- 159
package-lock.json
ファイル差分が大きすぎるため省略します
ファイルの表示


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

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

+ 1
- 0
src/components/misc/contactUs.vue ファイルの表示

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

+ 19
- 25
src/components/timeshare/sell/sellPage.vue ファイルの表示

14
         <hr />
14
         <hr />
15
       </div>
15
       </div>
16
     </div>
16
     </div>
17
+    <div v-for="(item, i) in unitConfigurationList" :key="i">{{item}}</div>
17
     <div class="row mb-4">
18
     <div class="row mb-4">
18
       <div class="col-md-12">
19
       <div class="col-md-12">
19
         <form
20
         <form
89
               <label for="Region"></label>
90
               <label for="Region"></label>
90
               <select class="form-control" name="region" id="region">
91
               <select class="form-control" name="region" id="region">
91
                 <option value>Please select Region</option>
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
               </select>
94
               </select>
102
             </div>
95
             </div>
103
             <div class="col-md-6">
96
             <div class="col-md-6">
385
   </div>
378
   </div>
386
 </template>
379
 </template>
387
 <script>
380
 <script>
388
-import { mapState, mapActions } from "vuex";
381
+import { mapState, mapActions } from 'vuex';
389
 
382
 
390
 export default {
383
 export default {
391
-  name: "TimeshareToSell",
384
+  name: 'TimeshareToSell',
392
   created() {
385
   created() {
393
     this.initTimeshare();
386
     this.initTimeshare();
394
   },
387
   },
395
   computed: {
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
     refAgent() {
402
     refAgent() {
409
       return this.sellItem && this.sellItem.referedByAgent;
403
       return this.sellItem && this.sellItem.referedByAgent;
410
-    }
404
+    },
411
   },
405
   },
412
   methods: {
406
   methods: {
413
     changeRef() {
407
     changeRef() {
414
       this.sellItem.referedByAgent = !this.sellItem.referedByAgent;
408
       this.sellItem.referedByAgent = !this.sellItem.referedByAgent;
415
     },
409
     },
416
-    ...mapActions("timeshare", ["initTimeshare"])
417
-  }
410
+    ...mapActions('timeshare', ['initTimeshare']),
411
+  },
418
 };
412
 };
419
 </script>
413
 </script>

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

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

+ 15
- 0
src/store/modules/timeshare/timeshare.js ファイルの表示

10
     regions: [],
10
     regions: [],
11
     detailedRegion: [],
11
     detailedRegion: [],
12
     seasons: [],
12
     seasons: [],
13
+    unitConfigurationList: [],
13
     resortBedrooms: [],
14
     resortBedrooms: [],
14
     maxBedrooms: [],
15
     maxBedrooms: [],
15
     bankedEntities: [],
16
     bankedEntities: [],
38
     },
39
     },
39
   },
40
   },
40
   mutations: {
41
   mutations: {
42
+    setUnitConfigurationList(state, list) {
43
+      state.unitConfigurationList = list;
44
+    },
41
     setAgency(state, agencies) {
45
     setAgency(state, agencies) {
42
       state.agencies = agencies;
46
       state.agencies = agencies;
43
     },
47
     },
77
       commit('setResortBedrooms', MyData.resortBedrooms);
81
       commit('setResortBedrooms', MyData.resortBedrooms);
78
       commit('setMaxBedrooms', MyData.maxBedrooms);
82
       commit('setMaxBedrooms', MyData.maxBedrooms);
79
       commit('setBankedEntities', MyData.bankedEntities);
83
       commit('setBankedEntities', MyData.bankedEntities);
84
+      dispatch('getUnitConfigurationList');
80
       dispatch('getSeason');
85
       dispatch('getSeason');
81
       dispatch('getAgents');
86
       dispatch('getAgents');
82
       dispatch('getAgencies');
87
       dispatch('getAgencies');
83
       dispatch('getResorts');
88
       dispatch('getResorts');
84
       dispatch('getRegions');
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
     getSeasons({
101
     getSeasons({
87
       commit,
102
       commit,
88
     }) {
103
     }) {

+ 10
- 0
vue.config.js ファイルの表示

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

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