From bf3dcdabc7ba30740604b9f93804a08c1dfe1322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 13 Aug 2019 10:47:43 +0800 Subject: [PATCH] b --- .../src/modules/courses/ListPageIndex.js | 37 +++++++++++-------- .../src/modules/courses/new/CoursesNew.js | 12 ++++-- .../modules/courses/shixunHomework/Guide.js | 3 +- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index 8c87c8731..39eeaf115 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -68,7 +68,7 @@ class ListPageIndex extends Component{ constructor(props) { super(props); this.state={ - yslGuideone:null, + yslGuideone:undefined, } } @@ -88,7 +88,11 @@ class ListPageIndex extends Component{ // navttype:newselectnavid // }) // } - setwindowlocal=(bool)=>{ + componentWillUnmount(){ + window.localStorage.setItem('yslGuideone', false); + + } + setwindowlocal=(bool)=>{ window.localStorage.setItem('yslGuideone', bool); this.setState({ yslGuideone:bool, @@ -96,26 +100,27 @@ class ListPageIndex extends Component{ } render() { let {yslGuideone} =this.state; - // console.log("98"); - // console.log(yslGuideone); + console.log("98"); + console.log(yslGuideone); + console.log(this.props.isAdmin()); + var yslGuideones = window.localStorage.getItem('yslGuideone'); return (
{/*头部banner*/} - {/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/} - {/* (*/} - {/* this.props.isAdmin()===true?*/} - {/* this.setwindowlocal(b)}*/} - {/* >*/} - {/* */} - {/* :""*/} - {/* )*/} - {/* :""*/} - {/*}*/} - + {yslGuideones!==undefined? + ( + yslGuideones===true? + this.setwindowlocal(b)} + > + + :"" + ) + :"" + }
diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 86789b8a2..beb3c74a9 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -76,7 +76,7 @@ class CoursesNew extends Component { Realnamecertification: data.authentication, Professionalcertification:data.professional_certification, }) - + this.handleSearchschool(data.school); }).catch((error) => { console.log(error); }) @@ -93,7 +93,9 @@ class CoursesNew extends Component { }); this.setState({ school:user_school, - }) + }); + this.handleSearchschool(user_school); + } @@ -204,6 +206,7 @@ class CoursesNew extends Component { if (response.data.status === 0) { // this.goback() window.location.href=first_category_url; + window.localStorage.setItem('yslGuideone', true); } }).catch((error) => { console.log(error) @@ -248,6 +251,7 @@ class CoursesNew extends Component { if (response.status === 200) { // this.goback window.location.href=response.data.first_category_url; + window.localStorage.setItem('yslGuideone', true); } }).catch((error) => { console.log(error) @@ -403,7 +407,9 @@ class CoursesNew extends Component { const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => ); // console.log(this.props.current_user.user_school) // form合并了 - + console.log(this.state); + console.log(this.props); + console.log(this.props.current_user); return ( diff --git a/public/react/src/modules/courses/shixunHomework/Guide.js b/public/react/src/modules/courses/shixunHomework/Guide.js index d501b2ab5..d93961518 100644 --- a/public/react/src/modules/courses/shixunHomework/Guide.js +++ b/public/react/src/modules/courses/shixunHomework/Guide.js @@ -21,6 +21,7 @@ class Guide extends Component { } componentDidMount() { + console.log("GuideGuideGuideGuide加载了") // 1366x768 // var mywidthone=7; @@ -59,7 +60,7 @@ class Guide extends Component { page:i, }) if(i===7){ - this.props.setwindowlocal(true); + this.props.setwindowlocal(false); } } render() {