yslnewtiku
杨树林 5 years ago
parent 64ca69321a
commit b40f9626f5

@ -54,9 +54,31 @@ class Question extends Component {
page:1, page:1,
per_page:20, per_page:20,
disciplinesdata:[], disciplinesdata:[],
discipline_id:null,
sub_discipline_id:null,
tag_discipline_id:null,
} }
} }
setdiscipline_id=(discipline_id)=>{
this.setState({
discipline_id:discipline_id
})
}
setsub_discipline_id=(sub_discipline_id)=>{
this.setState({
sub_discipline_id:sub_discipline_id
})
}
settag_discipline_id=(tag_discipline_id)=>{
this.setState({
tag_discipline_id:tag_discipline_id
})
}
//初始化 //初始化
componentDidMount() { componentDidMount() {
@ -563,7 +585,12 @@ class Question extends Component {
showDrawer={() => this.showDrawer()} showDrawer={() => this.showDrawer()}
Headertop={Headertop}/> Headertop={Headertop}/>
{/*顶部*/} {/*顶部*/}
<Headplugselection {...this.props} {...this.state}></Headplugselection> <Headplugselection {...this.props} {...this.state}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
></Headplugselection>
{/*头部*/} {/*头部*/}
<Contentpart {...this.state} {...this.props} <Contentpart {...this.state} {...this.props}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}
@ -589,7 +616,9 @@ class Question extends Component {
pageSize={per_page} pageSize={per_page}
total={items_count}></Pagination> total={items_count}></Pagination>
</div> </div>
:"" :<div className="h30 clearfix educontent mt40 intermediatecenter">
</div>
} }

@ -69,7 +69,7 @@ class Contentpart extends Component {
//console.log("Contentpart"); //console.log("Contentpart");
//console.log(this.props); //console.log(this.props);
return ( return (
<div className=" clearfix mt50"> <div className=" clearfix mt40">
<div className="educontent mt10 pb20 w1200s"> <div className="educontent mt10 pb20 w1200s">
<div className="w1200ms contentparttit" style={{ <div className="w1200ms contentparttit" style={{
position: "relative", position: "relative",

@ -15,8 +15,10 @@ class Headplugselection extends Component {
this.state = { this.state = {
page:1, page:1,
titlestting:"全部", titlestting:"全部",
titlesttingid:null,
titlesttings:null, titlesttings:null,
titlesttingss:null, titlesttingss:null,
} }
} }
//初始化 //初始化
@ -24,28 +26,57 @@ class Headplugselection extends Component {
} }
settitlestting=(name)=>{ //
// setdiscipline_id={(e)=>this.setdiscipline_id(e)}
// setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
// settag_discipline_id={(e)=>this.settag_discipline_id(e)}
settitlestting=(name,id)=>{
//如果全部其他的选项重置 //如果全部其他的选项重置
this.setState({ this.setState({
titlestting:name, titlestting:name,
titlesttingid:id,
titlesttings:null, titlesttings:null,
titlesttingss:null titlesttingsid:null,
titlesttingss:null,
titlesttingssid:null
}) })
if(name==="全部"){
this.props.setdiscipline_id(null);
this.props.setsub_discipline_id(null);
this.props.settag_discipline_id(null);
}else{
this.props.setdiscipline_id(id);
this.props.setsub_discipline_id(null);
this.props.settag_discipline_id(null);
}
} }
settitlesttings=(name)=>{ settitlesttings=(name,id)=>{
//课程选项 //课程选项
this.setState({ this.setState({
titlesttings:name, titlesttings:name,
titlesttingsid:id,
titlesttingss:null, titlesttingss:null,
}) })
this.props.setsub_discipline_id(id);
this.props.settag_discipline_id(null);
} }
settitlesttingss=(name)=>{ settitlesttingss=(name,id)=>{
//知识点 //知识点
if(this.state.titlesttings===null){
this.props.showNotification('请先选择课程');
}
this.setState({ this.setState({
titlesttingss:name titlesttingss:name,
titlesttingssid:id
}) })
this.props.settag_discipline_id(id);
} }
render() { render() {
@ -53,22 +84,22 @@ class Headplugselection extends Component {
// console.log("Headplugselection"); // console.log("Headplugselection");
// console.log(this.props.disciplinesdata); // console.log(this.props.disciplinesdata);
return ( return (
<div className=" clearfix mt10 mb20 "> <div className=" clearfix mt21 ">
<div className="educontent w1200"> <div className="educontent w1200">
<div className="clearfix edu-back-white mt21 tophom"> <div className="clearfix edu-back-white tophoms">
{/*课程*/} {/*课程*/}
<div className=" sortinxdirection"> <div className=" sortinxdirection">
<div className="w60 tophomsembolds"> <div className="w60 tophomsembolds">
方向 方向
</div> </div>
<div className="sortinxdirection minleng40"> <div className="sortinxdirection minleng40">
<div className={titlestting==="全部"?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlestting("全部")}> <div className={titlestting==="全部"?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlestting("全部",null)}>
全部 全部
</div> </div>
{this.props.disciplinesdata&&this.props.disciplinesdata.map((object, index) => { {this.props.disciplinesdata&&this.props.disciplinesdata.map((object, index) => {
return ( return (
<div className={titlestting===object.name?" xiaoshou titlesttingcss":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlestting(object.name)}> <div className={titlestting===object.name?" xiaoshou titlesttingcss":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlestting(object.name,object.id)}>
{object.name} {object.name}
</div> </div>
) )
@ -93,7 +124,7 @@ class Headplugselection extends Component {
return ( return (
<div className={index===0&&indexs===0&&titlesttings===object.name?"titlesttingcss xiaoshou":index===0&&indexs===0&&titlesttings!==object.name?"titlesttingcssmy xiaoshou" <div className={index===0&&indexs===0&&titlesttings===object.name?"titlesttingcss xiaoshou":index===0&&indexs===0&&titlesttings!==object.name?"titlesttingcssmy xiaoshou"
:titlesttings===object.name?" titlesttingcss xiaoshou":"titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttings(object.name)}> :titlesttings===object.name?" titlesttingcss xiaoshou":"titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttings(object.name,object.id)}>
{object.name} {object.name}
</div> </div>
) )
@ -104,7 +135,7 @@ class Headplugselection extends Component {
return ( return (
<div className={index===0&&indexs===0&&titlesttings===object.name?"titlesttingcss xiaoshou":index===0&&indexs===0&&titlesttings!==object.name?"titlesttingcssmy xiaoshou" <div className={index===0&&indexs===0&&titlesttings===object.name?"titlesttingcss xiaoshou":index===0&&indexs===0&&titlesttings!==object.name?"titlesttingcssmy xiaoshou"
:titlesttings===object.name?" titlesttingcss xiaoshou":"titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttings(object.name)}> :titlesttings===object.name?" titlesttingcss xiaoshou":"titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttings(object.name,object.id)}>
{object.name} {object.name}
</div> </div>
) )
@ -162,22 +193,40 @@ class Headplugselection extends Component {
}):"" }):""
) )
}) })
: : titlestting!=="全部"&&titlesttings!==null?
objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => { titlestting===objecta.name?
return ( objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => {
titlesttings===objectb.name? return (
objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => { titlesttings===objectb.name?
return ( objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => {
<div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou": return (
index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou" <div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou":
:titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}> index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou"
{object.name} :titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}>
</div> {object.name}
) </div>
}) )
}):""
)
})
:"" :""
) : titlestting!=="全部"&&titlesttings===null?
}) titlestting===objecta.name?
objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => {
return (
objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => {
return (
<div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou":
index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou"
:titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}>
{object.name}
</div>
)
})
)
})
:""
:""
) )
})} })}

@ -111,6 +111,11 @@
padding-left: 26px; padding-left: 26px;
padding-right: 26px; padding-right: 26px;
} }
.tophoms{
padding-top: 15px;
padding-left: 26px;
padding-right: 26px;
}
.borderwd{ .borderwd{
border: 1px solid #000000; border: 1px solid #000000;
} }
@ -589,3 +594,6 @@
width: 60px !important; width: 60px !important;
} }
.h30{
min-height: 30px !important;
}

Loading…
Cancel
Save