123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <template>
- <section id="intro">
- <div class="container">
- <div class="row">
- <div align="left" class="col-sm-12 col-md-8">
- <div class="intro-content box" style="margin-top:-5px">
- <h2>Find your Timeshare</h2>
- <p>
- Please specify one or more details to view the available weeks and then select the
- weeks that interest you on the resort page.
- </p>
- <div class="row">
- <div class="form-group col-md-6">
- <div class="input-group">
- <label v-if="!searchParams.region" class="uniSelectLabel" for="region"
- >REGION</label
- >
- <select
- class="form-control uniSelect"
- name="region"
- id="region"
- v-model="searchParams.region"
- @change="regionChange"
- >
- <option v-for="(region, r) in regions" :key="r">{{ region.regionName }}</option>
- </select>
- </div>
- <br />
- <label>DATE FROM</label>
- <input
- type="date"
- name="arrival-to"
- class="form-control my-1 uniSelect"
- id="arrival-to"
- placeholder="Date From"
- v-model="filter.date"
- />
- </div>
- <div class="form-group col-md-6">
- <div class="input-group">
- <label
- v-if="!searchParams.resort"
- class="uniSelectLabel"
- for="weekInfoResortSelect"
- >RESORT</label
- >
- <select
- id="weekInfoResortSelect"
- class="form-control uniSelect"
- v-model="searchParams.resort"
- >
- <option
- v-for="(resort, r) in filteredResort"
- :key="r"
- :value="resort"
- @change="resortChange"
- >
- {{ resort.resortName }}
- </option>
- </select>
- </div>
- <br />
- <label>DATE TO</label>
- <input
- type="date"
- name="arrival-to"
- class="form-control my-1 uniSelect"
- id="arrival-to"
- placeholder="Date To"
- v-model="filter.ddate"
- />
- </div>
- </div>
- <button class="btn-solid-blue" @click="Search()">
- <i class="fa fa-search"></i> SEARCH
- </button>
- </div>
- </div>
- </div>
- </div>
-
- <carousel
- :nav="false"
- :dots="false"
- :items="1"
- :autoplay="true"
- :loop="true"
- id="intro-carousel"
- style="margin-top:-50px"
- :responsive="{ 0: { items: 1, nav: false }, 600: { items: 1, nav: false } }"
- >
- <img class="item" src="/img/intro-carousel/timeshare-1.jpg" style="object-fit: cover" alt />
- <img class="item" src="/img/intro-carousel/timeshare-2.jpg" style="object-fit: cover" alt />
- <img class="item" src="/img/intro-carousel/timeshare-3.jpg" style="object-fit: cover" alt />
- <img class="item" src="/img/intro-carousel/timeshare-4.jpg" style="object-fit: cover" alt />
- <img class="item" src="/img/intro-carousel/timeshare-5.jpg" style="object-fit: cover" alt />
- <img class="item" src="/img/intro-carousel/timeshare-6.jpg" style="object-fit: cover" alt />
- </carousel>
-
- <div id="intro-carousel" class="owl-carousel"></div>
- </section>
- </template>
-
- <script>
- /* eslint-disable */
-
- import carousel from "vue-owl-carousel";
- import { mapState, mapActions, mapGetters } from "vuex";
- export default {
- components: {
- carousel
- },
- data() {
- return {
- regionObj: {},
- resortObj: {},
- region: "",
- resort: "",
- priceMin: undefined,
- priceMax: undefined
- };
- },
- methods: {
- ...mapActions("timeshare", ["initTimeshare", "onResortChange", "saveWeek"]),
- ...mapActions("resort", ["getResortWithListings"]),
- regionChange(item) {
- let reg = this.regions.find(r => r.regionName === item.target.value);
- this.regionObj = reg;
- },
- resortChange(item) {
- let res = this.resorts.find(r => r.resortName === item.target.value);
- this.resortObj = res;
- },
- Search() {
- if (this.searchParams.price) {
- this.filter.minPrice = this.searchParams.price;
- }
- if (this.searchParams.week) {
- this.filter.keyword = this.week;
- }
-
- if (!this.searchParams.resort) {
- this.searchParams.regionObj = this.regionObj;
- this.$router.push("/timeshareToByResults");
- } else {
- this.$router.push(`/resort/${this.searchParams.resort.resortId}`);
- }
- }
- },
- computed: {
- ...mapState("timeshare", ["resorts", "regions", "detailedRegion"]),
- ...mapState("weekList", ["searchParams", "filter"]),
- ...mapState("resort", ["resortsWithListings"]),
- filteredResort() {
- let list = [];
- var itemList = [];
- if (this.searchParams.region && this.searchParams.region !== "") {
- this.resortsWithListings.forEach(resortListing => {
- if (
- resortListing.resortRegion[0].code.toUpperCase() ===
- this.regionObj.regionCode.toUpperCase()
- ) {
- itemList.push(resortListing);
- }
- });
- if (itemList.length > 0) {
- list = itemList;
- } else {
- list[0] = {
- resortName: " - No Listings - "
- };
- }
- } else {
- list = this.resortsWithListings;
- }
- return _.sortBy(list, x => x.resortName);
- }
- // filteredResort() {
- // let list = [];
- // if (this.searchParams.region && this.searchParams.region !== "") {
- // const item = this.detailedRegion.find(
- // region => region.region.regionCode === this.regionObj.regionCode
- // );
- // if (item) {
- // list = item.children;
- // }
- // } else {
- // list = this.resorts;
- // }
- // return _.sortBy(list, x => x.resortName);
- // }
- },
- created() {
- this.initTimeshare(this.weekId);
- this.getResortWithListings();
- },
- mounted() {
- this.searchParams.region = null;
- this.searchParams.resort = null;
- this.filter.date = null;
- this.filter.ddate = null;
- }
- };
- </script>
-
- <style lang="scss" scoped></style>
|