Browse Source

Merge remote-tracking branch 'origin/master'

master
George Williams 5 years ago
parent
commit
1e96a14262

+ 12
- 6
src/components/timeshare/buy/buyPage.vue View File

@@ -59,7 +59,10 @@
59 59
                   >
60 60
                     <div class="card-body">
61 61
                       <p class="mb-0" v-for="(resort, i) in region.resorts" :key="i">
62
-                        <a class="text-capitalize" href="/resort/">{{resort.resortName}}</a>
62
+                        <a
63
+                          class="text-capitalize"
64
+                          @click="routerGoTo('/resort/' + resort.resortCode)"
65
+                        >{{resort.resortName}}</a>
63 66
                         <br />
64 67
                       </p>
65 68
                     </div>
@@ -74,18 +77,21 @@
74 77
   </section>
75 78
 </template>
76 79
 <script>
77
-import { mapState, mapActions } from "vuex";
80
+import { mapState, mapActions } from 'vuex';
78 81
 
79 82
 export default {
80
-  name: "TimeshareToBuy",
83
+  name: 'TimeshareToBuy',
81 84
   mounted() {
82 85
     this.getRegions();
83 86
   },
84 87
   computed: {
85
-    ...mapState("timeshareBuy", ["detailedRegion"])
88
+    ...mapState('timeshareBuy', ['detailedRegion']),
86 89
   },
87 90
   methods: {
88
-    ...mapActions("timeshareBuy", ["getRegions"])
89
-  }
91
+    ...mapActions('timeshareBuy', ['getRegions']),
92
+    routerGoTo(goTo) {
93
+      this.$router.push(goTo);
94
+    },
95
+  },
90 96
 };
91 97
 </script>

+ 246
- 2
src/components/timeshare/resort/resortPage.vue View File

@@ -1,8 +1,252 @@
1 1
 <template>
