Commit 9bab4872 by yanju

修复search页面

parent 3459ac2d
......@@ -258,7 +258,8 @@ export default {
listenCommentReget2:'listenCommentReget2',
listenCommentReget3:'listenCommentReget3',
listenDetailInfo:'listenDetailInfo',
listenYunInputIcon:'listenYunInputIcon'
listenYunInputIcon:'listenYunInputIcon',
listenSearchWord:'listenSearchWord'
},
......
......@@ -55,7 +55,8 @@
<script>
import {dateConvert} from "../../action/utils/dataConvert";
import config from '../../action/config'
import config from '../../action/config';
export default {
name: "answerCard",
props:{
......@@ -108,6 +109,8 @@
this.questionId = info.itemId;
this.createTime = dateConvert(info.createTime);
this.userNick = info.author;
this.replyNumber = info.extra?info.extra.replyNumber:0;
this.solved = info.extra?info.extra.solved:false;
}
},
......
<template>
<div>
<project-card :info="info" v-if="info.itemType==='BLOG'||info.itemType==='PROJECT'"></project-card>
<answer-card :info="info" v-if="info.itemType==='ANSWER'"></answer-card>
<answer-card :info="info" v-if="info.itemType==='QUESTION'"></answer-card>
<topic-card :info="info" v-if="info.itemType==='TOPIC'"></topic-card>
<user-card from="other" :info="info" v-if="info.itemType==='USER'"></user-card>
</div>
......@@ -23,21 +23,6 @@
type:Object,
default:()=>({})
}
},
created() {
if(this.info.itemType==="BLOG"||this.info.itemType==="PROJECT"){
}
if(this.info.itemType==="TOPIC"){
}
if(this.info.itemType==="ANSWER"){
}
if(this.info.itemType==="USESR"){
}
}
}
......
......@@ -182,6 +182,9 @@
globalBus.$on(config.event.listenDetailInfo,(title,type,id)=>{
this.detailTitle = title;
this.detailType = type;
});
globalBus.$on(config.event.listenSearchWord,(val)=>{
this.searchValue = val
})
this.changeHeader();
},
......@@ -204,6 +207,7 @@
clickToSearch(){
let searchValue = this.searchValue;
this.$router.push('/search/all?keywords='+searchValue)
},
handleLogout() {
......
......@@ -66,9 +66,10 @@
import NavWrap from "../components/pc/nav/navWrap";
import CardContainer from "../components/pc/cardContainer";
import Pagination from '../components/pc/pagination';
import config from '../action/config'
import config from '../action/config';
import {globalBus} from "../components/common/globalBus";
export default {
export default {
name: "search",
components:{
NavWrap,CardContainer,Pagination
......@@ -109,7 +110,6 @@
},
created() {
this.keywords = this.$route.query.keywords;
this.dataGetSearch(1,this.$route.query.keywords);
},
watch:{
......@@ -117,10 +117,11 @@
this.resultList = [];
this.total = 0;
this.restartPagination();
this.dataGetSearch(1);
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