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

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

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

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

@ -206,8 +206,21 @@ class CoursesNew extends Component {
if (response.data.status === 0) {
// this.goback()
window.location.href=first_category_url+"?exhibition=true";
window.sessionStorage.setItem('yslGuideone', true);
window.location.href=first_category_url;
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) => {
console.log(error)
@ -251,8 +264,20 @@ class CoursesNew extends Component {
).then((response) => {
if (response.status === 200) {
// this.goback
window.location.href=response.data.first_category_url+"?exhibition=true";
window.sessionStorage.setItem('yslGuideone', true);
window.location.href=response.data.first_category_url;
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) => {
console.log(error)
@ -405,9 +430,10 @@ class CoursesNew extends Component {
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
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)
// form合并了
console.log("获取到的数据");
console.log(this.state);
console.log(this.props);
console.log(this.props.current_user);

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

Loading…
Cancel
Save