瀏覽代碼

Resorts - consolidated Data

master
George Williams 4 年之前
父節點
當前提交
c83c4c2891

+ 5
- 5
src/components/timeshare/resort/contentSection.vue 查看文件

62
     ResortImages,
62
     ResortImages,
63
     gallerySection,
63
     gallerySection,
64
   },
64
   },
65
-  async mounted() {
66
-    await this.initResort(this.resortCode);
67
-    setTimeout(() => (this.boolLoaded = true), 2000);
68
-  },
65
+  // async mounted() {
66
+  //   await this.initResort(this.resortCode);
67
+  //   setTimeout(() => (this.boolLoaded = true), 2000);
68
+  // },
69
   data() {
69
   data() {
70
     return {
70
     return {
71
       index: null,
71
       index: null,
83
     },
83
     },
84
   },
84
   },
85
   methods: {
85
   methods: {
86
-    ...mapActions("resort", ["initResort"]),
86
+    ...mapActions("resort", ["GetResortData"]),
87
     routerGoTo(goto) {
87
     routerGoTo(goto) {
88
       this.$router.push(goto);
88
       this.$router.push(goto);
89
     },
89
     },

+ 6
- 5
src/components/timeshare/resort/resortPage.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <carouselSection v-if="boolLoaded" :resortImages="images" />
3
+    <carouselSection v-if="boolLoaded" :resortImages="resort.images" />
4
     <main id="main" style="margin-top:-20px">
4
     <main id="main" style="margin-top:-20px">
5
       <contentSection :resortCode="resortCode" />
5
       <contentSection :resortCode="resortCode" />
6
     </main>
6
     </main>
26
     resortCode: {},
26
     resortCode: {},
27
   },
27
   },
28
   async created() {
28
   async created() {
29
-    this.initResort(this.resortCode).then(() => {
30
-      setTimeout(() => (this.boolLoaded = true), 2000);
31
-    });
29
+    this.getResortData(this.resortCode);
30
+    // .then(() => {
31
+    //   setTimeout(() => (this.boolLoaded = true), 2000);
32
+    // });
32
   },
33
   },
33
   computed: {
34
   computed: {
34
     ...mapState("resort", ["resort", "description", "images", "layout"]),
35
     ...mapState("resort", ["resort", "description", "images", "layout"]),
39
     },
40
     },
40
   },
41
   },
