dev_oauth
杨树明 6 years ago
parent 7414c7e490
commit 86ae700024

@ -69,6 +69,9 @@ class PathDetailIndex extends Component{
constructor(props){ constructor(props){
super(props) super(props)
this.state={ this.state={
progress:undefined,
tags:undefined,
members:undefined,
detailInfoList:undefined, detailInfoList:undefined,
clickdetailInfoListtype:false, clickdetailInfoListtype:false,
Modalstype:false, Modalstype:false,
@ -95,16 +98,17 @@ class PathDetailIndex extends Component{
} }
const items = reorder( const items = reorder(
this.state.detailInfoList.members, this.state.members,
result.source.index, result.source.index,
result.destination.index result.destination.index
); );
this.state.detailInfoList.members=items;
this.setState({ this.setState({
detailInfoList:this.state.detailInfoList, detailInfoList:this.state.detailInfoList,
members:items,
items items
}); });
console.log(this.state.detailInfoList.members) console.log(this.state.members)
console.log("items 数组数组数组数组") console.log("items 数组数组数组数组")
console.log(items) console.log(items)
} }
@ -166,7 +170,7 @@ class PathDetailIndex extends Component{
}) })
let righturl="/paths/"+pathid+"right_banner.json"; let righturl="/paths/"+pathid+"/right_banner.json";
axios.get(righturl).then((result)=>{ axios.get(righturl).then((result)=>{
if (result.data.status === 407 || result.data.status === 401) { if (result.data.status === 407 || result.data.status === 401) {
debugger debugger
@ -181,6 +185,9 @@ class PathDetailIndex extends Component{
this.setState({ this.setState({
// detailInfoList:result.data, // detailInfoList:result.data,
tags:result.data.tags,
progress:result.data.progress,
members:result.data.members,
items: getItems(result.data.members.length), items: getItems(result.data.members.length),
}) })
@ -305,9 +312,10 @@ class PathDetailIndex extends Component{
console.log("上移"); console.log("上移");
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
// console.log(response); // console.log(response);
this.state.detailInfoList.members=response.data.members;
this.setState({ this.setState({
detailInfoList:this.state.detailInfoList, detailInfoList:this.state.detailInfoList,
members:response.data.members
}); });
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
@ -330,9 +338,9 @@ class PathDetailIndex extends Component{
console.log("下移"); console.log("下移");
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
// console.log(response); // console.log(response);
this.state.detailInfoList.members=response.data.members;
this.setState({ this.setState({
detailInfoList:this.state.detailInfoList, detailInfoList:this.state.detailInfoList,
members:response.data.members
}); });
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
} }
@ -352,10 +360,13 @@ class PathDetailIndex extends Component{
Modalsbottomval, Modalsbottomval,
cardsModalcancel, cardsModalcancel,
cardsModalsave, cardsModalsave,
loadtype loadtype,
progress,
members,
tags,
} = this.state } = this.state
console.log(this.props.checkIfLogin())
return( return(
<div className="newContainer"> <div className="newContainer">
<style> <style>
@ -426,14 +437,14 @@ class PathDetailIndex extends Component{
} }
</div> </div>
</div> </div>
{detailInfoList === undefined ? "" : detailInfoList.tags === null ? "": {tags === undefined ? "" :tags === null ? "":
<div className="edu-back-white padding40-20 mb10 relative"> <div className="edu-back-white padding40-20 mb10 relative">
<p className="font-16 mb20">技能标签 <span className="color-grey-c">{detailInfoList.tags.length}</span></p> <p className="font-16 mb20">技能标签 <span className="color-grey-c">{tags.length}</span></p>
<div className={clickdetailInfoListtype===false?"newedbox newedboxheight":"newedbox newminheight"}> <div className={clickdetailInfoListtype===false?"newedbox newedboxheight":"newedbox newminheight"}>
<div className="clearfix" id="boxheight"> <div className="clearfix" id="boxheight">
{ {
detailInfoList.tags && detailInfoList.tags.map((item,key)=>{ tags && tags.map((item,key)=>{
return( return(
<span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span> <span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span>
) )
@ -443,7 +454,7 @@ class PathDetailIndex extends Component{
</div> </div>
<Tooltip placement="bottom" title={"显示全部"}> <Tooltip placement="bottom" title={"显示全部"}>
<div className={detailInfoList.tags.length>15&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} <div className={tags.length>15&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"}
onClick={()=>this.clickNewsubscript(0)} onClick={()=>this.clickNewsubscript(0)}
><span className="mr8">...</span><Icon type="caret-down" /> ><span className="mr8">...</span><Icon type="caret-down" />
</div> </div>
@ -458,29 +469,29 @@ class PathDetailIndex extends Component{
</div> </div>
} }
{ {
this.props.checkIfLogin()===false?"":detailInfoList === undefined ? "" : detailInfoList.progress === null ? "" : this.props.checkIfLogin()===false?"123213":progress === undefined ? "" : progress === null ? "" :
<div className="edu-back-white myProgress padding40-20 mb10"> <div className="edu-back-white myProgress padding40-20 mb10">
<p className="mb20"> <p className="mb20">
<span className="font-16 mr10">我的进展</span> <span className="font-16 mr10">我的进展</span>
<Tooltip placement="bottom" title="获得经验值/总经验值"> <Tooltip placement="bottom" title="获得经验值/总经验值">
<span className="color-green" >{detailInfoList.progress.my_score} / {detailInfoList.progress.all_score}</span> <span className="color-green" >{progress.my_score} / {progress.all_score}</span>
</Tooltip> </Tooltip>
</p> </p>
<p className="clearfix mb10"> <p className="clearfix mb10">
<span className="fl color-green">已学 {detailInfoList.progress.learned}%</span> <span className="fl color-green">已学 {progress.learned}%</span>
<span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(detailInfoList.progress.time)} </span> <span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span>
</p> </p>
<div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${detailInfoList.progress.learned+"%"}`}}></div></div> <div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div>
</div> </div>
} }
{ {
detailInfoList ===undefined ?"":detailInfoList.members === null ?"": members ===undefined ?"":members === null ?"":
<div className="teacherTeam edu-back-white clearfix" id="subject_members"> <div className="teacherTeam edu-back-white clearfix" id="subject_members">
<p className="font-16 clearfix">教学团队</p> <p className="font-16 clearfix">教学团队</p>
{ detailInfoList===undefined? { members===undefined?
detailInfoList.members && detailInfoList.members.map((item,key)=>{ members && members.map((item,key)=>{
return( return(
<div className="teacherTeamItem clearfix df" key={key}> <div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl"> <a href={item.user_url} target="_blank" className="fl">
@ -501,8 +512,8 @@ class PathDetailIndex extends Component{
</div> </div>
) )
}) })
:detailInfoList.allow_add_member===true? :detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
detailInfoList.members && detailInfoList.members.map((item,key)=>{ members && members.map((item,key)=>{
return( return(
<div className="teacherTeamItem clearfix df" key={key}> <div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl"> <a href={item.user_url} target="_blank" className="fl">
@ -524,7 +535,7 @@ class PathDetailIndex extends Component{
{ {
detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div> detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div>
{key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""} {key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""}
{key+1!=detailInfoList.members.length?<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>:""} {key+1!= members&&members.length?<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>:""}
</div> </div>
:"" :""
} }
@ -533,7 +544,7 @@ class PathDetailIndex extends Component{
</div> </div>
) )
}) })
: detailInfoList.members && detailInfoList.members.map((item,key)=>{ : members && members.map((item,key)=>{
return( return(
<div className="teacherTeamItem clearfix df" key={key}> <div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl"> <a href={item.user_url} target="_blank" className="fl">

@ -60,7 +60,7 @@ class ShixunPathCard extends Component{
{ {
item.excellent === true ? "" : item.excellent === false ? "" :
<div className="tag-orange"> <div className="tag-orange">
<span className="tag-name">开放课程</span> <span className="tag-name">开放课程</span>
</div> </div>

Loading…
Cancel
Save