Commit 072595d6 authored by linjw's avatar linjw

修改旅游搜索

parent fd0af2a7
......@@ -79,11 +79,12 @@
</nuxt-link>
<el-input placeholder="车型/旅游路线/营地/活动/新闻/子公司" v-model="listQuery.keyword" class="input-with-select menu-select">
<el-select v-model="select" slot="prepend" placeholder="综合" style="width:90px">
<el-option v-for="menu in findList" :key="menu.id" :label="menu.name" :value="menu.value" style="width:90px">
<nuxt-link :to="menu.link" style="color:#666">{{menu.name}}</nuxt-link>
<el-option v-for="menu in findList" :key="menu.id" :label="menu.name" :value="menu.link" style="width:90px">
{{menu.name}}
</el-option>
</el-select>
<el-button slot="append" style="width:88px;height:44px" @click="findTo()">搜索</el-button>
<el-button slot="append" style="width:88px;height:44px" @click="findTo()"><nuxt-link :to='this.select'>搜索</nuxt-link></el-button>
<!-- <el-button slot="append" style="width:88px;height:44px" @click="findTo()">搜索</el-button> -->
</el-input>
<!-- <ul class="users">
<li v-for="menu in menuList" :key="menu.id">
......@@ -143,15 +144,15 @@ export default {
vehicleType: [],
childType:[],
visibleMap: false,
select: "综合",
select: "/findList/all",
findList:[
{ id: 1,value:"1", name: "综合", link: "/findList/all" },
{ id: 2,value:"2", name: "车型", link: "/findList/findVehicle" },
{ id: 3,value:"3", name: "旅游", link: "/findList/findTour" },
{ id: 4,value:"4", name: "营地", link: "/findList/findCampsite" },
{ id: 5,value:"5", name: "活动", link: "/findList/findActivity" },
{ id: 6,value:"6", name: "新闻", link: "/findList/findNew" },
{ id: 7,value:"7", name: "子公司", link: "/findList/findCompany" }
{ id: 1,value:"", name: "综合", link: "/findList/all" },
{ id: 2,value:"vehicle", name: "车型", link: "/findList/findVehicle" },
{ id: 3,value:"tour", name: "旅游", link: "/findList/findTour" },
{ id: 4,value:"campsite", name: "营地", link: "/findList/findCampsite" },
{ id: 5,value:"activity", name: "活动", link: "/findList/findActivity" },
{ id: 6,value:"news", name: "新闻", link: "/findList/findNew" },
{ id: 7,value:"company", name: "子公司", link: "/findList/findCompany" }
],
listQuery: {
type: "",
......@@ -194,16 +195,12 @@ export default {
leave() {
this.visibleMap = false;
},
async findTo() {
let {
data: { data }
} = await axios.get(
`/api/uccn/app/unauth/search?type=${this.listQuery.type}&keyword=${this.listQuery.keyword}&page=${this.listQuery.page}&limit=${this.listQuery.limit}`
);
console.log(data);
if(data.news.totalCount != 0){
this.$router.push('/findList/findNew')
}
findTo(){
console.log(this.select);
console.log(this.listQuery.keyword);
this.$emit('childByValue', this.listQuery.keyword);
}
}
};
......
......@@ -4,7 +4,7 @@
<div class="main-container">
<div class="wrap" style="background:#fff">
<find-menu></find-menu>
<find-menu @childByValue="childByValue"></find-menu>
<div>
<div class="margin-Top clearfix title-find">
......@@ -67,7 +67,9 @@ export default {
findMenu
},
created() {
this.getAll();
},
methods: {
async getAll() {
......@@ -93,6 +95,13 @@ export default {
this.listQuery.page = 1;
this.getAll();
},
childByValue(childValue) {
// childValue就是子组件传过来的值
console.log(childValue);
this.listQuery.keyword = childValue;
this.getAll();
}
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment