diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js index 77c41e340..ad04af235 100644 --- a/public/react/src/modules/courses/elearning/Elearning.js +++ b/public/react/src/modules/courses/elearning/Elearning.js @@ -398,7 +398,7 @@ class Elearning extends Component{ :
{/*开始学习*/} - this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}> + this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()} getPathCardsList={()=>this.getdata()}>
} diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js index eef44346e..3f3770ffa 100644 --- a/public/react/src/modules/courses/elearning/YslDetailCards.js +++ b/public/react/src/modules/courses/elearning/YslDetailCards.js @@ -4,7 +4,9 @@ import { Tooltip,Modal,Icon,Spin,message} from 'antd'; import '../../paths/ShixunPaths.css'; import axios from 'axios'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; - +import DetailCardsEditAndEdit from '../../paths/PathDetail/DetailCardsEditAndEdit'; +import DetailCardsEditAndAdd from "../../paths/PathDetail/DetailCardsEditAndAdd"; +import Modals from "../../modals/Modals"; class YslDetailCards extends Component{ constructor(props){ super(props) @@ -17,7 +19,22 @@ class YslDetailCards extends Component{ shixunsmessage:"", startshixunCombattype:false, isSpin:false, + idsum:undefined, + pathCardsedittype:false, + pathid:undefined, + editbuttomtypeadd:false, + pathlistedit:undefined, + delecttype:false, + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', } + //idsum 是否点击这个 + //pathCardsedittype 是否是在编辑模式 + //editbuttomtypeadd 是否已经是编辑模式 + //pathid课堂id + //pathlistedit 编辑返回的数据 + } showparagraph =(key,index)=>{ @@ -90,6 +107,10 @@ class YslDetailCards extends Component{ }; componentDidMount(){ + let pathid=this.props.match.params.coursesId; + this.setState({ + pathid:pathid + }) } @@ -125,13 +146,93 @@ class YslDetailCards extends Component{ this.setState({ startshixunCombattype:false }) + }; + // 关卡的上移下移操作 + operations = (url) => { + let newurl = url+".json" + axios.get(newurl).then((response) => { + if(response.data.status===1){ + this.props.getPathCardsList(); + } + }).catch((error) => { + console.log(error); + }) + + } + //取消的 + updatapathCardsedit=()=>{ + this.setState({ + idsum:undefined, + pathCardsedittype:false, + editbuttomtype:false, + editbuttomtypeadd:false + }) + this.props.getPathCardsList(); + // this.props.updatadetailInfoLists(); + }; + //确认的 + editeditbuttomtypecanle=()=>{ + this.setState({ + editbuttomtype:true, + editbuttomtypeadd:false + + }) + } + //编辑用 + pathCardsedit=(key,pathid)=>{ + + let url=`/stages/`+pathid+`/edit.json`; + axios.get(url).then((result)=>{ + if(result.status===200){ + this.setState({ + idsum:key, + pathCardsedittype:true, + pathlistedit:result.data, + editbuttomtype:true, + editbuttomtypeadd:true + }) + } + }).catch((error)=>{ + console.log(error); + }) + + }; + //删除用的 + delectpathCardsedit=(id)=>{ + + this.setState({ + Modalstype:true, + Modalstopval:'是否删除该章节?', + Modalsbottomval:'', + editdelectid:id, + delecttype:true, + }) + + } + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', + editdelectid:undefined + }) + } + cardsModalsave=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', + editdelectid:undefined + }) } + render(){ - let{showparagraph,showparagraphkey,showparagraphindex,hidestartshixunsreplacevalue} =this.state; + let{showparagraph,showparagraphkey,showparagraphindex,hidestartshixunsreplacevalue,idsum,pathCardsedittype,pathid,Modalstype,Modalstopval,Modalsbottomval,delecttype,pathlistedit} =this.state; let { stages }=this.props; const antIcon = ; return( +
+ + +