2
-  <div></div>
2
+  <div>
3
+    <section>
4
+      <section class="intro-single">
5
+        <div class="container">
6
+          <div class="row">
7
+            <div class="col-md-12 col-lg-8">
8
+              <div class="title-single-box">
9
+                <h1 class="title-single" style="text-align:left;">{{resort.prName}}</h1>
10
+              </div>
11
+            </div>
12
+          </div>
13
+        </div>
14
+      </section>
15
+      <div class="myMargin">
16
+        <div class="row">
17
+          <div class="col-md-3">
18
+            <h2>Filter Resorts</h2>
19
+            <form
20
+              id="mainForm"
21
+              method="POST"
22
+              action="/filter"
23
+              accept-charset="UTF-8"
24
+              enctype="multipart/form-data"
25
+            >
26
+              <div class="form-group">
27
+                <select class="form-control" name="region" id="region">
28
+                  <option value>Region</option>
29
+                </select>
30
+              </div>
31
+              <div class="form-group">
32
+                <select class="form-control" id="resort" name="resort">
33
+                  <option value>Resort</option>
34
+                </select>
35
+              </div>
36
+              <div class="form-group">
37
+                <select class="form-control" name="season">
38
+                  <option value>
39
+                    <span style="color:white;">Season</span>
40
+                  </option>
41
+                </select>
42
+              </div>
43
+              <div class="form-group">
44
+                <select class="form-control" name="bedrooms">
45
+                  <option value>Bedrooms</option>
46
+                </select>
47
+              </div>
48
+
49
+              <div class="form-group">
50
+                <input
51
+                  class="form-control"
52
+                  type="number"
53
+                  step="any"
54
+                  id="minPrice"
55
+                  name="minPrice"
56
+                  placeholder="Minimum Price"
57
+                />
58
+              </div>
59
+              <div class="form-group">
60
+                <input
61
+                  class="form-control"
62
+                  type="number"
63
+                  step="any"
64
+                  id="maxPrice"
65
+                  name="maxPrice"
66
+                  placeholder="Maximum Price"
67
+                />
68
+              </div>
69
+              <div class="form-group">
70
+                <label>Filter Arrival Date From</label>
71
+                <input
72
+                  style="color: white;"
73
+                  class="form-control"
74
+                  type="date"
75
+                  id="fromDate"
76
+                  name="fromDate"
77
+                  placeholder="Arrival Date"
78
+                />
79
+              </div>
80
+              <div class="form-group">
81
+                <label>Filter Arrival Date To</label>
82
+                <input
83
+                  style="color: white;"
84
+                  class="form-control"
85
+                  type="date"
86
+                  id="toDate"
87
+                  name="toDate"
88
+                  placeholder="Departure Date"
89
+                />
90
+              </div>
91
+
92
+              <br />
93
+
94
+              <button class="btn btn-blue" type="submit">SEARCH</button>
95
+            </form>
96
+            <div class="col-md-12 blue-bg p-2 p-md-4">
97
+              <h2>Facilities</h2>
98
+              <ul>
99
+                <li v-for="(item, i) in resort.prUnitFacilities.split('\n')" :key="i">{{item}}</li>
100
+              </ul>
101
+            </div>
102
+          </div>
103
+          <div class="col-md-9">
104
+            <table class="table table-bordered">
105
+              <thead>
106
+                <tr>
107
+                  <th>Resort</th>
108
+                  <th>Unit Number</th>
109
+                  <th>Week Number</th>
110
+                  <th>Module</th>
111
+                  <th>Bedrooms</th>
112
+                  <th>Season</th>
113
+                  <th>Price</th>
114
+                  <th>Status</th>
115
+                  <th>Interested</th>
116
+                </tr>
117
+              </thead>
118
+              <tbody>
119
+                <tr v-for="(item, i) in week" :key="i">
120
+                  <td>{{item.id}}</td>
121
+                  <td>{{item.code}}</td>
122
+                  <td>{{item.description}}</td>
123
+                  <td>{{item.id}}</td>
124
+                  <td>{{item.code}}</td>
125
+                  <td>{{item.description}}</td>
126
+                  <td>{{item.id}}</td>
127
+                  <td>{{item.code}}</td>
128
+                  <td>{{item.description}}</td>
129
+                </tr>
130
+              </tbody>
131
+            </table>
132
+            <div>
133
+              <div class="btn btn-primary" @click="routerGoTo('/timeshare/buy')">Back to Region</div>
134
+              <hr />
135
+            </div>
136
+            {{resort.prNotes}}
137
+            <hr />
138
+            <div class="row mb-4">
139
+              <div class="col-md-4">
140
+                <img class="img-fluid" :src="image1" alt="Resort Image" />
141
+              </div>
142
+              <div class="col-md-4">
143
+                <img class="img-fluid" :src="image2" alt="Resort Image" />
144
+              </div>
145
+              <div class="col-md-4">
146
+                <img class="img-fluid" :src="image3" alt="Resort Image" />
147
+              </div>
148
+            </div>
149
+            <div class="row">
150
+              <div class="col-md-12 mb-4">
151
+                <ul class="nav nav-tabs" id="myTab" role="tablist">
152
+                  <li class="nav-item">
153
+                    <a
154
+                      class="nav-link active"
155
+                      id="directions-tab"
156
+                      data-toggle="tab"
157
+                      href="#directions"
158
+                      role="tab"
159
+                      aria-controls="directions"
160
+                      aria-selected="false"
161
+                    >Directions</a>
162
+                  </li>
163
+                  <li class="nav-item">
164
+                    <a
165
+                      class="nav-link"
166
+                      id="resort-layout-tab"
167
+                      data-toggle="tab"
168
+                      href="#resort-layout"
169
+                      role="tab"
170
+                      aria-controls="resort-layout"
171
+                      aria-selected="true"
172
+                    >Resort Layout</a>
173
+                  </li>
174
+                </ul>
175
+                <div class="tab-content" id="myTabContent">
176
+                  <div
177
+                    class="tab-pane fade show active"
178
+                    id="directions"
179
+                    role="tabpanel"
180
+                    aria-labelledby="directions-tab"
181
+                  >
182
+                    <iframe
183
+                      :src="mapUrl"
184
+                      width="100%"
185
+                      height="450"
186
+                      frameborder="0"
187
+                      style="border:0"
188
+                      allowfullscreen
189
+                    ></iframe>
190
+                    <br />
191
+
192
+                    <small>
193
+                      <a
194
+                        :href="mapUrl"
195
+                        style="color:#0000FF;text-align:left"
196
+                        target="_blank"
197
+                      >See map bigger</a>
198
+                    </small>
199
+                  </div>
200
+                  <div
201
+                    class="tab-pane fade"
202
+                    id="resort-layout"
203
+                    role="tabpanel"
204
+                    aria-labelledby="resort-layout-tab"
205
+                  >
206
+                    <img class="img-fluid" :src="layout" alt="Resort Layout" />
207
+                  </div>
208
+                </div>
209
+              </div>
210
+            </div>
211
+          </div>
212
+        </div>
213
+      </div>
214
+    </section>
215
+  </div>
3 216
 </template>
4 217
 <script>
5
-export default {};
218
+import { mapState, mapActions } from 'vuex';
219
+
220
+export default {
221
+  props: {
222
+    resortCode: {},
223
+  },
224
+  mounted() {
225
+    this.initResort(this.resortCode);
226
+  },
227
+  computed: {
228
+    ...mapState('resort', ['resort', 'image1', 'image2', 'image3', 'layout']),
229
+    mapUrl() {
230
+      return this.resort
231
+        ? 'http://maps.google.com/maps?q='
232
+            + this.resort.prLatitude
233
+            + ', '
234
+            + this.resort.prLongitude
235
+            + '&z=15&output=embed'
236
+        : '';
237
+    },
238
+  },
239
+  methods: {
240
+    ...mapActions('resort', ['initResort']),
241
+    routerGoTo(goto) {
242
+      this.$router.push(goto);
243
+    },
244
+  },
245
+};
6 246
 </script>
