Commit 180165a4 authored by lixy's avatar lixy

首页综合搜索

parent 072595d6
......@@ -44,7 +44,7 @@
:key="item.id"
style="width:70px;margin-right:10px"
>{{item.name}}</li>
</ul>
</div>
<div class="margin-Top">
......@@ -83,7 +83,7 @@
{{menu.name}}
</el-option>
</el-select>
<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-button slot="append" style="width:88px;height:44px" @click="findTo()">搜索</el-button> -->
</el-input>
<!-- <ul class="users">
......@@ -160,10 +160,11 @@ export default {
page: "",
limit: "",
},
};
},
created() {
this.listQuery.keyword = this.$route.query.keywords;
let router = this.$route.path;
this.router = router;
this.getType();
......@@ -181,7 +182,7 @@ export default {
);
this.vehicleType = child.data.data;
console.log(this.childType);
},
enter() {
var test = window.location.pathname;
......@@ -196,9 +197,10 @@ export default {
this.visibleMap = false;
},
findTo(){
this.$router.push({ path: this.select, query: { keywords: this.listQuery.keyword } });
console.log(this.select);
console.log(this.listQuery.keyword);
this.$emit('childByValue', this.listQuery.keyword);
}
......
......@@ -239,10 +239,13 @@ export default {
footerModal
},
created() {
console.log(this);
this.listQuery.keyword = this.$route.query.keywords;
this.getAll();
},
methods: {
async getAll() {
// this.listQuery.keyword = this.$route.query.keywords;
let {
data: { data }
} = await axios.get(
......
......@@ -3,9 +3,9 @@
<menu-modal></menu-modal>
<div class="main-container">
<div class="wrap" style="background:#fff">
<find-menu @childByValue="childByValue"></find-menu>
<div>
<div class="margin-Top clearfix title-find">
<div style="font-size:18px;font-weight:Bold">房车旅游</div>
......@@ -29,9 +29,9 @@
:page-sizes="[10,20,30, 50]" :page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper" :total="totalCount"></el-pagination>
</div>
</div>
</div>
<footer-modal></footer-modal>
......@@ -48,10 +48,10 @@ export default {
data() {
return {
router: "/",
totalCount:0,
tourDetail: [],
listQuery: {
type: "tour",
keyword: "",
......@@ -67,9 +67,8 @@ export default {
findMenu
},
created() {
this.getAll();
},
methods: {
async getAll() {
......@@ -98,7 +97,7 @@ export default {
childByValue(childValue) {
// childValue就是子组件传过来的值
console.log(childValue);
this.listQuery.keyword = childValue;
this.getAll();
}
......
......@@ -209,7 +209,7 @@ export default {
if (!user) {
return error({ message: 'User not found', statusCode: 404 })
}
let tempBannerData = await axios.get( env.host + '/api/uccn/random/list/app/unauth/get?type=2');
let tempBannerData = await axios.get('/api/uccn/random/list/app/unauth/get?type=2');
let hot = tempBannerData.data.data;
hot.map(function(item){
item.link = encodeURI('/tourDetails/' + item.id+'?name='+item.name);
......@@ -217,7 +217,7 @@ export default {
});
console.log(hot);
let noticeData = await axios.get( env.host + '/api/app/cofig/app/unauth/types?types=14');
let noticeData = await axios.get('/api/app/cofig/app/unauth/types?types=14');
let notice = noticeData.data.data;
return {detail: user, hotList: hot, notice: notice}
},
......
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