|
|
|
@ -41,7 +41,8 @@ class CoursesNew extends Component {
|
|
|
|
|
searchlist: [],
|
|
|
|
|
searchlistscholl:[],
|
|
|
|
|
listvalue: undefined,
|
|
|
|
|
fetching:false
|
|
|
|
|
fetching:false,
|
|
|
|
|
boolxinjian:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -80,6 +81,9 @@ class CoursesNew extends Component {
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|
boolxinjian:false,
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
let url = "/courses/new.json"
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
@ -96,18 +100,25 @@ class CoursesNew extends Component {
|
|
|
|
|
});
|
|
|
|
|
this.handleSearchschool(user_school);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
boolxinjian:true,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate(prevProps){
|
|
|
|
|
// if(prevProps.current_user!=this.props.current_user){
|
|
|
|
|
// if(this.props.current_user.user_identity==="学生"){
|
|
|
|
|
// window.location.href ="/403"
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
|
if(prevProps.current_user !== this.props.current_user){
|
|
|
|
|
let user_school=this.props.current_user&&this.props.current_user.user_school;
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
school:user_school,
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
school:user_school,
|
|
|
|
|
});
|
|
|
|
|
this.handleSearchschool(user_school);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onChangeTimepublishs = (date, dateString) => {
|
|
|
|
|
if(dateString===""){
|
|
|
|
|
this.setState({
|
|
|
|
@ -207,18 +218,20 @@ class CoursesNew extends Component {
|
|
|
|
|
// this.goback()
|
|
|
|
|
|
|
|
|
|
window.location.href=first_category_url;
|
|
|
|
|
var yslGuideone = window.localStorage.getItem('yslGuideone');
|
|
|
|
|
try {
|
|
|
|
|
if(yslGuideone=== null){
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(yslGuideone=== undefined){
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
if(this.state.boolxinjian===true) {
|
|
|
|
|
var yslGuideone = window.localStorage.getItem('yslGuideone');
|
|
|
|
|
try {
|
|
|
|
|
if (yslGuideone === null) {
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (yslGuideone === undefined) {
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -265,19 +278,23 @@ class CoursesNew extends Component {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
// this.goback
|
|
|
|
|
window.location.href=response.data.first_category_url;
|
|
|
|
|
var yslGuideone = window.localStorage.getItem('yslGuideone');
|
|
|
|
|
try {
|
|
|
|
|
if(yslGuideone=== null){
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(yslGuideone=== undefined){
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
if(this.state.boolxinjian===true){
|
|
|
|
|
var yslGuideone = window.localStorage.getItem('yslGuideone');
|
|
|
|
|
try {
|
|
|
|
|
if(yslGuideone=== null){
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(yslGuideone=== undefined){
|
|
|
|
|
window.localStorage.setItem('yslGuideone', "true");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|