Last active
March 10, 2020 18:19
-
-
Save AcheZeta/ce0ef3078452ac73fb3660ab2d99c27a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="home-container"> | |
<Search v-if="filters" :filters="filters" /> | |
<Recommendations :dataRec="dataRec" /> | |
<TabCard :dataFav="dataFav" :topSellers="topSellers" /> | |
<ModalChat :profileChat="profileChat"/> | |
</div> | |
</template> | |
<script> | |
import Vue from 'vue' | |
import Search from './Search.vue' | |
import Recommendations from './Recomendations.vue' | |
import TabCard from './TabCard.vue' | |
import Card from '../Card' | |
import ModalChat from '../ModalChat.vue' | |
export default { | |
name: 'Main', | |
components: { | |
Search, Recommendations, TabCard, Card, ModalChat | |
}, | |
data () { | |
return { | |
dataRec: null, | |
dataFav: null, | |
topSellers: null, | |
profileChat: null, | |
search: null, | |
filters: null | |
} | |
}, | |
mounted () { | |
this.profileChat = null | |
this.getData() | |
}, | |
methods: { | |
async getData () { | |
try { | |
let jsonHome = (await Vue.http.get('/api/home/gethome')).body | |
this.dataRec = jsonHome.recommendation | |
this.dataFav = jsonHome.favourite | |
this.topSellers = jsonHome.topseller | |
this.filters = { | |
bussiness: jsonHome.business, | |
regions: jsonHome.region | |
} | |
console.log(this.filters) | |
} catch (error) { | |
console.error(error) | |
} | |
} | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="mb-4"> | |
<h2 class="text-primary">Encuentre prestadores de servicios turisticos</h2> | |
<div class="row"> | |
<div class="col-md-4"> | |
<multiselect | |
v-model="bussines" | |
:options="filters.bussiness" | |
:multiple="false" | |
track-by="id" | |
label="name_es" | |
placeholder="¿En que región desea buscar?" | |
@input="clickData(bussines)" | |
></multiselect> | |
</div> | |
<div class="col-md-4"> | |
<multiselect | |
v-model="region" | |
:options="filters.regions" | |
:multiple="true" | |
track-by="id" | |
label="name_es" | |
placeholder="¿En que región desea buscar?" | |
@input="clickData(region)" | |
></multiselect> | |
</div> | |
<!-- | |
<div class="col-md-4"> | |
<multiselect v-model="states" | |
:options="filters.regions" | |
:multiple="false" | |
track-by="id" | |
label="name_es" | |
placeholder="¿En que región desea buscar?"> | |
</multiselect> | |
</div> | |
--> | |
</div> | |
</div> | |
</template> | |
<script> | |
import Multiselect from 'vue-multiselect' | |
export default { | |
name: 'Search', | |
props: { | |
filters: { | |
type: Object, | |
required: true | |
} | |
}, | |
components: { | |
Multiselect | |
}, | |
data () { | |
return { | |
bussines: null, | |
region: null, | |
states: null | |
} | |
}, | |
methods: { | |
clickData (filterInput) { | |
// const filterArray = Object.values(filterInput) | |
// console.log(filterArray[0]) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
En tu main
En tu search