41
   methods: {
42
   methods: {
42
-    ...mapActions("resort", ["initResort"]),
43
+    ...mapActions("resort", ["getResortData"]),
43
     routerGoTo(goto) {
44
     routerGoTo(goto) {
44
       this.$router.push(goto);
45
       this.$router.push(goto);
45
     },
46
     },

+ 100
- 0
src/components/timeshare/resort/resortPageNew.vue 查看文件

1
+<template>
2
+  <div>
3
+    <carouselSection v-if="!wait" :resortImages="resort.images" />
4
+    <main id="main" style="margin-top:-20px">
5
+      <section>
6
+        <div class="container">
7
+          <div class="row" id="resort-profile">
8
+            <div class="col-md-3">
9
+              <img src="img/listings/property1/property1-gallery.jpg" class="img-fluid" alt />
10
+              <div class="row no-gutters">
11
+                <div class="col-6">
12
+                  <img src="img/listings/property1/property1-gallery.jpg" class="img-fluid" alt />
13
+                </div>
14
+                <div class="col-6">
15
+                  <img src="img/listings/property1/property1-gallery.jpg" class="img-fluid" alt />
16
+                </div>
17
+              </div>
18
+              <gallerySection :images="resort.images" />
19
+              <FilterComponent :hideTop="true" />
20
+            </div>
21
+            <div class="col-md-9 p-5 resort-profile">
22
+              <h2>{{ resort.prName }}</h2>
23
+              <WeekList :resortCode="resortCode" />
24
+              <p v-if="resort.description && resort.description !== ''">{{ resort.description }}</p>
25
+              <br v-if="resort.description && resort.description !== ''" />
26
+              <p>{{ resort.prNotes }}</p>
27
+              <div class="d-flex mt-3">
28
+                <iframe
29
+                  width="100%"
30
+                  height="200"
31
+                  id="gmap_canvas"
32
+                  :src="
33
+                'https://maps.google.com/maps?q=' +
34
+                  resort.prLatitude +
35
+                  ',' +
36
+                  resort.prLongitude +
37
+                  '&hl=en&z=14&amp;output=embed'
38
+              "
39
+                  frameborder="0"
40
+                  scrolling="no"
41
+                  marginheight="0"
42
+                  marginwidth="0"
43
+                ></iframe>
44
+              </div>
45
+            </div>
46
+          </div>
47
+        </div>
48
+      </section>
49
+    </main>
50
+    <div v-if="wait" id="preloader"></div>
51
+  </div>
52
+</template>
53
+
54
+<script>
55
+/* eslint-disable */
56
+import { mapState, mapActions } from "vuex";
57
+import WeekList from "../buy/weekListComponent.vue";
58
+import FilterComponent from "../searchTimeshare.vue";
59
+import ResortImages from "./resortImage.vue";
60
+import gallerySection from "./gallerySection";
61
+import carouselSection from "./carouselSection";
62
+
63
+export default {
64
+  components: {
65
+    carouselSection,
66
+    WeekList,
67
+    FilterComponent,
68
+    ResortImages,
69
+    gallerySection,
70
+  },
71
+  data() {
72
+    return {
73
+      wait: false,
74
+    };
75
+  },
76
+  props: {
77
+    resortCode: {},
78
+  },
79
+  methods: {
80
+    ...mapActions("resort", ["getResortData"]),
81
+    routerGoTo(goto) {
82
+      this.$router.push(goto);
83
+    },
84
+  },
85
+  computed: {
86
+    ...mapState("resort", ["resort"]),
87
+  },
88
+  mounted() {
89
+    this.wait = true;
90
+    this.getResortData(this.resortCode).then((fulfilled) => {
91
+      this.wait = false;
92
+    });
93
+    // .then(() => {
94
+    //   setTimeout(() => (this.boolLoaded = true), 2000);
95
+    // });
96
+  },
97
+};
98
+</script>
99
+
100
+<style lang="scss" scoped></style>

+ 1
- 1
src/components/timeshare/resort/unit/summarySection.vue 查看文件

9
     </div>
9
     </div>
10
     <div class="row mt-5">
10
     <div class="row mt-5">
11
       <div class="col-md-12 col-lg-4">
11
       <div class="col-md-12 col-lg-4">
12
-        <gallerySection :images="images" />
12
+        <gallerySection :images="resort.images" />
13
       </div>
13
       </div>
14
       <div class="col-md-12 col-lg-8 summarySection">
14
       <div class="col-md-12 col-lg-8 summarySection">
15
         <h4>
15
         <h4>

+ 124
- 0
src/components/timeshare/resort/unit/unitPageNew.vue 查看文件

1
+<template>
2
+  <main id="main" style="padding-bottom:50px">
3
+    <carouselSection v-if="!wait" :resortImages="resort.images" />
4
+    <summarySection :resortCode="resortCode" :unitNumber="unitNumber" />
5
+    <div class="container">
6
+      <div class="row mt-5">
7
+        <div class="col">
8
+          <tabSection
9
+            style="margin-bottom:100px"
10
+            :resortCode="resortCode"
11
+            :resortCoords="resort.prPostAdd1"
12
+            :layoutImages="layouts"
13
+            :resortName="resort.prName"
14
+          />
15
+        </div>
16
+      </div>
17
+    </div>
18
+    <div v-if="wait" id="preloader"></div>
19
+  </main>
20
+</template>
21
+
22
+<script>
23
+/* eslint-disable */
24
+import { mapState, mapActions, mapGetters } from "vuex";
25
+import gallerySection from "../gallerySection";
26
+import tabSection from "./tabSection";
27
+import summarySection from "./summarySection";
28
+import carouselSection from "./carouselSection";
29
+
30
+export default {
31
+  name: "unit",
32
+  components: {
33
+    gallerySection,
34
+    tabSection,
35
+    summarySection,
36
+    carouselSection,
37
+  },
38
+  props: {
39
+    resortCode: {},
40
+    unitNumber: {},
41
+  },
42
+  data() {
43
+    return {
44
+      wait: false,
45
+    };
46
+  },
47
+  mounted() {
48
+    // await this.initResort(this.resortCode);
49
+    // if (this.resortCode) {
50
+    //   this.applyResortFilter(this.resortCode);
51
+    // }
52
+    // await this.layouts.push(this.layout);
53
+    // await this.getWeeks();
54
+    // setTimeout(() => {
55
+    //   this.boolLoaded = true;
56
+    // }, 500);
57
+    this.wait = true;
58
+    this.getResortData(this.resortCode).then((fulfilled) => {
59
+      this.applyResortFilter(this.resortCode);
60
+      this.getWeeks();
61
+      this.wait = false;
62
+    });
63
+  },
64
+  computed: {
65
+    ...mapState("resort", ["resort"]),
66
+
67
+    ...mapGetters({
68
+      weekById: "weekList/weekById",
69
+    }),
70
+    week() {
71
+      return this.weekById(this.resortCode, this.unitNumber);
72
+    },
73
+    layouts() {
74
+      var layouts = [];
75
+      layouts.push(this.resort.layout);
76
+      return layouts;
77
+    },
78
+    // ...mapState('week', ['currentWeek']),
79
+  },
80
+  methods: {
81
+    ...mapActions("weekList", ["getWeeks", "applyResortFilter"]),
82
+    ...mapActions("resort", ["getResortData"]),
83
+    // ...mapActions('week', ['initWeek']),
84
+    formatPrice(value) {
85
+      if (value) {
86
+        const val = (value / 1).toFixed(2);
87
+        return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
88
+      }
89
+      return "";
90
+    },
91
+  },
92
+};
93
+</script>
94
+
95
+<style lang="scss" scoped>
96
+/* Extra small devices (phones, 600px and down) */
97
+@media only screen and (max-width: 600px) {
98
+  .summarySection {
99
+    margin-top: 1px;
100
+  }
101
+}
102
+
103
+/* Small devices (portrait tablets and large phones, 600px and up) */
104
+@media only screen and (min-width: 600px) {
105
+  .summarySection {
106
+    margin-top: 1px;
107
+  }
108
+}
109
+
110
+/* Medium devices (landscape tablets, 768px and up) */
111
+@media only screen and (min-width: 768px) {
112
+  .summarySection {
113
+    margin-top: -50px;
114
+  }
115
+}
116
+
117
+/* Large devices (laptops/desktops, 992px and up) */
118
+@media only screen and (min-width: 992px) {
119
+}
120
+
121
+/* Extra large devices (large laptops and desktops, 1200px and up) */
122
+@media only screen and (min-width: 1200px) {
123
+}
124
+</style>

+ 2
- 2
src/router/index.js 查看文件

50
 import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
50
 import agentManagementPage from "../components/admin/status/agentsUserManagementPage.vue";
51
 import Fees from "../components/admin/fees/feesPage.vue";
51
 import Fees from "../components/admin/fees/feesPage.vue";
52
 
52
 
53
-import ResortPage from "../components/timeshare/resort/resortPage.vue";
54
-import UnitPage from "../components/timeshare/resort/unit/unitPage.vue";
53
+import ResortPage from "../components/timeshare/resort/resortPageNew.vue";
54
+import UnitPage from "../components/timeshare/resort/unit/unitPageNew.vue";
55
 import ToBuySearch from "../components/timeshare/buy/toBuySearchResults.vue";
55
 import ToBuySearch from "../components/timeshare/buy/toBuySearchResults.vue";
56
 
56
 
57
 import ContactUs from "../components/misc/contactUs.vue";
57
 import ContactUs from "../components/misc/contactUs.vue";

+ 12
- 0
src/store/modules/timeshare/resort.js 查看文件

1
 /* eslint-disable no-restricted-syntax */
1
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable guard-for-in */
2
 /* eslint-disable guard-for-in */
3
 import axios from "axios";
3
 import axios from "axios";
4
+import { reject } from "core-js/fn/promise";
4
 
5
 
5
 export default {
6
 export default {
6
   namespaced: true,
7
   namespaced: true,
134
           `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/social/${resortCode}`
135
           `https://www.tradeunipoint.com/unibackend/seam/resource/rest/products/social/${resortCode}`
135
         )
136
         )
136
         .then(result => commit("setResortMedia", result.data));
137
         .then(result => commit("setResortMedia", result.data));
138
+    },
139
+    getResortData({ commit }, resortCode) {
140
+      return new Promise((resolve, reject) => {
141
+        axios
142
+          .get(`/api/resort/GetResortData/${resortCode}`)
143
+          .then(result => {
144
+            commit("setResort", result.data);
145
+            resolve();
146
+          })
147
+          .catch(error => reject(new Error(error.message)));
148
+      });
137
     }
149
     }
138
   }
150
   }
139
 };
151
 };

Loading…
取消
儲存