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.

searchTab.vue 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <div class="box-collapse">
  4. <div class="title-box-d">
  5. <h3 class="title-d" style="text-align:left">Search</h3>
  6. </div>
  7. <span class="close-box-collapse right-boxed ion-ios-close"></span>
  8. <div class="box-collapse-wrap">
  9. <form class="form-a">
  10. <div class="row">
  11. <div class="col-md-12">
  12. <div class="form-group" style="text-align:left">
  13. <label for="Type">Keyword</label>
  14. <input type="text" class="form-control" placeholder="Keyword" v-model="keyword" />
  15. </div>
  16. </div>
  17. <div class="col-md-12">
  18. <ul class="nav nav-pills-a nav-pills mb-3 section-t3" id="pills-tab" role="tablist">
  19. <li class="nav-item">
  20. <a
  21. class="nav-link active"
  22. id="pills-video-tab"
  23. data-toggle="pill"
  24. href="#pills-video"
  25. role="tab"
  26. aria-controls="pills-video"
  27. aria-selected="true"
  28. v-on:click="updateType('Timeshare')"
  29. >Timeshare</a>
  30. </li>
  31. <li class="nav-item">
  32. <a
  33. class="nav-link"
  34. id="pills-plans-tab"
  35. data-toggle="pill"
  36. href="#pills-plans"
  37. role="tab"
  38. aria-controls="pills-plans"
  39. aria-selected="false"
  40. v-on:click="updateType('Residential')"
  41. >Residential</a>
  42. </li>
  43. <li class="nav-item">
  44. <a
  45. class="nav-link"
  46. id="pills-map-tab"
  47. data-toggle="pill"
  48. href="#pills-map"
  49. role="tab"
  50. aria-controls="pills-map"
  51. aria-selected="false"
  52. v-on:click="updateType('Commercial')"
  53. >Commercial</a>
  54. </li>
  55. </ul>
  56. <div class="tab-content" id="pills-tabContent">
  57. <div
  58. class="tab-pane fade show active"
  59. id="pills-video"
  60. role="tabpanel"
  61. aria-labelledby="pills-video-tab"
  62. >
  63. <timeshareSearch />
  64. </div>
  65. <div
  66. class="tab-pane fade"
  67. id="pills-plans"
  68. role="tabpanel"
  69. aria-labelledby="pills-plans-tab"
  70. >
  71. <propertySearch propertyType="Residential" @updateSearch="updateSearch" />
  72. </div>
  73. <div
  74. class="tab-pane fade"
  75. id="pills-map"
  76. role="tabpanel"
  77. aria-labelledby="pills-map-tab"
  78. >
  79. <propertySearch propertyType="Commercial" @updateSearch="updateSearch" />
  80. </div>
  81. </div>
  82. </div>
  83. <div class="col-md-12">
  84. <button type="submit" class="btn btn-b-n" @click="Search">Search</button>
  85. </div>
  86. </div>
  87. </form>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import propertySearch from '../property/propertySearchFields.vue';
  93. import timeshareSearch from '../timeshare/searchTimeshare.vue';
  94. export default {
  95. components: {
  96. propertySearch,
  97. timeshareSearch,
  98. },
  99. data() {
  100. return {
  101. selectedPropertyType: 'timeshare',
  102. propertySearch: {
  103. userName: '',
  104. salesType: 'Sale',
  105. propertyUsageType: 'All',
  106. propertyType: 'All',
  107. province: 'All',
  108. city: 'All',
  109. suburb: 'All',
  110. minPrice: 0,
  111. maxPrice: 0,
  112. },
  113. };
  114. },
  115. computed: {
  116. ...mapState('weekList', ['filter']),
  117. },
  118. methods: {
  119. updateType(item) {
  120. this.selectedPropertyType = item;
  121. },
  122. updateSearch(item) {
  123. this.propertySearch = item;
  124. this.propertySearch.propertyUsageType = this.selectedPropertyType;
  125. this.propertySearch.keyword = this.filter.keyword;
  126. },
  127. Search() {
  128. if (this.selectedPropertyType === 'timeshare') {
  129. this.$router.push('/timeshare/search/');
  130. } else {
  131. // this.$router.push('/property/search');
  132. this.$router.push({
  133. path: '/property/search',
  134. query: this.propertySearch,
  135. });
  136. }
  137. },
  138. },
  139. };
  140. </script>