Commit 180165a4 authored by lixy's avatar lixy

首页综合搜索

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