Commit b0aa63b9 by yanju

修复搜索页面

parent 9a52f0f7
...@@ -172,8 +172,8 @@ ...@@ -172,8 +172,8 @@
.deleteButton{ .deleteButton{
position: absolute; position: absolute;
bottom:60*$length; bottom:30*$length;
left:30*$length; left:60*$length;
width:30*$length; width:30*$length;
height:30*$length; height:30*$length;
border-radius: 50%; border-radius: 50%;
...@@ -192,11 +192,13 @@ ...@@ -192,11 +192,13 @@
} }
.editButton{ .editButton{
position: absolute; position: absolute;
bottom:30*$length; bottom:60*$length;
left:60*$length; left:30*$length;
width:30*$length; width:30*$length;
height:30*$length; height:30*$length;
border-radius: 50%; border-radius: 50%;
background-color: #13ce66; background-color: #13ce66;
@extend %cursorPointer; @extend %cursorPointer;
@extend %flex-row-center; @extend %flex-row-center;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
class="nav-card__label" class="nav-card__label"
:style="{backgroundColor: isBlue ? '#00AAE6' : '#fff'}" :style="{backgroundColor: isBlue ? '#00AAE6' : '#fff'}"
></div> ></div>
<nuxt-link tag="p" :to="{path:navAddress, query:{type:labelId}}" :style="{color: isBlue || fontColor ? '#00AAE6' : '#666'}"> <nuxt-link tag="p" :to="labelId?{path:navAddress, query:{type:labelId}}:{path:navAddress}" :style="{color: isBlue || fontColor ? '#00AAE6' : '#666'}">
<slot></slot> <slot></slot>
</nuxt-link> </nuxt-link>
<div class="nav-card__menu" v-if="isShow===true && childList !== undefined" > <div class="nav-card__menu" v-if="isShow===true && childList !== undefined" >
......
...@@ -183,9 +183,6 @@ ...@@ -183,9 +183,6 @@
this.detailTitle = title; this.detailTitle = title;
this.detailType = type; this.detailType = type;
}); });
globalBus.$on(config.event.listenSearchWord,(val)=>{
this.searchValue = val
})
this.changeHeader(); this.changeHeader();
}, },
watch:{ watch:{
...@@ -207,8 +204,15 @@ ...@@ -207,8 +204,15 @@
clickToSearch(){ clickToSearch(){
let searchValue = this.searchValue; let searchValue = this.searchValue;
this.searchValue = '';
if(this.$route.name.indexOf('search')===-1){
this.$router.push('/search/all?keywords='+searchValue) this.$router.push('/search/all?keywords='+searchValue)
}else{
this.$router.replace('/search/all?keywords='+searchValue)
}
}, },
handleLogout() { handleLogout() {
this.$alert('确认注销登录?', '', { this.$alert('确认注销登录?', '', {
......
...@@ -397,6 +397,8 @@ ...@@ -397,6 +397,8 @@
background-color: transparent; background-color: transparent;
overflow: hidden; overflow: hidden;
.container__abs{ .container__abs{
position: absolute; position: absolute;
top:-100*$length; top:-100*$length;
right:-100*$length; right:-100*$length;
...@@ -411,12 +413,13 @@ ...@@ -411,12 +413,13 @@
.deleteButton{ .deleteButton{
position: absolute; position: absolute;
bottom:60*$length; bottom:30*$length;
left:30*$length; left:60*$length;
width:30*$length; width:30*$length;
height:30*$length; height:30*$length;
border-radius: 50%; border-radius: 50%;
background-color:#ff4949; background-color:#ff4949;
@extend %cursorPointer; @extend %cursorPointer;
@extend %flex-row-center; @extend %flex-row-center;
@extend %animate-transition; @extend %animate-transition;
...@@ -430,13 +433,16 @@ ...@@ -430,13 +433,16 @@
} }
} }
.editButton{ .editButton{
position: absolute; position: absolute;
bottom:30*$length; bottom:60*$length;
left:60*$length; left:30*$length;
width:30*$length; width:30*$length;
height:30*$length; height:30*$length;
border-radius: 50%; border-radius: 50%;
background-color: #13ce66; background-color: #13ce66;
@extend %cursorPointer; @extend %cursorPointer;
@extend %flex-row-center; @extend %flex-row-center;
@extend %animate-transition; @extend %animate-transition;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
<div class="search-center__content"> <div class="search-center__content">
<!-- <transition name="fade-transform" mode="out-in">--> <!-- <transition name="fade-transform" mode="out-in">-->
<nuxt-child :total="total" :keywords="keywords" :resultList="resultList"></nuxt-child> <nuxt-child keep-alive :total="total" :keywords="keywords" :resultList="resultList"></nuxt-child>
<!-- </transition>--> <!-- </transition>-->
<pagination style="margin: 30px auto;" :pages="pages" ref="pagination" v-on:listenPageChange="changePage"></pagination> <pagination style="margin: 30px auto;" :pages="pages" ref="pagination" v-on:listenPageChange="changePage"></pagination>
...@@ -104,7 +104,6 @@ ...@@ -104,7 +104,6 @@
], ],
resultList:[], resultList:[],
pages:1, pages:1,
keywords:'',
total:0 total:0
} }
}, },
...@@ -114,15 +113,19 @@ ...@@ -114,15 +113,19 @@
watch:{ watch:{
$route(){ $route(){
globalBus.$emit(config.event.listenSearchWord,this.keywords) if(this.$route.query.keywords){
this.keywords = this.$route.query.keywords;
}else{
this.resultList = []; this.resultList = [];
this.total = 0; this.total = 0;
this.restartPagination(); this.restartPagination();
this.dataGetSearch(1,this.keywords); this.dataGetSearch(1,this.keywords);
}
}, },
keywords(val){ keywords(val){
this.resultList = []; this.resultList = [];
globalBus.$emit(config.event.listenSearchWord,val)
this.total = 0; this.total = 0;
this.restartPagination(); this.restartPagination();
this.dataGetSearch(1); this.dataGetSearch(1);
......
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