7 247
 <style>
248
+.myMargin {
249
+  margin-left: 2%;
250
+  margin-right: 2%;
251
+}
8 252
 </style>

+ 1
- 1
src/router/index.js View File

@@ -109,7 +109,7 @@ export default new Router({
109 109
     component: ContactUs,
110 110
   },
111 111
   {
112
-    path: 'resort/:resortCode',
112
+    path: '/resort/:resortCode',
113 113
     name: 'ResortPage',
114 114
     component: ResortPage,
115 115
     props: true,

+ 2
- 0
src/store/index.js View File

@@ -7,6 +7,7 @@ import StatusModule from './modules/timeshare/status';
7 7
 import UnitConfigurationModule from './modules/timeshare/unitConfiguration';
8 8
 import TimeshareBuyModule from './modules/timeshare/buyPage';
9 9
 import SearchTabModule from './modules/searchTab';
10
+import ResortModule from './modules/timeshare/resort';
10 11
 
11 12
 Vue.use(Vuex);
12 13
 /* eslint no-param-reassign: ["error", { "props": false }] */
@@ -18,5 +19,6 @@ export default new Vuex.Store({
18 19
     unitConfiguration: UnitConfigurationModule,
19 20
     timeshareBuy: TimeshareBuyModule,
20 21
     searchTab: SearchTabModule,
22
+    resort: ResortModule,
21 23
   },
22 24
 });

+ 96
- 0
src/store/modules/timeshare/resort.js View File

@@ -0,0 +1,96 @@
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
+    resort: {},
9
+    image1: '',
10
+    image2: '',
11
+    image3: '',
12
+    layout: '',
13
+  },
14
+  mutations: {
15
+    setResort(state, resort) {
16
+      state.resort = resort;
17
+    },
18
+    clear(state) {
19
+      state.resort = {};
20
+      state.image1 = '';
21
+      state.image2 = '';
22
+      state.image3 = '';
23
+      state.layout = '';
24
+    },
25
+    setImage1(state, image) {
26
+      state.image1 = `data:image/jpeg;base64,${image}`;
27
+    },
28
+    setImage2(state, image) {
29
+      state.image2 = `data:image/jpeg;base64,${image}`;
30
+    },
31
+    setImage3(state, image) {
32
+      state.image3 = `data:image/jpeg;base64,${image}`;
33
+    },
34
+    setLayout(state, image) {
35
+      state.layout = `data:image/jpeg;base64,${image}`;
36
+    },
37
+  },
38
+  getters: {},
39
+  actions: {
40
+    initResort({
41
+      commit,
42
+      dispatch,
43
+    }, resortCode) {
44
+      commit('clear');
45
+      dispatch('getResort', resortCode);
46
+      dispatch('getImage1', resortCode);
47
+      dispatch('getImage2', resortCode);
48
+      dispatch('getImage3', resortCode);
49
+      dispatch('getLayout', resortCode);
50
+    },
51
+    getResort({
52
+      commit,
53
+    }, resortCode) {
54
+      axios.get(
55
+        `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/TRESORT/${
56
+          resortCode}`,
57
+      )
58
+        .then((result) => {
59
+          commit('setResort', result.data);
60
+        })
61
+        .catch(console.error);
62
+    },
63
+    getImage1({
64
+      commit,
65
+    }, resortCode) {
66
+      axios.get(`https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${
67
+        resortCode}/image/1`)
68
+        .then(result => commit('setImage1', result.data))
69
+        .catch(console.error);
70
+    },
71
+    getImage2({
72
+      commit,
73
+    }, resortCode) {
74
+      axios.get(`https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${
75
+        resortCode}/image/2`)
76
+        .then(result => commit('setImage2', result.data))
77
+        .catch(console.error);
78
+    },
79
+    getImage3({
80
+      commit,
81
+    }, resortCode) {
82
+      axios.get(`https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${
83
+        resortCode}/image/3`)
84
+        .then(result => commit('setImage3', result.data))
85
+        .catch(console.error);
86
+    },
87
+    getLayout({
88
+      commit,
89
+    }, resortCode) {
90
+      axios.get(`https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/${
91
+        resortCode}/layout`)
92
+        .then(result => commit('setLayout', result.data))
93
+        .catch(console.error);
94
+    },
95
+  },
96
+};

Loading…
Cancel
Save