Commit 180165a4 authored by lixy's avatar lixy

首页综合搜索

parent 072595d6
...@@ -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">
...@@ -164,6 +164,7 @@ export default { ...@@ -164,6 +164,7 @@ export default {
}; };
}, },
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();
...@@ -196,6 +197,7 @@ export default { ...@@ -196,6 +197,7 @@ 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);
......
...@@ -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(
......
...@@ -67,7 +67,6 @@ export default { ...@@ -67,7 +67,6 @@ export default {
findMenu findMenu
}, },
created() { created() {
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