|
|
|
@ -15,7 +15,7 @@ class ShixunPathSearch extends Component{
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
order:"updated_at",
|
|
|
|
|
select:0,
|
|
|
|
|
select:undefined,
|
|
|
|
|
search:"",
|
|
|
|
|
page:1,
|
|
|
|
|
pathList:'',
|
|
|
|
@ -84,14 +84,20 @@ class ShixunPathSearch extends Component{
|
|
|
|
|
|
|
|
|
|
getList=(order,select,search,page )=>{
|
|
|
|
|
|
|
|
|
|
let url='/paths.json?order='+order+'&page='+page;
|
|
|
|
|
if(select!=""){
|
|
|
|
|
url+='&select='+select;
|
|
|
|
|
}
|
|
|
|
|
if(search!=""){
|
|
|
|
|
url+='&search='+search;
|
|
|
|
|
}
|
|
|
|
|
axios.get(url).then((result)=>{
|
|
|
|
|
let url='/paths.json';
|
|
|
|
|
// '?order='+order+'&page='+page;
|
|
|
|
|
// if(select!=""){
|
|
|
|
|
// url+='&select='+select;
|
|
|
|
|
// }
|
|
|
|
|
// if(search!=""){
|
|
|
|
|
// url+='&search='+search;
|
|
|
|
|
// }
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
order:order,
|
|
|
|
|
page:page,
|
|
|
|
|
select:select,
|
|
|
|
|
// search:search
|
|
|
|
|
}}).then((result)=>{
|
|
|
|
|
if(result.status==200){
|
|
|
|
|
this.setState({
|
|
|
|
|
sortList:result.data.tags,
|
|
|
|
@ -104,7 +110,12 @@ class ShixunPathSearch extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
setHistoryFun=(url)=>{
|
|
|
|
|
this.props.history.push(url)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let { order,sortList,search,page,total_count,select }=this.state;
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
@ -114,7 +125,7 @@ class ShixunPathSearch extends Component{
|
|
|
|
|
<div className="path-head pr">
|
|
|
|
|
<div className="edu-txt-center pathNavLine">
|
|
|
|
|
<div className="inline path-nav">
|
|
|
|
|
<li className={select > 0 ? "" : "active"}><a href="/paths">全部</a></li>
|
|
|
|
|
<li className={select > 0 ? "" : "active"}><a onClick={()=>this.changeSelect(null)}>全部</a></li>
|
|
|
|
|
{
|
|
|
|
|
sortList && sortList.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|