|
| 1 | +<template> |
| 2 | + <!-- eslint-disable max-len --> |
| 3 | + <div class="mx-4 sm:mx-16 lg:mx-32"> |
| 4 | + <NavBar v-bind:currentRoute="'Search'"></NavBar> |
| 5 | + <section v-if="searchSubmitted">results</section> |
| 6 | + <section v-if="!searchSubmitted" class="flex flex-col my-8 md:my-12"> |
| 7 | + <div> |
| 8 | + <FilterSlider |
| 9 | + v-bind:min="18" |
| 10 | + v-bind:max="100" |
| 11 | + v-bind:name="'age'" |
| 12 | + v-on:saveFilter="saveFilter"></FilterSlider> |
| 13 | + <FilterSlider |
| 14 | + v-bind:min="18" |
| 15 | + v-bind:max="100" |
| 16 | + v-bind:name="'distance'" |
| 17 | + v-on:saveFilter="saveFilter"></FilterSlider> |
| 18 | + <FilterSlider |
| 19 | + v-bind:min="18" |
| 20 | + v-bind:max="100" |
| 21 | + v-bind:name="'popularity'" |
| 22 | + v-on:saveFilter="saveFilter"></FilterSlider> |
| 23 | + </div> |
| 24 | + <div> |
| 25 | + <MultipleFilters |
| 26 | + v-bind:options="[ |
| 27 | + 'swimming', 'wine', 'reading', 'foodie', 'netflix', 'music', 'yoga', 'golf', |
| 28 | + 'photography', 'baking', 'shopping', 'outdoors', 'art', 'travel', 'hiking', |
| 29 | + 'running', 'volunteering', 'cycling', 'climbing', 'tea', 'fishing', 'soccer', |
| 30 | + 'museum', 'dancing', 'surfing', 'karaoke', 'parties', 'diy', |
| 31 | + 'walking', 'cat lover', 'movies', 'gardening', 'trivia', 'working out', |
| 32 | + 'cooking', 'gamer', 'brunch', 'blogging', 'picknicking', 'athlete', |
| 33 | + 'dog lover', 'politics', 'environmentalism', 'instagram', 'spirituality', |
| 34 | + 'language exchange', 'sports', 'comedy', 'fashion', 'disney', 'vlogging', |
| 35 | + 'astrology', 'board games', 'craft beer', 'coffee', 'writer', |
| 36 | + ]" |
| 37 | + v-bind:name="'interests'" |
| 38 | + v-on:saveFilterMultiple="saveFilterMultiple"></MultipleFilters> |
| 39 | + </div> |
| 40 | + <div class="mx-auto w-full max-w-md"> |
| 41 | + <h1 v-on:click="search()" class="onboarding-sub-container-content-button-outline w-48 text-lg font-normal max-w-full bg-purple-matcha w-full text-white-matcha mx-auto"> |
| 42 | + Search</h1> |
| 43 | + </div> |
| 44 | + </section> |
| 45 | + </div> |
| 46 | +</template> |
| 47 | + |
| 48 | +<script> |
| 49 | +/* eslint-disable max-len */ |
| 50 | +import NavBar from '@/components/shared/NavBar.vue'; |
| 51 | +import FilterSlider from '@/components/shared/FilterSlider.vue'; |
| 52 | +import MultipleFilters from '@/components/shared/MultipleFilters.vue'; |
| 53 | +
|
| 54 | +export default { |
| 55 | + props: ['recommendationsFromSettingUp'], |
| 56 | + components: { |
| 57 | + MultipleFilters, |
| 58 | + NavBar, |
| 59 | + FilterSlider, |
| 60 | + }, |
| 61 | + data: () => ({ |
| 62 | + searchSubmitted: false, |
| 63 | + filters: { |
| 64 | + age: { |
| 65 | + min: null, |
| 66 | + max: null, |
| 67 | + }, |
| 68 | + distance: { |
| 69 | + min: null, |
| 70 | + max: null, |
| 71 | + }, |
| 72 | + popularity: { |
| 73 | + min: null, |
| 74 | + max: null, |
| 75 | + }, |
| 76 | + interests: [], |
| 77 | + }, |
| 78 | + }), |
| 79 | + methods: { |
| 80 | + saveFilter(...range) { |
| 81 | + const [name, min, max] = range; |
| 82 | + this.filters[name].min = min; |
| 83 | + this.filters[name].max = max; |
| 84 | + }, |
| 85 | + saveFilterMultiple(...multiple) { |
| 86 | + const [name, filters] = multiple; |
| 87 | + this.filters[name] = filters; |
| 88 | + }, |
| 89 | + search() { |
| 90 | + this.searchSubmitted = true; |
| 91 | + }, |
| 92 | + }, |
| 93 | +}; |
| 94 | +
|
| 95 | +</script> |
| 96 | + |
| 97 | +<style scoped> |
| 98 | +.home { |
| 99 | + height: calc(100% - 4rem - 2rem); |
| 100 | +} |
| 101 | +</style> |
0 commit comments