dev_oauth
杨树林 6 years ago
parent 7878109a43
commit 6eff80ae47

@ -549,6 +549,7 @@ a:hover.task-btn-orange{background: #459BE6;}
a.user_bluebg_btn{background-color:#4CACFF;color: #fff;}
a.user_orangebg_btn{background-color:#FF6800;color: #fff;}
a.user_greybg_btn{background-color:#747A7F;color: #fff;}
/*.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}*/
.pointer{cursor: pointer}

@ -37,6 +37,10 @@ const Eduinforms= Loadable({
loader: () => import('./gradinforms/Eduinforms.js'),
loading: Loading,
});
const Elearning= Loadable({
loader: () => import('./elearning/Elearning.js'),
loading: Loading,
});
//
const Exercise= Loadable({
loader: () => import('./exercise/Exercise'),
@ -245,11 +249,19 @@ class ListPageIndex extends Component{
{/*公告栏列表*/}
<Route path="/courses/:id/informs"
<Route path="/courses/:coursesId/informs"
render={
(props) => (<Eduinforms {...this.props} {...props} {...this.state} />)
}
></Route>
{/*在线学习*/}
<Route
path="/courses/:coursesId/online_learning"
render={
(props) => (<Elearning {...this.props} {...props} {...this.state} />)
}
>
</Route>
{/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={

@ -11,7 +11,7 @@ import Modals from "../../modals/Modals";
import Guide from './CoursesGuide';
import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal'
import Jointheclass from './Jointheclass'
// 点击按钮复制功能
// function jsCopy(){
// var e = document.getElementById("copy_invite_code");
@ -45,7 +45,9 @@ class CoursesBanner extends Component {
modalsBottomval: "",
antIcon:false,
coursedata:undefined,
is_guide:false
is_guide:false,
excellent:false,//是否是金品课堂
yslJointhe:false,
}
}
componentDidMount() {
@ -69,7 +71,7 @@ class CoursesBanner extends Component {
let data = result.data;
this.setState({
coursedata: data,
excellent:data.excellent,
})
}else{
this.onloadupdatabanner()
@ -107,6 +109,13 @@ class CoursesBanner extends Component {
}
};
//金品课堂的弹框
myyslgradin=()=>{
this.setState({
yslJointhe:true
})
}
showActionPoll=(i,s,ss)=>{
this.setState({
@ -349,10 +358,21 @@ class CoursesBanner extends Component {
this.setState({
AccountProfiletype:false
})
}
};
ysljoinmodalCancel=()=>{
this.setState({
yslJointhe:false
})
};
ysljoinmodalCanceltwo=()=>{
this.setState({
yslJointhe:false
})
window.location.reload();
};
render() {
let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state;
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state;
return (
<div>
@ -383,6 +403,7 @@ class CoursesBanner extends Component {
modalSave={this.ModalAction}
antIcon={antIcon}
></Modals>
<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>
<AddTeacherModal ref="addTeacherModal"
{...this.props}
isTeacher={this.state.isTeacher}
@ -437,7 +458,7 @@ class CoursesBanner extends Component {
</div>
{excellent===false?
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={
@ -485,6 +506,30 @@ class CoursesBanner extends Component {
> 退出课堂 </a>:""}
</div>
:
<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>
{
@ -583,10 +628,10 @@ class CoursesBanner extends Component {
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}>
<span className="color-white fl font-16 bannerurli width100f">添加学生</span>
<span className={"color-white fl font-16 bannerurli width100f"}>添加学生</span>
</a>
</li>
{excellent===false?
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a>
<span className="color-grey-c fl font-16" style={{marginRight: "10px"}}>邀请码</span>
@ -612,7 +657,7 @@ class CoursesBanner extends Component {
<input id="copy_invite_code" value={coursedata.invite_code}/>
</span>
</a>
</li>
</li>:""}
<li className={"mt7 ml10 mr0 "}>
<style>
@ -623,6 +668,7 @@ class CoursesBanner extends Component {
}
</style>
<Popover placement="bottom" content={
excellent===false?
<ul className="sandianbox" style={{
display: 'block',
right: "-113px",
@ -646,6 +692,16 @@ class CoursesBanner extends Component {
{coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div>
:"":""}
</ul>
:
<ul className="sandianbox" style={{
display: 'block',
right: "-113px",
top: "20px"
}}>
<div className={"defaults"} onClick={this.postsettings}>设置</div>
{coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div>
:"":""}
</ul>
} trigger="hover">
<i className="iconfont icon-weibiaoti12 color-white font-14 relative"></i>
</Popover>

@ -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}&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;

@ -4,7 +4,7 @@ import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import './myysleduinforms.css'
import axios from 'axios';
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
// 公告栏
class Eduinforms extends Component{
constructor(props){
super(props);
@ -21,7 +21,7 @@ class Eduinforms extends Component{
componentDidMount() {
console.log("获取到数据");
console.log(this.props);
let url = `/courses/${this.props.match.params.id}/informs.json`;
let url = `/courses/${this.props.match.params.coursesId}/informs.json`;
//
axios.get(url).then((response) => {
if(response){
@ -78,7 +78,7 @@ class Eduinforms extends Component{
return
}
var id=this.props.match.params.id
var id=this.props.match.params.coursesId
var url = `/courses/${id}/update_informs.json`;
axios.post(url,{
@ -91,7 +91,7 @@ class Eduinforms extends Component{
description:values.description,
whethertoedit:false,
})
this.props.showNotification(result.data.message);
}else {
this.props.showNotification(result.data.message);

@ -551,7 +551,7 @@ a:hover.task-btn-orange{background: #459BE6;}
a.user_bluebg_btn{background-color:#4CACFF;color: #fff;}
a.user_orangebg_btn{background-color:#FF6800;color: #fff;}
a.user_greybg_btn{background-color:#747A7F;color: #fff;}
/*.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}*/
.pointer{cursor: pointer}
.cdefault{cursor: default}

Loading…
Cancel
Save