Explorar el Código

Added default list - timeshare

master
Kobus hace 5 años
padre
commit
ac518d59d3

+ 52
- 0
src/components/timeshare/buy/weekListComponent.vue Ver fichero

@@ -0,0 +1,52 @@
1
+<template>
2
+  <div>
3
+    <table class="table table-bordered">
4
+      <thead>
5
+        <tr>
6
+          <th>Resort</th>
7
+          <th>Unit Number</th>
8
+          <th>Week Number</th>
9
+          <th>Module</th>
10
+          <th>Bedrooms</th>
11
+          <th>Season</th>
12
+          <th>Price</th>
13
+          <th>Status</th>
14
+          <th>Interested</th>
15
+        </tr>
16
+      </thead>
17
+      <tbody>
18
+        <tr v-for="(item, i) in weeks" :key="i">
19
+          <td>{{item.id}}</td>
20
+          <td>{{item.code}}</td>
21
+          <td>{{item.description}}</td>
22
+          <td>{{item.id}}</td>
23
+          <td>{{item.code}}</td>
24
+          <td>{{item.description}}</td>
25
+          <td>{{item.id}}</td>
26
+          <td>{{item.code}}</td>
27
+          <td>{{item.description}}</td>
28
+        </tr>
29
+      </tbody>
30
+    </table>
31
+  </div>
32
+</template>
33
+<script>
34
+import { mapState, mapActions } from 'vuex';
35
+
36
+export default {
37
+  props: {
38
+    resortCode: undefined,
39
+  },
40
+  mounted() {
41
+    this.getWeeks(this.resortCode);
42
+  },
43
+  computed: {
44
+    ...mapState('weekList', ['weeks']),
45
+  },
46
+  methods: {
47
+    ...mapActions('weekList', ['getWeeks']),
48
+  },
49
+};
50
+</script>
51
+<style>
52
+</style>

+ 6
- 33
src/components/timeshare/resort/resortPage.vue Ver fichero

@@ -87,34 +87,7 @@
87 87
             </div>
88 88
           </div>
89 89
           <div class="col-md-9">
90
-            <table class="table table-bordered">
91
-              <thead>
92
-                <tr>
93
-                  <th>Resort</th>
94
-                  <th>Unit Number</th>
95
-                  <th>Week Number</th>
96
-                  <th>Module</th>
97
-                  <th>Bedrooms</th>
98
-                  <th>Season</th>
99
-                  <th>Price</th>
100
-                  <th>Status</th>
101
-                  <th>Interested</th>
102
-                </tr>
103
-              </thead>
104
-              <tbody>
105
-                <tr v-for="(item, i) in week" :key="i">
106
-                  <td>{{item.id}}</td>
107
-                  <td>{{item.code}}</td>
108
-                  <td>{{item.description}}</td>
109
-                  <td>{{item.id}}</td>
110
-                  <td>{{item.code}}</td>
111
-                  <td>{{item.description}}</td>
112
-                  <td>{{item.id}}</td>
113
-                  <td>{{item.code}}</td>
114
-                  <td>{{item.description}}</td>
115
-                </tr>
116
-              </tbody>
117
-            </table>
90
+            <WeekList :resortCode="resortCode" />
118 91
             <div>
119 92
               <div class="btn btn-b-n" @click="routerGoTo('/timeshare/buy')">Back to Region</div>
120 93
               <hr />
@@ -202,11 +175,15 @@
202 175
 </template>
203 176
 <script>
204 177
 import { mapState, mapActions } from 'vuex';
178
+import WeekList from '../buy/weekListComponent.vue';
205 179
 
206 180
 export default {
207 181
   props: {
208 182
     resortCode: {},
209 183
   },
184
+  components: {
185
+    WeekList,
186
+  },
210 187
   mounted() {
211 188
     this.initResort(this.resortCode);
212 189
   },
@@ -221,11 +198,7 @@ export default {
221 198
     ]),
222 199
     mapUrl() {
223 200
       return this.resort
224
-        ? 'http://maps.google.com/maps?q='
225
-            + this.resort.prLatitude
226
-            + ', '
227
-            + this.resort.prLongitude
228
-            + '&z=15&output=embed'
201
+        ? `http://maps.google.com/maps?q=${this.resort.prLatitude},${this.resort.prLongitude}&z=15&output=embed`
229 202
         : '';
230 203
     },
231 204
   },

+ 2
- 0
src/store/index.js Ver fichero

@@ -14,6 +14,7 @@ import PropertyAdminModule from './modules/property/propertyAdmin';
14 14
 import PropertyList from './modules/property/propertyLists';
15 15
 import PropertyTypes from './modules/property/propertyTypes';
16 16
 import Register from './modules/user/register';
17
+import WeekList from './modules/timeshare/weekList';
17 18
 
18 19
 Vue.use(Vuex);
19 20
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -33,5 +34,6 @@ export default new Vuex.Store({
33 34
     propertyTypes: PropertyTypes,
34 35
     registerIndividual: Register,
35 36
     registerAgency: Register,
37
+    weekList: WeekList,
36 38
   },
37 39
 });

+ 26
- 0
src/store/modules/timeshare/weekList.js Ver fichero

@@ -0,0 +1,26 @@
1
+/* eslint-disable no-restricted-syntax */
2
+/* eslint-disable guard-for-in */
3
+import axios from 'axios';
4
+
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    weeks: [],
9
+  },
10
+  mutations: {
11
+    setWeeks(state, weeks) {
12
+      state.weeks = weeks;
13
+    },
14
+  },
15
+  getters: {},
16
+  actions: {
17
+    getWeeks({
18
+      commit,
19
+    }, resortCode) {
20
+      axios
21
+        .get(`/api/timeshare/GetByResortCode/${resortCode}`)
22
+        .then(result => commit('setStatusList', result.data))
23
+        .catch(console.error);
24
+    },
25
+  },
26
+};

+ 1
- 1
vue.config.js Ver fichero

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

Loading…
Cancelar
Guardar