dev_oauth
杨树林 6 years ago
parent 6eff80ae47
commit ad09458e3c

@ -837,8 +837,12 @@ class CoursesIndex extends Component{
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />)
}
></Route>
{/*修改金品课堂*/}
<Route path="/courses/:coursesId/newgold/settings"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id"
render={

@ -351,10 +351,14 @@ class CoursesBanner extends Component {
}
postsettings=()=>{
window.location.href = "/courses/" + this.props.match.params.coursesId + "/settings";
}
};
postsettingstwo=()=>{
window.location.href = " /courses/" + this.props.match.params.coursesId + "/newgold/settings";
};
hideAccountProfile=()=>{
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
@ -507,27 +511,28 @@ class CoursesBanner extends Component {
</div>
:
<div>
<style>
{
`
<div>
<style>
{
`
.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}
`
}
</style>
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn user_white_btn mr20 font-18"
onClick={() => this.myyslgradin()}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_white_btn mr20 font-18"
onClick={() => this.myyslgradin()}>加入课堂</a>: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}
</div>
}
</style>
{/*coursedata.course_identity === 6 是非课堂成员*/}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}}
onClick={() => this.myyslgradin()}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}}
onClick={() => this.myyslgradin()}>加入课堂</a>: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}
</div>
}
@ -698,7 +703,7 @@ class CoursesBanner extends Component {
right: "-113px",
top: "20px"
}}>
<div className={"defaults"} onClick={this.postsettings}>设置</div>
<div className={"defaults"} onClick={this.postsettingstwo}>设置</div>
{coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div>
:"":""}
</ul>

@ -53,11 +53,11 @@ class Jointheclass extends Component {
title="提示"
centered={true}
visible={this.props.yslJointhe===undefined?false:this.props.yslJointhe}
width="530px"
width="600px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft"}><p style={{fontSize: "16px"}}>是否确认加入课堂?</p></div>
<div className="clearfix mt30 edu-txt-center">
<div className={"tabeltext-alignleft"}><p style={{fontSize: "16px",marginTop:"46px"}}>是否确认加入课堂?</p></div>
<div className="clearfix edu-txt-center" style={{marginTop:"98px"}}>
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>确认</a>
</div>

@ -1,8 +1,10 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form,Icon,message} from "antd";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import './myelearning.css'
import axios from 'axios';
import YslDetailCards from "./YslDetailCards.js";
import Jointheclass from '../coursesDetail/Jointheclass'
//在线学习
class Elearning extends Component{
constructor(props){
@ -15,10 +17,18 @@ class Elearning extends Component{
learned:0, //学习进度
last_shixun:"", //上次学习的实训
stages:[], //实践课程的章节
yslJointhe:false,
shixunsreplace:false,
hidestartshixunsreplacevalue:"",
shixunsmessage:"",
startshixunCombattype:false,
isSpins:false,
}
}
componentDidMount() {
// 记得删除退出课堂
console.log("获取到数据");
console.log(this.props);
let url = `/courses/${this.props.match.params.coursesId}/online_learning.json`;
@ -33,10 +43,14 @@ class Elearning extends Component{
start_learning:response.data.start_learning,
learned:response.data.learned,
last_shixun:response.data.last_shixun,
isSpin:false,
stages:response.data.stages,
});
}
}
this.setState({
isSpin:false,
})
}).catch((error) => {
console.log(error);
this.setState({
@ -51,79 +65,221 @@ class Elearning extends Component{
}
};
//开始学习
Startlearning=()=>{
if(this.props.isNotMember()===true){
this.setState({
yslJointhe:true
})
}else {
let {stages}=this.state;
if(stages.length>0){
for(var i=0;i<stages.length;i++){
if(i===0){
var id=stages[0].shixuns_list[0].identifier;
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
if (response.data.status === -2) {
this.setState({
shixunsreplaces:true,
hidestartshixunsreplacevalues:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessages:response.data.message,
startshixunCombattypes:true,
})
} else {
console.log("开始学习了");
window.open("/tasks/" + response.data.game_identifier,'_blank');
//这个是传过来 调用刷新
this.Myreload();
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
});
break;
}
console.log("这是"+i);
}
}
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);
// }
//
// });
}
}
};
Startlearningtwo=()=>{
this.setState({
yslJointhe:true
})
};
ysljoinmodalCancel=()=>{
this.setState({
yslJointhe:false
})
};
ysljoinmodalCanceltwo=()=>{
this.setState({
yslJointhe:false
})
window.location.reload();
};
Myreload = ()=>{
window.location.reload();
};
hidestartshixunsreplace=(url)=>{
this.setState({
isSpins:true,
})
axios.get(url).then((response) => {
// debugger
if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
message.success('重置成功,正在进入实训!');
this.startgameid(response.data.shixun_identifier);
this.setState({
shixunsreplaces:false,
isSpins:false,
})
// message.success('重置成功,正在进入实训!');
// this.startshixunCombat();
}}
).catch((error) => {
this.setState({
isSpins:false,
shixunsreplaces:false,
})
});
};
startgameid=(id)=>{
if(this.props.isNotMember()===true){
//这个是外部传过来的
this.Startlearningtwo();
return
}
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
if (response.data.status === -2) {
this.setState({
shixunsreplaces:true,
hidestartshixunsreplacevalues:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessages:response.data.message,
startshixunCombattypes:true,
})
} else {
console.log("开始学习了");
window.open("/tasks/" + response.data.game_identifier,'_blank');
//这个是传过来 调用刷新
this.Myreload();
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
});
};
hidestartshixunCombattype=()=>{
this.setState({
startshixunCombattypes:false
})
}
render(){
let{description,whethertoedit,isSpin} =this.state;
let{description,whethertoedit,isSpin,start_learning} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
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>
:""
}
<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>
<Modal
keyboard={false}
title="提示"
visible={this.state.startshixunCombattypes}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">本实训的开启时间{this.state.shixunsmessages} <br/>开启时间之前不能挑战 </p>
</div>
<div className="task-popup-submit clearfix">
{/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/}
<a className="task-btn task-btn-orange fr"
style={{marginRight:'51px'}}
onClick={this.hidestartshixunCombattype}>知道了</a>
</div>
{/*<p className="inviteTipbtn with100 fl">*/}
{/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/}
{/*</p>*/}
</Modal>
<Modal
keyboard={false}
title="提示"
visible={this.state.shixunsreplaces}
closable={false}
footer={null}
>
<Spin indicator={antIcon} spinning={this.state.isSpins}>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div>
<div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr"
style={{marginRight:'51px'}}
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div>
</Spin>
</Modal>
<div className="edu-back-white">
{
this.props.isAdmin()===true?"":
<div>
{
start_learning===false?
<div className="clearfix padding30 bor-bottom-greyE" style={{textAlign: "center"}}>
<div style={{height: '40px',textAlign: "center"}}>
<span className=" fl color-dark-21 " style={{height: '40px', textAlign: "center",fontSize:"19px"}}>还未开始学习</span>
<Button className="ant-btn defalutSubmitbtn ant-btn-primary colorblue font-16 fr" onClick={()=>this.Startlearning()}>
<span>开始学习</span></Button>
</div>
</div>
:""
}
</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 className="clearfix pl30 pr30" style={{paddingBottom:"22px"}}>
<div style={{textAlign: "left",marginTop:"10px",paddingBottom: "10px"}}>
<span className=" 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,"▁▁▁")}}>
<div className="edu-back-white new_li editormd-html-preview " >
<p className="markdown-body fonttext " dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g,"▁▁▁")}}>
</p>
</div>
@ -133,11 +289,11 @@ class Elearning extends Component{
<Spin size="large" spinning={isSpin} id={"cdiv"}>
<div className="edu-back-white clearfix pl20 pr20" style={{marginTop:"10px"}}>
<div className=" clearfix" style={{marginTop:"10px"}}>
<div>
在线学习
</div>
{/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} ></YslDetailCards>
</div>
</div>
</Spin>

@ -0,0 +1,217 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
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";
class YslDetailCards extends Component{
constructor(props){
super(props)
this.state={
showparagraph:false,
showparagraphkey:"",
showparagraphindex:"",
shixunsreplace:false,
hidestartshixunsreplacevalue:"",
shixunsmessage:"",
startshixunCombattype:false,
isSpin:false,
}
}
showparagraph =(key,index)=>{
this.setState({
showparagraph:true,
showparagraphkey:key,
showparagraphindex:index
})
};
hideparagraph=()=>{
this.setState({
showparagraph:false
})
};
startgameid=(id)=>{
if(this.props.isNotMember()===true){
//这个是外部传过来的
this.props.Startlearningtwo();
return
}
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
if (response.data.status === -2) {
this.setState({
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessage:response.data.message,
startshixunCombattype:true,
})
} else {
console.log("开始学习了");
window.open("/tasks/" + response.data.game_identifier,'_blank');
//这个是传过来 调用刷新
this.props.Myreload();
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
});
};
componentDidMount(){
}
hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true,
})
axios.get(url).then((response) => {
// debugger
if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
message.success('重置成功,正在进入实训!');
this.startgameid(response.data.shixun_identifier);
this.setState({
shixunsreplace:false,
isSpin:false,
startbtn:false,
})
// message.success('重置成功,正在进入实训!');
// this.startshixunCombat();
}}
).catch((error) => {
this.setState({
isSpin:false,
shixunsreplace:false,
})
});
}
hidestartshixunCombattype=()=>{
this.setState({
startshixunCombattype:false
})
}
render(){
let{showparagraph,showparagraphkey,showparagraphindex,hidestartshixunsreplacevalue} =this.state;
let { stages }=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<div className="lesson-saved-list">
<Modal
keyboard={false}
title="提示"
visible={this.state.startshixunCombattype}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">本实训的开启时间{this.state.shixunsmessage} <br/>开启时间之前不能挑战 </p>
</div>
<div className="task-popup-submit clearfix">
{/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/}
<a className="task-btn task-btn-orange fr"
style={{marginRight:'51px'}}
onClick={this.hidestartshixunCombattype}>知道了</a>
</div>
{/*<p className="inviteTipbtn with100 fl">*/}
{/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/}
{/*</p>*/}
</Modal>
<Modal
keyboard={false}
title="提示"
visible={this.state.shixunsreplace}
closable={false}
footer={null}
>
<Spin indicator={antIcon} spinning={this.state.isSpin}>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div>
<div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr"
style={{marginRight:'51px'}}
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div>
</Spin>
</Modal>
{
stages && stages.map((item,key)=>{
return(
<div className={"lesson-saved-list-item"} id={"stage_div_"+key} >
<p className="clearfix title-line">
<a className="fl ring-blue mr10 mt2">
<img src={getImageUrl("images/educoder/icon/charpter-white.svg")} className="fl ml3 mt3"/>
</a>
<span className="font-18 font-bd lessonvalue" title={item.stage_name}>{item.stage_name}</span>
</p>
<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}&nbsp;&nbsp;{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 YslDetailCards;

@ -1,139 +0,0 @@
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}&nbsp;&nbsp;{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;

@ -67,18 +67,24 @@ class Goldsubject extends Component {
checkboxgroup: data.course_module_types,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
starttime: data.start_date === undefined ? "" : moment(data.start_date, dateFormat),
endtime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat),
school:data.school
});
// starttime
this.setState({
datatimetwo: data.start_date,
datatime: data.end_date,
datatimetwo: data.end_date,
is_public: 1,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
})
name: data.name,
class_period: data.class_period,
credit: parseFloat(data.credit),
course_module_types: data.course_module_types,
school:data.school
});
this.handleSearchschool(data.school);
}).catch((error) => {
console.log(error);

Loading…
Cancel
Save