dev_oauth
杨树林 6 years ago
parent e31f73ace1
commit 6d974f9a58

@ -69,19 +69,33 @@ class ListPageIndex extends Component{
super(props); super(props);
this.state={ this.state={
yslGuideone:undefined, yslGuideone:undefined,
mysearch:undefined,
} }
} }
componentDidMount(){ componentDidMount(){
var yslGuideone = window.sessionStorage.getItem('yslGuideone');
console.log("77"); console.log("77");
var yslGuideone = window.sessionStorage.getItem('yslGuideone');
console.log("78");
console.log(yslGuideone); console.log(yslGuideone);
var mysearchs= this.props.location.search===""?undefined:this.props.location.search===undefined?undefined:this.props.location.search==="?exhibition=true"?true:undefined; try {
this.setState({ if (yslGuideone === "true") {
yslGuideone:yslGuideone, console.log("true 字符串");
mysearch:mysearchs, this.setState({
}) yslGuideone:true,
})
} else {
this.setState({
yslGuideone:false,
});
console.log("false 字符串");
}
}catch (e) {
console.log(e);
this.setState({
yslGuideone:false,
});
}
} }
// //
@ -93,20 +107,33 @@ class ListPageIndex extends Component{
// }) // })
// } // }
componentWillUnmount(){ componentWillUnmount(){
window.sessionStorage.setItem('yslGuideone', false); window.sessionStorage.setItem('yslGuideone', "false");
} }
setwindowlocal=(bool)=>{ setwindowlocal=(bool)=>{
window.sessionStorage.setItem('yslGuideone', bool); window.sessionStorage.setItem('yslGuideone', bool);
this.setState({ try {
yslGuideone:bool, if (bool === "true") {
mysearch:undefined, console.log("115");
}); console.log("true 字符串");
var currenturl = this.props.location.pathname; this.setState({
var newUrl = (currenturl.split("?"))[0]; yslGuideone:true,
window.history.pushState('','',newUrl); })
} else {
this.setState({
yslGuideone:false,
});
console.log("124");
console.log("false 字符串");
}
}catch (e) {
console.log(e);
this.setState({
yslGuideone:false,
});
}
} }
render() { render() {
let {yslGuideone,mysearch} =this.state; let {yslGuideone} =this.state;
// console.log("98"); // console.log("98");
// console.log(yslGuideone); // console.log(yslGuideone);
// console.log(this.props.isAdmin()); // console.log(this.props.isAdmin());
@ -119,17 +146,17 @@ class ListPageIndex extends Component{
{/*头部banner*/} {/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner> <CoursesBanner {...this.props}></CoursesBanner>
{/*{mysearch!==undefined?*/} {yslGuideone!==undefined?
{/*(*/} (
{/* mysearch===true?*/} yslGuideone===true?
{/* <Guide*/} <Guide
{/* setwindowlocal={(b)=>this.setwindowlocal(b)}*/} setwindowlocal={(b)=>this.setwindowlocal(b)}
{/* >*/} >
{/* </Guide>*/} </Guide>
{/* :""*/} :""
{/* )*/} )
{/* :""*/} :""
{/*}*/} }
<div className="educontent clearfix" style={{flex: "1 0 auto"}}> <div className="educontent clearfix" style={{flex: "1 0 auto"}}>
<div className="stud-class-set"> <div className="stud-class-set">

@ -310,7 +310,7 @@ class BoardsNew extends Component{
<span className="fl font-24 color-grey-3">{this.isEdit ? "编辑" : "新建"}帖子</span> <span className="fl font-24 color-grey-3">{this.isEdit ? "编辑" : "新建"}帖子</span>
<a href="javascript:void(0)" className="color-grey-6 fr font-16 mr2" <a href="javascript:void(0)" className="color-grey-6 fr font-16 mr2"
onClick={() => this.props.history.goBack()}> onClick={() => this.props.history.goBack()}>
返回 {/*返回*/}
</a> </a>
</p> </p>
{/* notRequired */} {/* notRequired */}

@ -283,11 +283,11 @@ class GraduateTaskItem extends Component{
{this.props.isAdmin? {this.props.isAdmin?
<div className="mt13"> <div className="mt13">
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mrf4 fr"> <WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/setting"} className="colorblue font-16 mrf4 fr">
<a className="btn colorblue">编辑</a> <a className="btn colorblue">设置</a>
</WordsBtn> </WordsBtn>
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/setting"} className="colorblue font-16 mr20 fr"> <WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mr20 fr">
<a className="btn colorblue" >设置</a> <a className="btn colorblue" >编辑</a>
</WordsBtn> </WordsBtn>
</div> </div>

@ -206,8 +206,21 @@ class CoursesNew extends Component {
if (response.data.status === 0) { if (response.data.status === 0) {
// this.goback() // this.goback()
window.location.href=first_category_url+"?exhibition=true"; window.location.href=first_category_url;
window.sessionStorage.setItem('yslGuideone', true); var yslGuideone = window.sessionStorage.getItem('yslGuideone');
try {
if(yslGuideone=== null){
window.sessionStorage.setItem('yslGuideone', "true");
return
}
if(yslGuideone=== undefined){
window.sessionStorage.setItem('yslGuideone', "true");
return
}
}catch (e) {
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -251,8 +264,20 @@ class CoursesNew extends Component {
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
// this.goback // this.goback
window.location.href=response.data.first_category_url+"?exhibition=true"; window.location.href=response.data.first_category_url;
window.sessionStorage.setItem('yslGuideone', true); var yslGuideone = window.sessionStorage.getItem('yslGuideone');
try {
if(yslGuideone=== null){
window.sessionStorage.setItem('yslGuideone', "true");
return
}
if(yslGuideone=== undefined){
window.sessionStorage.setItem('yslGuideone', "true");
return
}
}catch (e) {
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -405,9 +430,10 @@ class CoursesNew extends Component {
const propsWithoutForm = Object.assign({}, this.props) const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form delete propsWithoutForm.form
const options = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>); const options = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>); const optionschool = this.state.searchlistscholl===undefined?"":this.state.searchlistscholl===null?"":this.state.searchlistscholl==="[]"?"":this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school) // console.log(this.props.current_user.user_school)
// form合并了 // form合并了
console.log("获取到的数据");
console.log(this.state); console.log(this.state);
console.log(this.props); console.log(this.props);
console.log(this.props.current_user); console.log(this.props.current_user);

@ -60,7 +60,7 @@ class Guide extends Component {
page:i, page:i,
}) })
if(i===7){ if(i===7){
this.props.setwindowlocal(false); this.props.setwindowlocal("false");
} }
} }
render() { render() {

Loading…
Cancel
Save