Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

residentialCarouselSection.vue 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <div>
  3. <section id="intro">
  4. <div class="container">
  5. <div class="form">
  6. <div class="row">
  7. <div align="left" class="col-sm-12 col-md-8">
  8. <div class="intro-content">
  9. <h2>Find your Home</h2>
  10. <ul class="nav nav-tabs mb-3" id="pills-tab" role="tablist">
  11. <li class="nav-item">
  12. <a
  13. class="nav-link active"
  14. id="buy-tab"
  15. data-toggle="pill"
  16. href="#buy"
  17. role="tab"
  18. aria-controls="buy"
  19. aria-selected="true"
  20. @click="SetSalesType('Sale')"
  21. >
  22. Buy
  23. </a>
  24. </li>
  25. <li class="nav-item">
  26. <a
  27. class="nav-link"
  28. id="rent-tab"
  29. data-toggle="pill"
  30. href="#rent"
  31. role="tab"
  32. aria-controls="rent"
  33. aria-selected="false"
  34. @click="SetSalesType('Rent')"
  35. >
  36. Rent
  37. </a>
  38. </li>
  39. </ul>
  40. <div class="tab-content" id="pills-tabContent">
  41. <div
  42. class="tab-pane fade show active"
  43. id="buy"
  44. role="tabpanel"
  45. aria-labelledby="buy-tab"
  46. >
  47. <h4>Properties for Sale</h4>
  48. <div class="row">
  49. <div align="left" class="form-group col-md-12">
  50. <autoComplete @GoogleAddress="UpdateAddress" />
  51. </div>
  52. </div>
  53. <a v-on:click="SearchClick" class="btn-white-border">
  54. <i class="fa fa-search"></i>
  55. Search
  56. </a>
  57. </div>
  58. <div
  59. class="tab-pane fade"
  60. id="rent"
  61. role="tabpanel"
  62. aria-labelledby="rent-tab"
  63. >
  64. <h4>Rental Properties</h4>
  65. <div class="row">
  66. <div align="left" class="form-group col">
  67. <autoComplete @GoogleAddress="UpdateAddress" />
  68. </div>
  69. </div>
  70. <a v-on:click="SearchClick" class="btn-white-border">
  71. <i class="fa fa-search"></i>
  72. Search
  73. </a>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <carousel
  82. :nav="false"
  83. :dots="false"
  84. :items="1"
  85. :autoplay="true"
  86. :loop="true"
  87. id="intro-carousel"
  88. style="margin-top: -50px;"
  89. :responsive="{
  90. 0: { items: 1, nav: false },
  91. 600: { items: 1, nav: false },
  92. }"
  93. >
  94. <img
  95. class="item"
  96. src="img/intro-carousel/residential-1.jpg"
  97. style="object-fit: cover;"
  98. alt
  99. />
  100. <img
  101. class="item"
  102. src="img/intro-carousel/residential-2.jpg"
  103. style="object-fit: cover;"
  104. alt
  105. />
  106. <img
  107. class="item"
  108. src="img/intro-carousel/residential-3.jpg"
  109. style="object-fit: cover;"
  110. alt
  111. />
  112. <img
  113. class="item"
  114. src="img/intro-carousel/residential-4.jpg"
  115. style="object-fit: cover;"
  116. alt
  117. />
  118. <img
  119. class="item"
  120. src="img/intro-carousel/residential-5.jpg"
  121. style="object-fit: cover;"
  122. alt
  123. />
  124. <img
  125. class="item"
  126. src="img/intro-carousel/residential-6.jpg"
  127. style="object-fit: cover;"
  128. alt
  129. />
  130. </carousel>
  131. </section>
  132. <main id="main" style="margin-top: -20px;">
  133. <div class="container-fluid">
  134. <div class="row">
  135. <div
  136. ref="searchRes"
  137. :class="{ 'searchRes--clicked': clicked }"
  138. class="col-sm-12 searchRes"
  139. >
  140. <searchResult
  141. :class="{ 'searchComponent--clicked ': clicked }"
  142. class="searchComponent"
  143. />
  144. </div>
  145. </div>
  146. </div>
  147. </main>
  148. </div>
  149. </template>
  150. <script>
  151. /* eslint-disable */
  152. import { mapState, mapActions } from 'vuex'
  153. import autoComplete from '../../shared/addressAutoComplete'
  154. import carousel from 'vue-owl-carousel'
  155. import searchResult from '../propertySearchResults'
  156. export default {
  157. components: {
  158. carousel,
  159. autoComplete,
  160. searchResult,
  161. },
  162. data() {
  163. return {
  164. propertyUsageType: 'Residential',
  165. salesType: 'Sale',
  166. searchText: '',
  167. clicked: false,
  168. }
  169. },
  170. computed: {
  171. ...mapState('propertySearch', ['propertySearch']),
  172. },
  173. methods: {
  174. ...mapActions('propertySearch', ['applyFilter']),
  175. SetSalesType(value) {
  176. this.salesType = value
  177. },
  178. SearchClick() {
  179. this.propertySearch.propertyUsageType = this.propertyUsageType
  180. this.propertySearch.salesType = this.salesType
  181. //this.clicked = true;
  182. this.$router.push('/property/residential/searchResult')
  183. },
  184. SelectedFilter(item) {
  185. this.searchText = item
  186. },
  187. UpdateAddress(place) {
  188. this.propertySearch.province = place.province
  189. this.propertySearch.city = place.city
  190. this.propertySearch.suburb = place.suburb
  191. },
  192. },
  193. mounted() {
  194. this.propertySearch.city = 'All'
  195. this.propertySearch.suburb = 'All'
  196. this.propertySearch.province = 'All'
  197. },
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .searchRes {
  202. will-change: transform;
  203. transition: height 500ms;
  204. height: 0px;
  205. }
  206. .searchRes--clicked {
  207. height: 75vh;
  208. }
  209. @media only screen and (max-width: 575px) {
  210. .searchRes--clicked {
  211. height: 100vh;
  212. }
  213. }
  214. @media only screen and (min-width: 576px) {
  215. .searchRes--clicked {
  216. height: 60vh;
  217. }
  218. }
  219. @media only screen and (min-width: 768px) {
  220. .searchRes--clicked {
  221. height: 75vh;
  222. }
  223. }
  224. @media only screen and (min-width: 992px) {
  225. .searchRes--clicked {
  226. height: 60vh;
  227. }
  228. }
  229. @media only screen and (min-width: 1200px) {
  230. .searchRes--clicked {
  231. height: 70vh;
  232. }
  233. }
  234. .searchComponent {
  235. will-change: transform;
  236. transition: opacity 0.2s ease-in-out;
  237. transition-delay: 0.5s;
  238. margin-bottom: 80px;
  239. position: absolute;
  240. width: 100%;
  241. left: 0;
  242. opacity: 0;
  243. }
  244. .searchComponent--clicked {
  245. opacity: 1;
  246. }
  247. .nav-tabs li a {
  248. border-top: none;
  249. border-left: none;
  250. border-right: none;
  251. background-color: white;
  252. border-bottom-color: rgb(27, 117, 187);
  253. border: 1px solid rgb(27, 117, 187);
  254. }
  255. .nav-tabs li :hover {
  256. color: white;
  257. background-color: rgb(27, 117, 187);
  258. }
  259. .nav-tabs li a.active {
  260. border-top: none;
  261. border-left: none;
  262. border-right: none;
  263. color: white;
  264. background-color: rgb(80, 133, 240);
  265. border-bottom-color: rgb(80, 133, 240);
  266. }
  267. .nav-tabs li a :hover {
  268. background-color: transparent;
  269. color: white;
  270. }
  271. </style>