Commit b0aa63b9 by yanju

修复搜索页面

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