dev_oauth
parent
7878109a43
commit
6eff80ae47
@ -0,0 +1,70 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Modal} from 'antd';
|
||||
import axios from 'axios';
|
||||
//加入金品课堂
|
||||
class Jointheclass extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// console.log("加入金品课堂");
|
||||
// console.log(this.props);
|
||||
|
||||
}
|
||||
|
||||
modalCancel=()=>{
|
||||
this.props.ysljoinmodalCancel();
|
||||
};
|
||||
|
||||
setDownload=()=>{
|
||||
var id=this.props.match.params.coursesId
|
||||
|
||||
var url = `/courses/${id}/join_excellent_course.json`;
|
||||
axios.post(url).then((result) => {
|
||||
if(result){
|
||||
if(result.data){
|
||||
if(result.data.status === 0){
|
||||
this.props.showNotification(result.data.message);
|
||||
this.props.ysljoinmodalCanceltwo();
|
||||
}else {
|
||||
this.props.showNotification(result.data.message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
// console.log("加入金品课堂2");
|
||||
// console.log(this.props);
|
||||
return(
|
||||
<Modal
|
||||
keyboard={false}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
title="提示"
|
||||
centered={true}
|
||||
visible={this.props.yslJointhe===undefined?false:this.props.yslJointhe}
|
||||
width="530px"
|
||||
>
|
||||
<div className="educouddiv">
|
||||
<div className={"tabeltext-alignleft"}><p style={{fontSize: "16px"}}>是否确认加入课堂?</p></div>
|
||||
<div className="clearfix mt30 edu-txt-center">
|
||||
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>确认</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Jointheclass;
|
@ -0,0 +1,151 @@
|
||||
import React,{ Component } from "react";
|
||||
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
|
||||
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
|
||||
import './myelearning.css'
|
||||
import axios from 'axios';
|
||||
//在线学习
|
||||
class Elearning extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
|
||||
this.state={
|
||||
description:"", //简介
|
||||
isSpin:true,
|
||||
start_learning:false, //是否要开始学习 没开始学习 点击第一个是开始学习 就是学习下面的从第一个开始
|
||||
learned:0, //学习进度
|
||||
last_shixun:"", //上次学习的实训
|
||||
stages:[], //实践课程的章节
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
console.log("获取到数据");
|
||||
console.log(this.props);
|
||||
let url = `/courses/${this.props.match.params.coursesId}/online_learning.json`;
|
||||
// //
|
||||
axios.get(url).then((response) => {
|
||||
if(response){
|
||||
if(response.data){
|
||||
console.log("获取到到数据");
|
||||
console.log(response);
|
||||
this.setState({
|
||||
description: response.data.description,
|
||||
start_learning:response.data.start_learning,
|
||||
learned:response.data.learned,
|
||||
last_shixun:response.data.last_shixun,
|
||||
isSpin:false,
|
||||
});
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
this.setState({
|
||||
isSpin:false,
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
handleSubmit=(e) => {
|
||||
e.preventDefault();
|
||||
// this.props.form.validateFields((err, values) => {
|
||||
// if (!err) {
|
||||
// console.log(values.description);
|
||||
// if(values.description === undefined|| values.description === "" || values.description ===null){
|
||||
// this.props.showNotification(`请输入提交内容`);
|
||||
// return
|
||||
//
|
||||
// }
|
||||
// var coursesId=this.props.match.params.coursesId
|
||||
//
|
||||
// var url = `/courses/${coursesId}/update_informs.json`;
|
||||
// axios.post(url,{
|
||||
// description:values.description,
|
||||
// }).then((result) => {
|
||||
// if(result){
|
||||
// if(result.data){
|
||||
// if(result.data.status === 0){
|
||||
// this.setState({
|
||||
// description:values.description,
|
||||
// whethertoedit:false,
|
||||
// })
|
||||
//
|
||||
// }else {
|
||||
// this.props.showNotification(result.data.message);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }).catch((error) => {
|
||||
// console.log(error)
|
||||
// })
|
||||
// }else{
|
||||
// console.log(err);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
render(){
|
||||
let{description,whethertoedit,isSpin} =this.state;
|
||||
const isNotMembers=this.props.isNotMember();//非课堂成员
|
||||
return(
|
||||
<React.Fragment >
|
||||
<div id={"zhudiv"}>
|
||||
<div className="edu-back-white" style={{textAlign: "center"}}>
|
||||
<div className="clearfix padding30 bor-bottom-greyE" style={{textAlign: "center"}}>
|
||||
<div style={{height: '40px',textAlign: "center"}}>
|
||||
<span className="font-18 fl color-dark-21 " style={{height: '40px', textAlign: "center"}}>还未开始学习</span>
|
||||
{
|
||||
this.props.isAdmin()===true?
|
||||
<Button className="ant-btn defalutSubmitbtn ant-btn-primary colorblue font-16 fr">
|
||||
<span>开始学习</span></Button>
|
||||
|
||||
:""
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/*简介*/}
|
||||
<div className="clearfix pl30 pr30">
|
||||
<div style={{textAlign: "center",marginTop:"10px"}}>
|
||||
<span className="fl color-dark-21 " style={{textAlign: "center",fontSize:"19px"}}>简介</span>
|
||||
</div>
|
||||
<div className="edu-back-white ">
|
||||
<p className="markdown-body fonttext fl " style={{paddingTop:" 10px",paddingBottom:" 15px"}} dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g,"▁▁▁")}}>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<Spin size="large" spinning={isSpin} id={"cdiv"}>
|
||||
|
||||
<div className="edu-back-white clearfix pl20 pr20" style={{marginTop:"10px"}}>
|
||||
<div>
|
||||
在线学习
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Spin>
|
||||
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
const Elearningss = Form.create({ name: 'elearning' })(Elearning);
|
||||
export default Elearningss;
|
@ -0,0 +1,139 @@
|
||||
import React, { Component } from 'react';
|
||||
import {getImageUrl} from 'educoder';
|
||||
import { Tooltip } from 'antd';
|
||||
import '../../paths/ShixunPaths.css';
|
||||
import axios from 'axios';
|
||||
|
||||
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
|
||||
import DetailCardsEditAndEdit from "../../paths/PathDetail/DetailCardsEditAndEdit";
|
||||
|
||||
const reorder = (list, startIndex, endIndex) => {
|
||||
const result = Array.from(list);
|
||||
const [removed] = result.splice(startIndex, 1);
|
||||
result.splice(endIndex, 0, removed);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
const $ = window.$
|
||||
class DetailCards extends Component{
|
||||
constructor(props){
|
||||
super(props)
|
||||
this.state={
|
||||
pathCardsList:undefined
|
||||
}
|
||||
}
|
||||
|
||||
getPathCardsList(){
|
||||
let pathid = this.props.match.params.PathId
|
||||
// let pathid= 28;
|
||||
let url=`/stages.json?subject_id=`+pathid;
|
||||
axios.get(url).then((result)=>{
|
||||
if(result.status===200){
|
||||
this.setState({
|
||||
pathCardsList:result.data.stages
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
for_paragraph = (index) =>{
|
||||
$("#detail_for_paragraph_"+index).slideToggle(500);
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
this.getPathCardsList();
|
||||
}
|
||||
onDragEnd = (result, shixunIndex) => {
|
||||
// console.log(result)
|
||||
|
||||
// dropped outside the list
|
||||
if (!result.destination) {
|
||||
console.log('dropped outside the list')
|
||||
|
||||
return;
|
||||
}
|
||||
if (result.destination.index === result.source.index) {
|
||||
console.log('the same')
|
||||
return;
|
||||
}
|
||||
// TODO exchange axios request
|
||||
|
||||
const shixuns_list = reorder(
|
||||
this.state.pathCardsList[shixunIndex].shixuns_list,
|
||||
result.source.index,
|
||||
result.destination.index
|
||||
);
|
||||
const pathCardsList = this.state.pathCardsList
|
||||
pathCardsList[shixunIndex].shixuns_list = shixuns_list;
|
||||
this.setState({
|
||||
pathCardsList
|
||||
});
|
||||
}
|
||||
render(){
|
||||
let { pathCardsList }=this.props;
|
||||
return(
|
||||
<div className="lesson-saved-list">
|
||||
{
|
||||
pathCardsList && pathCardsList.map((item,key)=>{
|
||||
|
||||
return(
|
||||
<div className={"lesson-saved-list-item"} id={"stage_div_"+key} >
|
||||
{
|
||||
idsum===key&&pathCardsedittype===true?'':
|
||||
<div className="detail_for_paragraph clearfix" id={"detail_for_paragraph_"+key}>
|
||||
<p className="color-dark-grey mt20 mb25 ml20 mr20 pl28 justify font-15">{item.stage_description}</p>
|
||||
|
||||
<div>
|
||||
|
||||
{
|
||||
item.shixuns_list && item.shixuns_list.map((line,index)=>{
|
||||
return(
|
||||
<div className="clearfix paragraph lineh-30" onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}>
|
||||
|
||||
<li className="fl li-width63">
|
||||
|
||||
<span className="progressRing mr10">
|
||||
{
|
||||
line.complete_status === 1 ?<i className="iconfont icon-wancheng progressRing-over font-18 mt10"></i>
|
||||
:<i className="iconfont icon-bofang progressRing-part font-18 mt10"></i>
|
||||
}
|
||||
</span>
|
||||
<span className={this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?"paragraph_name color204":"paragraph_name color-grey3"}>
|
||||
<span className="subject_stage_shixun_index">{key+1}</span>-{index+1} {line.shixun_name}
|
||||
</span>
|
||||
|
||||
</li>
|
||||
{
|
||||
this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?
|
||||
<li className="fr status_li"><span className="fr color204">暂未公开</span></li>
|
||||
:
|
||||
<li className={showparagraph===false?"none":"fr status_li"}>
|
||||
{
|
||||
showparagraphkey===key&&showparagraphindex===index?<div>
|
||||
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
|
||||
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
|
||||
</div>:""
|
||||
}
|
||||
|
||||
</li>
|
||||
}
|
||||
</div>)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default DetailCards;
|
Loading…
Reference in new issue