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

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
             </div>
87
             </div>
88
           </div>
88
           </div>
89
           <div class="col-md-9">
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
             <div>
91
             <div>
119
               <div class="btn btn-b-n" @click="routerGoTo('/timeshare/buy')">Back to Region</div>
92
               <div class="btn btn-b-n" @click="routerGoTo('/timeshare/buy')">Back to Region</div>
120
               <hr />
93
               <hr />
202
 </template>
175
 </template>
203
 <script>
176
 <script>
204
 import { mapState, mapActions } from 'vuex';
177
 import { mapState, mapActions } from 'vuex';
178
+import WeekList from '../buy/weekListComponent.vue';
205
 
179
 
206
 export default {
180
 export default {
207
   props: {
181
   props: {
208
     resortCode: {},
182
     resortCode: {},
209
   },
183
   },
184
+  components: {
185
+    WeekList,
186
+  },
210
   mounted() {
187
   mounted() {
211
     this.initResort(this.resortCode);
188
     this.initResort(this.resortCode);
212
   },
189
   },
221
     ]),
198
     ]),
222
     mapUrl() {
199
     mapUrl() {
223
       return this.resort
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
 import PropertyList from './modules/property/propertyLists';
14
 import PropertyList from './modules/property/propertyLists';
15
 import PropertyTypes from './modules/property/propertyTypes';
15
 import PropertyTypes from './modules/property/propertyTypes';
16
 import Register from './modules/user/register';
16
 import Register from './modules/user/register';
17
+import WeekList from './modules/timeshare/weekList';
17
 
18
 
18
 Vue.use(Vuex);
19
 Vue.use(Vuex);
19
 /* eslint no-param-reassign: ["error", { "props": false }] */
20
 /* eslint no-param-reassign: ["error", { "props": false }] */
33
     propertyTypes: PropertyTypes,
34
     propertyTypes: PropertyTypes,
34
     registerIndividual: Register,
35
     registerIndividual: Register,
35
     registerAgency: Register,
36
     registerAgency: Register,
37
+    weekList: WeekList,
36
   },
38
   },
37
 });
39
 });

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

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
   devServer: {
2
   devServer: {
3
     proxy: {
3
     proxy: {
4
       '/api': {
4
       '/api': {
5
-        target: 'http://192.168.6.188:5000',
5
+        target: 'http://localhost:57260',
6
         changeOrigin: true,
6
         changeOrigin: true,
7
       },
7
       },
8
     },
8
     },

Loading…
Cancelar
Guardar