You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

searchTimeshare.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="panel-left p-5">
  3. <h2>Filter Weeks</h2>
  4. <p>*Select at least 1 filter field</p>
  5. <div class="input-group mt-2">
  6. <label v-if="!filter.season" class="uniSelectLabel" for="season">Season</label>
  7. <select class="form-control" name="season" id="season" v-model="filter.season">
  8. <option v-for="season in seasons" :key="season.id" :value="season">{{ season.name }}</option>
  9. </select>
  10. </div>
  11. <div class="input-group mt-2">
  12. <label v-if="!filter.bedrooms" class="uniSelectLabel" for="weekInfoRegionSelect">Bedrooms</label>
  13. <select class="form-control" name="bedrooms" v-model="filter.bedrooms">
  14. <option v-for="(item, i) in resortBedrooms" :key="i">{{ item }}</option>
  15. </select>
  16. </div>
  17. <input
  18. type="text"
  19. name="max-price"
  20. class="form-control my-1"
  21. id="max-price"
  22. placeholder="Maximum Price"
  23. v-model="filter.maxPrice"
  24. />
  25. <p class="mt-2">
  26. Date from
  27. <input
  28. type="date"
  29. name="arrival-from"
  30. class="form-control my-1"
  31. id="arrival-from"
  32. placeholder="mm/dd/yy"
  33. v-model="filter.date"
  34. />
  35. </p>
  36. <p>
  37. Date to
  38. <input
  39. type="date"
  40. name="arrival-to"
  41. class="form-control my-1"
  42. id="arrival-to"
  43. placeholder="mm/dd/yy"
  44. v-model="filter.ddate"
  45. />
  46. </p>
  47. <button class="btn-white-border" @click="ClearFilter()">
  48. <i class="fa fa-eraser"></i> CLEAR
  49. </button>
  50. <!-- <div class="btn-white-border">
  51. <i class="fa fa-search"></i> FILTER
  52. </div>-->
  53. </div>
  54. </template>
  55. <script>
  56. /* eslint-disable */
  57. import { mapState, mapActions } from "vuex";
  58. import _ from "lodash";
  59. export default {
  60. props: {
  61. hideTop: undefined,
  62. keyword: undefined,
  63. },
  64. data() {
  65. return {
  66. selectedSeason: null,
  67. };
  68. },
  69. created() {
  70. this.initTimeshare();
  71. },
  72. computed: {
  73. ...mapState("timeshare", [
  74. "resorts",
  75. "regions",
  76. "detailedRegion",
  77. "resortBedrooms",
  78. "maxSleep",
  79. ]),
  80. ...mapState("weekList", ["filter", "searchParams"]),
  81. ...mapState("timeshare", ["seasons"]),
  82. filteredResorts() {
  83. if (this.selectedRegion) {
  84. const list = _.find(
  85. this.detailedRegion,
  86. (i) => i.region.regionName === this.selectedRegion
  87. ).children;
  88. return _.sortBy(list, (r) => r.resortName);
  89. }
  90. return this.resorts;
  91. },
  92. },
  93. methods: {
  94. ...mapActions("timeshare", ["initTimeshare"]),
  95. ...mapActions("weekList", ["clearFilter"]),
  96. ...mapActions("timeshare", ["getSeasons"]),
  97. ClearFilter() {
  98. this.filter.season = null;
  99. this.filter.bedrooms = null;
  100. this.filter.maxPrice = null;
  101. this.filter.date = null;
  102. this.filter.ddate = null;
  103. },
  104. },
  105. };
  106. </script>
  107. <style lang="scss" scoped>
  108. .uniSelectLabel {
  109. position: absolute;
  110. z-index: 2;
  111. margin-left: 15px;
  112. margin-top: 7px;
  113. font-family: "muli";
  114. font-size: 15px;
  115. color: rgb(118, 118, 118);
  116. }
  117. </style>