dev_forum
杨树明 6 years ago
parent 838d4c67e8
commit 1de8282c8d

@ -59,7 +59,8 @@ class DetailCardsEditAndAdd extends Component{
AddShixunBox = () =>{
this.setState({
selectShixun:true,
patheditarry:[]
patheditarry:[],
page:1
})
this.changeTag(0,"");
}
@ -68,6 +69,7 @@ class DetailCardsEditAndAdd extends Component{
cloasShixunBox =()=>{
this.setState({
selectShixun:false,
page:1,
patheditarry:[]
})
}
@ -103,7 +105,8 @@ class DetailCardsEditAndAdd extends Component{
shixuns_listedit:newshixuns_listedit,
shixuns_listeditlist:list,
patheditarry:[],
selectShixun:false
selectShixun:false,
page:1,
})
}).catch((error) => {
console.log(error)
@ -141,8 +144,6 @@ class DetailCardsEditAndAdd extends Component{
changeTag=(id,search)=>{
this.setState({
hometypepvisible:true,
ChooseShixunListshixun_list:[],
page:1
})
let pathId=this.props.pathid;
let {page}=this.state;
@ -156,6 +157,11 @@ class DetailCardsEditAndAdd extends Component{
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
ChooseShixunListshixun_list:[],
page:1
})
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
@ -290,43 +296,46 @@ class DetailCardsEditAndAdd extends Component{
contentViewScrolladd=(e)=>{
let {page}=this.state;
//滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("到达底部");
this.setState({
hometypepvisible:true
})
let pathId=this.props.pathid;
let {search,page,type,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(url).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
search:search,
page:newpage,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
if(page!=1){
this.setState({
hometypepvisible:true
})
let pathId=this.props.pathid;
let {search,page,type,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(url).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
search:search,
page:newpage,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
}
}

Loading…
Cancel
Save