Merge branch 'dev_aliyun' into dev_hjm_a

dev_unstable
hjm 6 years ago
commit 3bd19cbf57

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

@ -112,8 +112,25 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.smallSquare:nth-child(3n+0){margin-right: 0px;}
.partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;}
/*块状列表上面的绿色标签*/
.tag-green{position: absolute;left: 0px;top:20px;}
.tag-green .tag-name{display: block;width: auto;background-image: url("/images/educoder/tag1.png");background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-green{
position: absolute;
left: 15px;
bottom: 95px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;
line-height: 28px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
/*发送至弹框里的下拉框*/
.downSelectOption{position: relative;height: 35px;}
.downSelectOption .showOption{background-color: #F4F4F4;border: 1px solid #EAEAEA;width: 100%;padding: 5px 40px 5px 5px;outline: none;height: 100%;box-sizing: border-box;}

File diff suppressed because one or more lines are too long

@ -72,7 +72,11 @@ const WrappedCoursesNewApp= Loadable({
loader: () => import('./new/CoursesNew'),
loading: Loading,
})
//新建金品课堂
const WrappedCoursesNewAppGoldclass= Loadable({
loader: () => import('./new/Goldsubject'),
loading: Loading,
})
const ShixunHomeworkPage =Loadable({
loader: () => import('./shixunHomework/ShixunHomeworkPage'),
loading: Loading,
@ -821,6 +825,20 @@ class CoursesIndex extends Component{
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />)
}
></Route>
{/*新建金品课堂*/}
{/*coursesId 课堂id */}
{/*id 是否是私有或者公有*/}
<Route path="/courses/:subjectid/newgold/:id"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
}
></Route>
{/*修改金品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings/:id"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
}
></Route>
{/*修改课堂*/}
<Route path="/courses/:coursesId/settings"
render={
@ -828,7 +846,6 @@ class CoursesIndex extends Component{
}
></Route>
{/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id"
render={

@ -32,7 +32,15 @@ const TeacherList= Loadable({
const StudentsList= Loadable({
loader: () => import('./members/studentsList'),
loading: Loading,
})
});
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'),
@ -239,6 +247,21 @@ class ListPageIndex extends Component{
}
></Route>
{/*公告栏列表*/}
<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 '../../modals/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({
@ -342,17 +351,42 @@ class CoursesBanner extends Component {
}
postsettings=()=>{
window.location.href = "/courses/" + this.props.match.params.coursesId + "/settings";
}
};
postsettingstwo=()=>{
var ids =1;
try {
if(this.state.coursedata.is_public){
ids=1;
}else {
ids=0;
}
}catch (e) {
}
window.location.href = `/courses/${this.props.match.params.coursesId}/newgolds/settings/${ids}`;
};
hideAccountProfile=()=>{
hideAccountProfile=()=>{
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 +417,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}
@ -407,6 +442,28 @@ class CoursesBanner extends Component {
{/*访
公开公开课堂非课堂成员可以访问*/}
<style>
{
`
.tag-orange .tag-name{
display: block;
width: auto;
background-color: #FF6800;
background-size: 100% 100%;
padding: 0px 4px;
color: #fff;
float: left;
height: 28px;
line-height: 28px;
font-size: 14px;
border-radius: 4px;
}
`
}
</style>
{excellent===true?
<span className="tag-orange fl"><span className="tag-name mt10 ml10">国家精品</span></span>
:""}
<span className={"TabsWarp"}>
<CoursesListType
typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]}
@ -437,7 +494,7 @@ class CoursesBanner extends Component {
</div>
{excellent===false?
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={
@ -485,6 +542,31 @@ class CoursesBanner extends Component {
> 退出课堂 </a>:""}
</div>
:
<div>
<style>
{
`
.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}
`
}
</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>
}
<style>
{
@ -583,10 +665,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 +694,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 +705,7 @@ class CoursesBanner extends Component {
}
</style>
<Popover placement="bottom" content={
excellent===false?
<ul className="sandianbox" style={{
display: 'block',
right: "-113px",
@ -646,6 +729,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.postsettingstwo}>设置</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>

@ -648,7 +648,6 @@ class Coursesleftnav extends Component{
}
onDragEnd=(result)=>{
debugger
// console.log(result)
// let {course_modules}=this.props;
// let newcourse_modules=course_modules;
@ -739,6 +738,7 @@ class Coursesleftnav extends Component{
maincontent=(item,key)=>{
return ( <div className={"sandianbox"}>
{/*公告栏*/}
{/*作业*/}
{item.type==="shixun_homework"?<div onClick={e=>this.Navmodalnames(e,1,"shixun_homework",item.id)}>添加目录</div>:""}
{/*资源*/}
@ -792,8 +792,12 @@ class Coursesleftnav extends Component{
// // console.log(item.category_url)
// console.log(this.props.location.pathname)
console.log("778");
console.log("CoursesLeftNav");
console.log(this.props);
console.log(course_modules);
return(
return(
<ul className="mb10 newedu-class-leftnav">
@ -879,6 +883,8 @@ class Coursesleftnav extends Component{
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xiaoxi1 mr10 fl":"iconfont icon-xiaoxi1 mr10 fl"}></i>:
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xuexizhongxin mr10 fl":"iconfont icon-xuexizhongxin mr10 fl"}></i>:
item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="common_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-putongzuoye mr10 fl":"iconfont icon-putongzuoye mr10 fl"}></i>:
item.type==="group_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenzuzuoye mr10 fl":"iconfont icon-fenzuzuoye mr10 fl"}></i>:
@ -994,6 +1000,8 @@ class Coursesleftnav extends Component{
>
<a className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xiaoxi1 mr10 fl":"iconfont icon-xiaoxi1 mr10 fl"}></i>:
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xuexizhongxin mr10 fl":"iconfont icon-xuexizhongxin mr10 fl"}></i>:
item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="common_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-putongzuoye mr10 fl":"iconfont icon-putongzuoye mr10 fl"}></i>:
item.type==="group_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenzuzuoye mr10 fl":"iconfont icon-fenzuzuoye mr10 fl"}></i>:

@ -32,7 +32,7 @@ class CoursesListType extends Component {
{
typelist===undefined?"":typelist.map((item,key)=>{
return(
<Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')}>
<Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')} key={key}>
<span key={key}>
{item==="公开"?<span className={"edu-filter-btn edu-filter-btn-028d01 ml15 fl typestyle " + typesylename} >公开</span>:""}
{item==="已开启补交"?<span className={"edu-filter-btn edu-filter-btn-028d01 ml15 fl typestyle "+ typesylename} >已开启补交</span>:""}

@ -0,0 +1,322 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form,Icon,message,Progress} 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 '../../modals/Jointheclass'
//在线学习
class Elearning extends Component{
constructor(props){
super(props);
this.state={
description:"", //简介
isSpin:true,
start_learning:undefined, //是否要开始学习 没开始学习 点击第一个是开始学习 就是学习下面的从第一个开始
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`;
// //
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,
stages:response.data.stages,
});
}
}
this.setState({
isSpin:false,
})
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
})
});
}
componentDidUpdate = (prevProps) => {
};
//开始学习
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);
}
}
}
};
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,start_learning,hidestartshixunsreplacevalues,learned,last_shixun} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<React.Fragment >
<div id={"zhudiv"}>
<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(hidestartshixunsreplacevalues)}>知道了</a>
</div>
</Spin>
</Modal>
<div className="edu-back-white">
{
this.props.isAdmin()===true?"":
<div>
{
start_learning===undefined?"":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 className="clearfix padding30 bor-bottom-greyE" style={{textAlign: "center"}}>
<div style={{height: '40px',textAlign: "left"}}>
<span className=" color-dark-21 " style={{height: '40px', textAlign: "center",fontSize:"19px",color:"#05101A"}}>已学{learned}%</span>
</div>
<div style={{marginTop:"7px",width:"401px"}}>
<Progress percent={learned} showInfo={false} />
</div>
<div style={{marginTop:"7px",textAlign: "left"}}>
<span className="font-16">上次学至</span><span style={{color:"#4CADFF",marginLeft:"25px"}}>{last_shixun}</span>
</div>
</div>
}
</div>
}
{/*简介*/}
<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 new_li editormd-html-preview " >
<p className="markdown-body fonttext " dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g,"▁▁▁")}}>
</p>
</div>
</div>
</div>
<Spin size="large" spinning={isSpin} id={"cdiv"}>
<div className=" clearfix" style={{marginTop:"20px"}}>
<div>
{/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} ></YslDetailCards>
</div>
</div>
</Spin>
</div>
</React.Fragment>
)
}
}
const Elearningss = Form.create({ name: 'elearning' })(Elearning);
export default Elearningss;

@ -0,0 +1,226 @@
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>
<style>{
`
.lesson-saved-list-item {
border-bottom: none!important;
margin-bottom: 20px;
background-color: #fff;
}
`
}</style>
{
stages && stages.map((item,key)=>{
return(
<div className={"lesson-saved-list-item"} key={key} 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" key={index} 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;

@ -0,0 +1,259 @@
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 './myysleduinforms.css'
import axios from 'axios';
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
// 公告栏
class Eduinforms extends Component{
constructor(props){
super(props);
this.messageRef = React.createRef();
this.state={
description:null,
isSpin:true,
whethertoedit:false,
}
}
componentDidMount() {
console.log("获取到数据");
console.log(this.props);
let url = `/courses/${this.props.match.params.coursesId}/informs.json`;
//
axios.get(url).then((response) => {
if(response){
if(response.data){
this.setState({
description:response.data.description,
isSpin:false,
})
}else {
this.setState({
description:null,
isSpin:false,
})
}
}else {
this.setState({
description:null,
isSpin:false,
})
}
}).catch((error) => {
console.log(error)
this.setState({
description:null,
isSpin:false,
})
});
}
componentDidUpdate = (prevProps) => {
}
bianji = (bians)=>{
this.setState({
whethertoedit:bians,
})
};
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 id=this.props.match.params.coursesId
var url = `/courses/${id}/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,
})
this.props.showNotification(result.data.message);
}else {
this.props.showNotification(result.data.message);
}
}
}
}).catch((error) => {
console.log(error)
})
}else{
console.log(err);
}
});
}
render(){
let{description,whethertoedit} =this.state;
const {getFieldDecorator} = this.props.form;
return(
<React.Fragment >
<div id={"zhudiv"}>
<div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">公告栏</span>
{
this.props.isAdmin()===true?
<li className="btn colorblue font-16 fr" style={{cursor: "default"}}
onClick={() => this.bianji(true)}>
编辑
</li>
:""
}
</p>
</p>
</div>
<Spin size="large" spinning={this.state.isSpin} id={"cdiv"}>
<div id={"cdiv1"}>
{
whethertoedit === false?
<div>
{
description === null || description=== undefined ||description === "" ?
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
:
<div className="edu-back-white ">
<div id="MakedownHTML" className={"markdown-body fonttext yslmtopcg"} dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g, "▁▁▁")}}>
</div>
</div>
}
</div>
:
<div>
<Form layout='vertical' onSubmit={this.handleSubmit} >
<div className="edu-back-white ">
<div className={"yslmt16px"}>
<style>
{
`
.ant-form-item-children {
position: unset;
}
.rememberTip{
position:absolute;
right:0px;
bottom:-10px;
}
.chooseDes .ant-form-explain{
position:absolute;
bottom:-10px;
left:0px;
}
.ant-form-vertical .ant-form-explain {
margin-top: 0px !important;
margin-bottom: 0px !important;
padding-left: 0px !important;
}
.chooseDes .ant-form-item-with-help {
margin-bottom: 24px !important;
}
.courseMessageMD .ant-form-item-with-help {
margin-bottom: 24px !important;
}
.chooseDes .editormd-toolbar {
width: 100%;
min-height: 37px;
background: #fff;
display: none;
position: absolute !important;
left: 0;
z-index: 10;
border-bottom: 1px solid #ddd;
}
.yslmt16px .ant-form-item-with-help
{
margin-bottom: 24px !important;
}
`
}
</style>
<Form.Item
style={{"borderBottom":'none'}}
className="chooseDes "
>
{getFieldDecorator('description', {
rules: [{
required: true, message: '请在此输入内容,最多5000个字符',
}, {
max: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.messageRef}
placeholder={'请在此输入内容,最多5000个字符'}
initValue={description}
mdID={'courseMessageMD'}
className="courseMessageMD "
height={518}
></TPMMDEditor>
)}
</Form.Item>
</div>
</div>
<Form.Item>
<div className="clearfix mt28 fr" style={{display:"block;"}}>
<a className="defalutCancelbtn fl mr20" onClick={()=>this.bianji(false)}>取消</a>
<Button htmlType="submit" className="ant-btn defalutSubmitbtn fl ant-btn-primary">
<span> </span></Button>
</div>
</Form.Item>
</Form>
</div>
}
</div>
</Spin>
</div>
</React.Fragment>
)
}
}
const Eduinformss = Form.create({ name: 'eduinforms' })(Eduinforms);
export default Eduinformss;

@ -0,0 +1,13 @@
.yslmt16px{
padding-top: 25px !important;
padding-left: 25px !important;
padding-right: 25px !important;
padding-bottom: 1px !important;
}
.yslmtopcg
{
padding: 25px !important;
}

@ -0,0 +1,918 @@
import React, {Component} from "React";
import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon,AutoComplete,InputNumber} from "antd";
import ApplyForAddOrgModal from '../../user/modal/ApplyForAddOrgModal';
import axios from 'axios';
import "../css/Courses.css";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
import Modals from '../../modals/Modals';
const { Option } = Select;
const dateFormat = 'YYYY-MM-DD';
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
function disabledDateTime() {
return {
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
};
}
function disabledDate(current) {
console.log(current);
return current && current < moment().endOf('day').subtract(1, 'days');
}
function disabledDateysl(current) {
console.log(current);
return current && current < moment().endOf('day').add(1, 'days');
}
class Goldsubject extends Component {
constructor(props) {
super(props)
this.state = {
coursedata: undefined,
searchlist: [],
searchlistscholl:[],
listvalue: undefined,
fetching:false,
subject_id:"",
start_date:"",
}
}
// disabledEndDate= endValue => {
// const { datatimetwo } = this.state;
// var startValue =datatimetwo
// if (!endValue || !startValue) {
// return false;
// }
// return endValue.valueOf() < startValue.valueOf();
// };
isabledStartDate = (startValue) => {
const { datatime } = this.state;
var datatimes="";
if(datatime!==undefined){
datatimes=datatime;
datatimes=moment(datatimes, dateFormat).subtract(0, 'days');;
}else {
datatimes=datatime;
}
if (!startValue || !datatimes) {
return false;
}
return startValue.valueOf() > datatimes.valueOf();
};
disabledEndDate = (endValue) => {
// console.log("---------------------------------")
// console.log(moment(new Date(), dateFormat).add(1, 'days'));
// console.log(moment(new Date(), dateFormat).add(2, 'days'));
const { datatimetwo } = this.state;
var startvalue="";
if(datatimetwo!==undefined){
startvalue=datatimetwo;
startvalue=moment(startvalue, dateFormat).add(1, 'days');
}else {
startvalue=datatimetwo;
}
// console.log("结束时间");
// console.log(endValue);
// console.log(startvalue);
// console.log(datatimetwo);
if (!endValue || !startvalue) {
return false;
}
return endValue.valueOf() < startvalue.valueOf();
};
componentDidMount() {
console.log("新建金品课堂的数据");
console.log(this.props);
let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school;
// this.getschool("")
// this.Searchvalue("")
if (coursesId != undefined) {
let url = "/courses/" + coursesId + "/settings.json"
axios.get(url).then((result) => {
let data = result.data;
this.props.form.setFieldsValue({
course: data.course_list_name,
classroom: data.name,
period: data.class_period,
credit: data.credit,
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 === undefined ? "" : moment(data.start_date, dateFormat),
datatime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat),
is_public: this.props.match.params.id,
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);
})
}else{
let url = "/courses/new.json"
axios.get(url).then((result) => {
console.log(result)
}).catch((error) => {
console.log(error);
})
// console.log(user_school);
this.props.form.setFieldsValue({
school:user_school,
});
this.setState({
school:user_school,
});
this.handleSearchschool(user_school);
}
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user){
let user_school=this.props.current_user&&this.props.current_user.user_school;
this.props.form.setFieldsValue({
school:user_school,
});
this.setState({
school:user_school,
});
this.handleSearchschool(user_school);
}
}
onChangeTimepublishs = (date, dateString) => {
console.log("结束时间11111111111");
console.log(dateString);
if(dateString===""){
this.setState({
datatime: undefined,
})
console.log("结束时间111111111116");
this.props.form.setFieldsValue({
endtime:undefined,
});
}else{
console.log("结束时间111111111117");
this.setState({
datatime: dateString,
});
this.props.form.setFieldsValue({
endtime: moment(dateString, dateFormat),
});
}
};
onChangeTimepublishstwo = (date, dateString) => {
console.log("结束时间22222222222");
console.log(dateString);
if(dateString===""){
console.log("结束时间222222222223");
this.setState({
datatimetwo: undefined,
})
this.props.form.setFieldsValue({
starttime: undefined,
});
}else{
console.log("结束时间222222222224");
this.setState({
datatimetwo: dateString,
})
this.props.form.setFieldsValue({
starttime: moment(dateString, dateFormat),
});
}
};
cancelmodel = () => {
this.setState({
Modalstype: false,
Loadtype: false,
Modalstopval: "",
ModalCancel: "",
ModalSave: "",
})
}
scrollToAnchor = (anchorName) => {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
window.scrollTo(0, anchorElement.offsetTop - window.innerHeight / 2);
}
}
//提交数据的地方
handleSubmit = (e) => {
e.preventDefault();
let first_category_url=this.props.current_user.first_category_url;
let coursesId = this.props.match.params.coursesId;
var is_public =this.props.match.params.id;
let {datatime,datatimetwo} = this.state
// console.log(is_public)
if (coursesId != undefined) {
// 编辑
this.props.form.validateFields((err, values) => {
if (err) {
return;
}
// if(values.course===""||values.course===undefined){
// this.scrollToAnchor("iscourse")
// return
//
// }
// if(values.classroom===""||values.classroom===undefined){
// this.scrollToAnchor("isclassroom")
// return
// }
//
// if(values.school===""||values.school===undefined){
// // this.scrollToAnchor("isschool")
// return
//
// }
if(values.checkboxgroup.length===0){
this.setState({
Modalstype:true,
Modalstopval:"请您至少添加一个课堂模块,",
ModalsBottomval:"否则您将无法新建课堂。",
Loadtype:true,
ModalSave:()=>this.cancelmodel(),
})
return
}
if (!err) {
// console.log('Received values of form: ', values);
let url = "/courses/" + coursesId + ".json";
axios.put(url, {
// subject_id:128, //这是带过来的值 编辑就不要传值了
name: values.classroom,
class_period: values.period,
credit: parseFloat(values.credit),
start_date:values.starttime,
end_date: values.endtime,
is_public: is_public, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
}
).then((response) => {
// debugger
if (response.data.status === 0) {
// this.goback()
window.location.href=first_category_url;
var yslGuideone = window.localStorage.getItem('yslGuideone');
try {
if(yslGuideone=== null){
window.localStorage.setItem('yslGuideone', "true");
return
}
if(yslGuideone=== undefined){
window.localStorage.setItem('yslGuideone', "true");
return
}
}catch (e) {
}
}
}).catch((error) => {
console.log(error)
})
}
console.log("错误信息信息信息1");
console.log(err);
console.log(values.starttime);
console.log(values.endtime);
});
} else {
this.props.form.validateFields((err, values) => {
console.log("错误信息信息信息2");
console.log(err);
if (err) {
return;
}
// if(values.course===""||values.course===undefined){
// this.scrollToAnchor("iscourse")
// return
// }
// if(values.classroom===""||values.classroom===undefined){
// this.scrollToAnchor("isclassroom")
// return
// }
// if(values.school===""||values.school===undefined){
// // this.scrollToAnchor("isschool")
// return
//
// }
if (!err) {
// debugger
//新建
// console.log('Received values of form: ', values);
let url = "/courses.json";
axios.post(url, {
subject_id:128, //这是带过来的值
name: values.classroom,
class_period: values.period,
credit: parseFloat(values.credit),
start_date:values.starttime,
end_date: values.endtime,
is_public: is_public, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
}
).then((response) => {
if (response.status === 200) {
// this.goback
window.location.href=response.data.first_category_url;
var yslGuideone = window.localStorage.getItem('yslGuideone');
try {
if(yslGuideone=== null){
window.localStorage.setItem('yslGuideone', "true");
return
}
if(yslGuideone=== undefined){
window.localStorage.setItem('yslGuideone', "true");
return
}
}catch (e) {
}
}
}).catch((error) => {
console.log(error)
})
}
});
}
}
goback = () => {
// if(this.props.match.params.coursesId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
// window.history.go(-1)
this.props.history.goBack()
}
onCheckAllChange = (e) => {
// console.log(e.target.checked)
this.setState({
is_public: e.target.checked == true ? 1 : 0,
});
}
onchanges =(e)=>{
this.setState({
Realnamecertification:e.target.checked,
})
// console.log(e.target.checked);
}
onchangess=(e)=>{
this.setState({
Professionalcertification:e.target.checked,
})
// console.log(e.target.checked);
}
Searchvalue=(value)=>{
let url="/courses/search_course_list.json";
axios.post(url,{
search:value
}).then((result)=>{
// console.log(result.data)
if (result.data.message===undefined) {
this.setState({
searchlist: result.data.course_lists,
// course:value,
})
}
// this.props.form.setFieldsValue({
// course:value
// })
}).catch((error)=>{
console.log(error)
})
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
this.Searchvalue(value)
}
};
handleChange=(value)=>{
this.props.form.setFieldsValue({
// course:value,
classroom:value
})
};
handleSearchschool=(value)=>{
if(value!="") {
// this.props.form.setFieldsValue({
// // school: value,
// fetching: true,
// });
this.setState({
fetching: true,
school: value
})
this.getschool(value)
}
};
handleChangeschools=(value)=>{
// this.props.form.setFieldsValue({
// // school: value,
// fetching: true,
// });
// this.setState({
// fetching: true
// })
}
handleChangeschool=(value)=>{
this.setState({
school:value
});
this.props.form.setFieldsValue({
school:value,
})
};
getschool=(value)=>{
// this.props.form.setFieldsValue({
// school: value
// })
let url="/schools/school_list.json";
axios.get(url,{
params: {
search: value
}
}).then((result)=>{
if(result){
if (result.data.status===0) {
this.setState({
searchlistscholl: result.data.school_names,
})
if(result.data.school_names.length!=0){
this.setState({
fetching: false
})
}
}
}
}).catch((error)=>{
console.log(error)
})
}
showApplyForAddOrgModal = () => {
this.applyForAddOrgForm.setVisible(true)
}
render() {
let {datatime,datatimetwo,school,searchlistscholl} = this.state;
const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
const options = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
const optionschool = this.state.searchlistscholl===undefined?"":this.state.searchlistscholl===null?"":this.state.searchlistscholl==="[]"?"":this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school)
// form合并了
// console.log("获取到的数据");
// console.log(this.state);
// console.log(this.props);
// console.log(this.props.current_user);
return (
<React.Fragment>
<div>
<style>
{
`
.color-green-light {
color: #45E660!important;
}
`
}
</style>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...propsWithoutForm}></ApplyForAddOrgModal>
{/*提示*/}
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{width: '100%', height: '70px'}}>
<p className="ml15 fl color-black mt30 summaryname">{this.props.match.params.coursesId === undefined ? "新建课堂" : "编辑课堂"}</p>
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
<style>
{`
.ant-col-12{
width:800px;
}
`}
</style>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses"}>
{/*内容*/}
<style>
{`
.ant-select-dropdown{
// top: 221px !important;
// left: 115px !important;
width: 280px !important;
height: 160px;
}
.ant-select-dropdown-menu{
width: 280px !important;
height: 160px;
}
.construction .ant-input{
width: 280px !important;
margin-left: 0px !important;
}
.construction {
width: 280px;
margin-left: 10px;
}
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
line-height: 28px;
z-index: 2000;
}
`}
</style>
{/*<div className="stud-class-set bor-bottom-greyE padding10200 ">*/}
{/* <div className={"TabsWarpcourse"}>*/}
{/* <Form.Item label="课程名称">*/}
{/* {getFieldDecorator('course', {*/}
{/* rules: [{required: true, message: "不能为空"}],*/}
{/* })(*/}
{/* <AutoComplete style={{ width: 280 }}*/}
{/* onSearch={this.handleSearch}*/}
{/* onChange={this.handleChange}*/}
{/* className={"fl construction "}*/}
{/* placeholder="例如:数据结构"*/}
{/* >*/}
{/* {options}*/}
{/* </AutoComplete>*/}
{/* )}*/}
{/* <span className={"newcoursestitle fl"}>*/}
{/* /!*错误示例数据结构2017本部数据结构2017秋季数据结构2017电子商务1班*!/*/}
{/* <p className="ant-progress-text">*/}
{/* <Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>*/}
{/* <span className={"color-grey-9 font-12 ml5"}>正确示例:数据结构</span>*/}
{/* </p>*/}
{/* <p className="ant-progress-text">*/}
{/* <Icon style={{ color: 'red' }} theme="filled" type="close-circle"/>*/}
{/* <span className={"color-grey-9 font-12 ml5"}>错误示例数据结构2019春</span>*/}
{/* </p>*/}
{/* </span>*/}
{/* <div id='iscourse'></div>*/}
{/* </Form.Item>*/}
{/* </div>*/}
{/*</div>*/}
<style>
{
`
.ml19{
margin-left:19px;
} }
`
}
</style>
<div className="stud-class-set bor-bottom-greyE padding1020 ">
<Form.Item label="课堂名称">
{getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete style={{ width: 280 }}
onSearch={this.handleSearch}
onChange={this.handleChange}
className={"fl construction "}
placeholder="例如:数据结构"
>
{options}
</AutoComplete>
)}
<span className={"newcoursestitle fl"}>
{/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/}
<p className="ant-progress-text">
<Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>
<span className={"color-grey-9 font-12 ml5"}>正确示例数据结构2019春季班级</span>
</p>
<p className="ant-progress-text">
<Icon style={{ color: 'red' }} theme="filled" type="close-circle"/>
<span className={"color-grey-9 font-12 ml5"}>错误示例2019春季班级数据结构</span>
</p>
</span>
<div id='isclassroom'></div>
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE padding1020 coursenavbox coursenavboxtow yslinputcourput">
<style>
{`
.ant-form-item{
margin-bottom: 10px !important;
}
`}
</style>
<Form.Item
label="总学时"
hasFeedback
>
{getFieldDecorator("period",
{
rules:[{
required:false,
pattern: new RegExp(/^[0-9]\d*$/, "g"),
message: ''
}],
getValueFromEvent: (event) => {
return event.target.value.replace(/\D/g,'')
}}
)(
<Input id="period" className="greyInput " placeholder="例如30"/>
)}
</Form.Item>
<Form.Item
label="学分"
hasFeedback
>
{getFieldDecorator("credit",
{
rules:[{
required:false,
pattern: new RegExp(/^[0-9]\d*$/, "g"),
message: ''
}],
getValueFromEvent: (event) => {
return event.target.value.replace(/\D/g,'')
}}
)(
<Input id="credit" className={"greyInput "} placeholder="例如3"/>
)}
</Form.Item>
<Form.Item
label="开始时间"
>
{getFieldDecorator("starttime", {
rules: [{type: 'object',required: true, message: "开始时间不能为空"}],
})(
<span className="fl mt5">
<DatePicker
showToday={false}
placeholder="请选择开始时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatimetwo === undefined ? "" :datatimetwo === null ? "" : moment(datatimetwo, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={this.isabledStartDate}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishstwo}
/>
</span>
)}
</Form.Item>
<Form.Item
label="结束时间"
>
{getFieldDecorator("endtime", {
rules: [{type: 'object',required: true, message: "结束时间不能为空"}],
})(
<span className="fl mt5">
<DatePicker
showToday={false}
placeholder="请选择结束时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatime === undefined ? "" :datatime === null ? "" : moment(datatime, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={this.disabledEndDate}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishs}
/>
</span>
)}
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE padding10200 coursenavbox">
<Form.Item
label="课堂模块"
hasFeedback
>
{getFieldDecorator("checkboxgroup", {
initialValue: [
"announcement","online_learning","shixun_homework", "exercise",
],
})(
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
<Checkbox value={"announcement"} className="fl" defaultChecked disabled>公告栏</Checkbox>
<Checkbox value={"online_learning"} className="fl" defaultChecked disabled>在线学习</Checkbox>
<Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox>
<Checkbox value={"common_homework"} className="fl">普通作业</Checkbox>
<Checkbox value={"exercise"} className="fl">试卷</Checkbox>
<Checkbox value={"poll"} className="fl">问卷</Checkbox>
<Checkbox value={"attachment"} className="fl">资源</Checkbox>
<Checkbox value={"board"} className="fl">讨论</Checkbox>
<Checkbox value={"course_group"} className="fl">分班</Checkbox>
</Checkbox.Group>
)}
</Form.Item>
</div>
{/*<div className="stud-class-set bor-bottom-greyE padding10200 coursenavbox height100px" >*/}
{/* <span className={"fl"}>*/}
{/* <Form.Item*/}
{/* label="加入课堂条件"*/}
{/* style={{margin: 0}}*/}
{/* >*/}
{/* {getFieldDecorator("Realnamecertification")(*/}
{/* <Checkbox checked={this.state.Realnamecertification} onChange={this.onchanges}>已实名认证</Checkbox>*/}
{/* // <Checkbox.Group style={{ width: "800px",marginTop: "10px"}}>*/}
{/* // <Checkbox value={"authentication"} className="fl">已实名认证</Checkbox>*/}
{/* // <Checkbox value={"professional_certification"} className="fl">已职业认证 <span className="ml30" > (勾选,则通过邀请码加入课堂的用户,需要完成相关认证才能加入课堂)</span></Checkbox>*/}
{/* // </Checkbox.Group>*/}
{/* )}*/}
{/* </Form.Item>*/}
{/* </span>*/}
{/* <span className={"fl mt40"}>*/}
{/* <Form.Item*/}
{/* label=""*/}
{/* >*/}
{/* {getFieldDecorator("Professionalcertification")(*/}
{/* <Checkbox checked={this.state.Professionalcertification} onChange={this.onchangess}>已职业认证<span*/}
{/* className="coursesselects"> (勾选,则通过邀请码加入课堂的用户,需要完成相关认证才能加入课堂)</span></Checkbox>*/}
{/* )}*/}
{/* </Form.Item>*/}
{/* </span>*/}
{/*</div>*/}
{/*<div className="stud-class-set padding10200 coursenavbox bor-bottom-greyE">*/}
{/* <Form.Item*/}
{/* label="公开设置"*/}
{/* hasFeedback*/}
{/* >*/}
{/* {getFieldDecorator("publicclass")(*/}
{/* <Checkbox id="publicclass"*/}
{/* onChange={this.onCheckAllChange}*/}
{/* checked={this.state.is_public}*/}
{/* className="fl">公开课堂</Checkbox>*/}
{/* )}*/}
{/* <span className={"coursesselect"}>(选中后本课堂对所有用户可见,否则仅本课堂成员可见)</span>*/}
{/* </Form.Item>*/}
{/*</div>*/}
<div className="stud-class-set padding10200 mb20">
<Form.Item label="课堂所属单位">
{getFieldDecorator('school', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools}
className={"fl construction mr10 "}
placeholder="请输入并选择课本堂的所属单位"
>
{optionschool}
</AutoComplete>
)}
<span className={"newcoursestitle fl"}>
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
</span>
<div id='isschool'></div>
</Form.Item>
{searchlistscholl.length===0&&this.state.fetching===true?<div style={{height:"20px",lineHeight:"20px"}} className="ml20">
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
</span>
</div>:""}
</div>
<div className={"FAFAFA"}>
<Form.Item >
<div className="clearfix mt40 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">
提交
</Button>
{/*<a className="defalutSubmitbtn fl mr20">提交</a>*/}
<a className="defalutCancelbtn fl" onClick={this.goback}>取消</a>
</div>
</Form.Item>
</div>
</Form>
</div>
</div>
</div>
</React.Fragment>
)
}
}
const WrappedCoursesNewAppGoldclass = Form.create({name: 'goldsubject'})(Goldsubject);
export default WrappedCoursesNewAppGoldclass;

@ -191,7 +191,7 @@ class CommitSummary extends Component{
font-feature-settings: 'tnum';
/* margin-bottom: 24px; */
vertical-align: top;
}
}
`
}
</style>

@ -2412,7 +2412,7 @@ class Listofworksstudentone extends Component {
console.log(error)
});
}
};
//
// setComputeTime=()=>{
// this.setState({

@ -511,7 +511,7 @@
height: 53%;
}
.ysldiv71024{
margin-top: 31%;
margin-top: 31% ;
margin-left: 27%;
margin-right: 0;
height: 40%;

@ -230,7 +230,7 @@ class ShixunsHome extends Component {
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>
{/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
</div>
<div className={item.power === false ? "closeSquare" : "none"}>
@ -301,7 +301,7 @@ class ShixunsHome extends Component {
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>
{/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
</div>
<div className={item.power === false ? "closeSquare" : "none"}>

@ -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="600px"
>
<div className="educouddiv">
<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>
</div>
</Modal>
)
}
}
export default Jointheclass;

@ -1,3 +1,46 @@
.userbluebgfont{
color:#fff !important;
.userbluebgfont{
color:#fff !important;
}
.kaike{
border-radius: 4px;
border: 1px solid rgba(255,255,255);
padding: 0px 10px;
cursor: pointer;
font-size: 14px;
display: block;
width: 120px;
text-align: center;
height: 40px;
line-height: 40px!important;
border-radius: 4px;
box-sizing: border-box;
}
.userNavs{
line-height: 96px;
background: #fff;
height:96px;
background:rgba(255,255,255,1);
box-shadow:3px 5px 11px 1px rgba(230,230,230,0.5);
border-radius:4px;
}
.userNavs li {
display: inline-block;
padding: 0 30px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.newbianji1{
font-size: 16px !important;
margin-right: 10px;
color: #4CACFF;
margin-bottom: 3px;
display: inline-block;
}
.solidright{
border-right: 1px solid #000;
height: 42px;
}

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { Modal,Radio,Input,Tooltip } from "antd";
import { Modal,Radio,Input,Tooltip, Menu, Dropdown, Icon,Breadcrumb } from "antd";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import SendPanel from "./sendPanel.js";
import { getImageUrl } from 'educoder';
@ -20,10 +20,25 @@ class DetailTop extends Component{
Modalsbottomval:'',
loadtype:false,
deletepathtype:false,
cardsModalsavetype:false
cardsModalsavetype:false,
MenuItemskey:1,
courseslist:[]
}
}
componentDidMount(){
let courseslist=[]
this.props.courses.map((item,key)=>{
if(1===key+1){
return(
courseslist.push(item)
)
}
})
this.setState({
courseslist:courseslist
})
console.log(courseslist)
}
allow_deletepath=()=>{
this.setState({
Modalstype:true,
@ -141,6 +156,29 @@ class DetailTop extends Component{
})
}
onVisibleChanges=(type)=>{
this.setState({
onVisibleChangestype:type
})
}
MenuItems=(keys)=>{
let courseslist=[]
this.props.courses.map((item,key)=>{
if(keys===key+1){
return(
courseslist.push(item)
)
}
})
console.log(courseslist)
this.setState({
MenuItemskey:keys,
courseslist:courseslist
})
}
render(){
let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
@ -150,8 +188,28 @@ class DetailTop extends Component{
lineHeight: '30px',
};
return(
<div className="subhead">
// <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}>
let menu = (
<Menu>
{this.props.courses&&this.props.courses.map((item,key)=>{
return(
<Menu.Item>
<a rel="noopener noreferrer" onClick={()=>this.MenuItems(key+1)}>
{key+1}次开课
</a>
</Menu.Item>
)
})}
</Menu>
);
return(
<div className={this.props.courses===undefined?"subhead":"subhead mb70"}>
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
@ -161,14 +219,37 @@ class DetailTop extends Component{
loadtype={loadtype}
>
</Modals>
{/*<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}>*/}
{
detailInfoList &&
<div className="subhead_content">
<div className={this.props.courses===undefined?"subhead_content":"subhead_content pt100"}>
<div className="font-28 color-white clearfix">
<span className="fl lineh-40">
{detailInfoList.name}
</span>
<style>
{
`
.tag-orange .tag-name{
display: block;
width: auto;
background-color: #FF6800;
background-size: 100% 100%;
padding: 0px 4px;
color: #fff;
float: left;
height: 28px;
line-height: 28px;
font-size: 14px;
border-radius: 4px;
}
`
}
</style>
{this.props.courses===undefined?"":
<span className="tag-orange">
<span className="tag-name mt6 ml10">开放课程</span>
</span>}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
<Tooltip placement="bottom" title={"编辑"}>
<Link to={"/paths/"+this.props.match.params.pathId+"/edit"} className="ml10 ring-green fl mt10" >
@ -178,15 +259,15 @@ class DetailTop extends Component{
:""
}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?this.props.courses===undefined?
<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="user_default_btn edu-greenback-btn fr font-18"
>
学习统计
</Link>:""
</Link>:"":""
}
{ detailInfoList.allow_send === true &&
<SendPanel {...this.props} {...this.state}></SendPanel>
{ detailInfoList.allow_send === true?this.props.courses===undefined?
<SendPanel {...this.props} {...this.state}></SendPanel>:"":""
}
</div>
@ -202,7 +283,7 @@ class DetailTop extends Component{
{ detailInfoList.member_count!=0 ? <li><span>学习人数</span><span>{detailInfoList.member_count}</span></li> : ""}
</ul>
}
<div className="fr pr">
{this.props.courses===undefined?<div className="fr pr">
{detailInfoList===undefined?"":detailInfoList.allow_delete===true?<a
className={detailInfoList.publish_status===-1?"fl font-18 color-white mt5 mr20":"fl font-18 color-white mt5"}
style={{opacity: '0.6'}} onClick={this.allow_deletepath}
@ -210,29 +291,191 @@ class DetailTop extends Component{
{
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
<a className="user_default_btn user_bluebg_btn font-18 fl ml40 userbluebgfont"
onClick={this.applyissuePath}
>申请发布</a>:""
<a className="user_default_btn user_bluebg_btn font-18 fl ml40 userbluebgfont" onClick={this.applyissuePath}>申请发布</a>:""
}
{
detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true?
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40"
onClick={this.cancelissuePath}
>撤销申请</a>:""
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40" onClick={this.cancelissuePath}>撤销申请</a>:""
}
{
detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40"
onClick={this.reovkissuePath}
>撤销发布</a>:""
<a className="user_default_btn user_grey_btn font-18 fl pointer ml40" onClick={this.reovkissuePath}>撤销发布</a>:""
}
</div>
</div>:""}
{this.props.courses===undefined?"":detailInfoList.is_creator===true?<div className="fr pr">
<a className={"fl font-18 color-white mt5 kaike mr20"}>开课</a>
<Link to={"/paths/"+this.props.match.params.pathId+"/statistics"} className="fl font-18 color-white mt5 kaike">
学习统计
</Link>
</div>:""}
</div>
{/*{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20">*/}
{this.props.courses===undefined?"":<div className="userNavs mt20">
<li className={"fl"}>
<style>
{
`
.anticon-down{
font-size:14px !important;
transform:none !important;
}
.ant-dropdown-menu-item:hover, .ant-dropdown-menu-submenu-title:hover {
background-color: rgba(240,240,240,1);
}
.alist{
color:#000;
}
.alist:hover{
color:#000;
}
.aIcons{
color:#CDCDCD;
}
`
}
</style>
<Dropdown
overlay={menu}
onVisibleChange={this.onVisibleChanges}
>
<a className={"alist"}>
<i className="iconfont icon-bianji1 newbianji1"></i><span className={"color-orange"}>{this.state.MenuItemskey}</span> <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
</a>
</Dropdown>
</li>
<style>
{
`
.pdt28{
padding-top: 28px;
}
.ml23{
margin-left:23px;
}
.pathtime{
color: #9B9B9B;
font-size: 12px;
}
.pathtimes{
color: #05101A;
font-size: 14px;
}
`
}
</style>
<li className={"ml20"}>
{this.state.courseslist.map((item,key)=>{
// course_id: 1309
// course_identity: 5
// course_status: {status: 1, time: "进行至第5周共1642周"}
// first_category_url: "/courses/1309/informs"
return(
<div className={"ant-breadcrumb pdt28"} key={key}>
<span>
<div className="ant-breadcrumb-link fl mr23">
<div className={"pathtime"}>
开课时间
</div>
<div className={"pathtimes"}>
{item.start_date}
</div>
</div>
<div className="fl solidright"></div>
</span>
<span>
<div className="ant-breadcrumb-link fl mr23 ml23">
<div className={"pathtime"}>
结课时间
</div>
<div className={"pathtimes"}>
{item.end_date}
</div>
</div>
<div className="fl solidright"></div>
</span>
<span>
<div className="ant-breadcrumb-link fl mr23 ml23">
<div className={"pathtime"}>
报名人数
</div>
<div className={"pathtimes"}>
{item.student_count}
</div>
</div>
</span>
</div>
)
})
}
</li>
<li className={"fr"}>
<style>
{
`
.user-colorgrey-9b{color:#9B9B9B}
.user-colorgrey-green{color:#7ED321}
.background191{
background: rgba(191,191,191,1) !important;
color: #fff;
}
`
}
</style>
{this.state.courseslist.map((item,key)=>{
return(
<div key={key}>
{item.course_status.status===0?<a className="mr30 shixun_detail pointer fl user-colorgrey-green">即将开课</a>:""}
{item.course_status.status===1?<a className="mr30 shixun_detail pointer fl color-orange">{item.course_status.time}</a>:""}
{item.course_status.status===2?
detailInfoList.is_creator===true?<a className="mr30 shixun_detail pointer fl user-colorgrey-9b">已结束</a>:item.course_identity<6?
<a className="mr30 shixun_detail pointer fl user-colorgrey-9b">已结束</a>:"":""}
{item.course_status.status===0?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt25"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt25" >立即报名</a>:""}
{item.course_status.status===1?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt25" ></a>:""}
{item.course_status.status===2?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt25" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="fr user_default_btn background191 font-18 mt25"></div>:""}
</div>
)})}
</li>
</div>}
</div>
}
</div>
)

@ -69,6 +69,9 @@ class PathDetailIndex extends Component{
constructor(props){
super(props)
this.state={
progress:undefined,
tags:undefined,
members:undefined,
detailInfoList:undefined,
clickdetailInfoListtype:false,
Modalstype:false,
@ -78,6 +81,32 @@ class PathDetailIndex extends Component{
cardsModalsave:this.cardsModalsave,
user_id:undefined,
loadtype:false,
courses:[
{
course_id: 1309,
first_category_url: "/courses/1309/informs",
start_date: "2019-07-16", // 开始时间
end_date: "2050-12-31", // 结束时间
student_count: 112, // 学习人数
course_identity: 5, // 当前用户在该课堂的身份
course_status: {
status: 1, // status0即将开课 1进行中 2已结束
time: "进行至第5周共1642周" // time当前进度
}
},
{
course_id: 1319,
first_category_url: "/courses/1319/shixun_homeworks/11549",
start_date:"2019-08-16",
end_date:"2050-12-31",
student_count: 112,
course_identity: 1,
course_status: {
status: 0,
time: ""
}
}
],
items: getItems(10)
}
this.onDragEnd = this.onDragEnd.bind(this);
@ -95,16 +124,17 @@ class PathDetailIndex extends Component{
}
const items = reorder(
this.state.detailInfoList.members,
this.state.members,
result.source.index,
result.destination.index
);
this.state.detailInfoList.members=items;
this.setState({
detailInfoList:this.state.detailInfoList,
members:items,
items
});
console.log(this.state.detailInfoList.members)
console.log(this.state.members)
console.log("items 数组数组数组数组")
console.log(items)
}
@ -157,13 +187,40 @@ class PathDetailIndex extends Component{
if(result.data.allow_visit===true){
this.setState({
detailInfoList:result.data,
items: getItems(result.data.members.length),
// courses:result.data.courses
// items: getItems(result.data.members.length),
})
}
}).catch((error)=>{
console.log(error);
})
let righturl="/paths/"+pathid+"/right_banner.json";
axios.get(righturl).then((result)=>{
if (result.data.status === 407 || result.data.status === 401) {
debugger
return;
}
if (result.data.status === 403) {
debugger
// window.location.href = "/403";
return;
}
this.setState({
// detailInfoList:result.data,
tags:result.data.tags,
progress:result.data.progress,
members:result.data.members,
items: getItems(result.data.members.length),
})
}).catch((error)=>{
console.log(error);
})
}
updatadetailInfoList=()=>{
@ -282,9 +339,10 @@ class PathDetailIndex extends Component{
console.log("上移");
// console.log(this.state.detailInfoList.members);
// console.log(response);
this.state.detailInfoList.members=response.data.members;
this.setState({
detailInfoList:this.state.detailInfoList,
members:response.data.members
});
// console.log(this.state.detailInfoList.members);
@ -307,9 +365,9 @@ class PathDetailIndex extends Component{
console.log("下移");
// console.log(this.state.detailInfoList.members);
// console.log(response);
this.state.detailInfoList.members=response.data.members;
this.setState({
detailInfoList:this.state.detailInfoList,
members:response.data.members
});
// console.log(this.state.detailInfoList.members);
}
@ -329,7 +387,11 @@ class PathDetailIndex extends Component{
Modalsbottomval,
cardsModalcancel,
cardsModalsave,
loadtype
loadtype,
progress,
members,
tags,
courses,
} = this.state
@ -403,14 +465,14 @@ class PathDetailIndex extends Component{
}
</div>
</div>
{detailInfoList === undefined ? "" : detailInfoList.tags === null ? "":
{tags === undefined ? "" :tags === null ? "":
<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="clearfix" id="boxheight">
{
detailInfoList.tags && detailInfoList.tags.map((item,key)=>{
tags && tags.map((item,key)=>{
return(
<span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span>
)
@ -420,7 +482,7 @@ class PathDetailIndex extends Component{
</div>
<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)}
><span className="mr8">...</span><Icon type="caret-down" />
</div>
@ -435,29 +497,29 @@ class PathDetailIndex extends Component{
</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">
<p className="mb20">
<span className="font-16 mr10">我的进展</span>
<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>
</p>
<p className="clearfix mb10">
<span className="fl color-green">已学 {detailInfoList.progress.learned}%</span>
<span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(detailInfoList.progress.time)} </span>
<span className="fl color-green">已学 {progress.learned}%</span>
<span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span>
</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>
}
{
detailInfoList ===undefined ?"":detailInfoList.members === null ?"":
members ===undefined ?"":members === null ?"":
<div className="teacherTeam edu-back-white clearfix" id="subject_members">
<p className="font-16 clearfix">教学团队</p>
{ detailInfoList===undefined?
detailInfoList.members && detailInfoList.members.map((item,key)=>{
{ members===undefined?
members && members.map((item,key)=>{
return(
<div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl">
@ -478,8 +540,8 @@ class PathDetailIndex extends Component{
</div>
)
})
:detailInfoList.allow_add_member===true?
detailInfoList.members && detailInfoList.members.map((item,key)=>{
:detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
members && members.map((item,key)=>{
return(
<div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl">
@ -501,7 +563,7 @@ class PathDetailIndex extends Component{
{
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+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>
:""
}
@ -510,7 +572,7 @@ class PathDetailIndex extends Component{
</div>
)
})
: detailInfoList.members && detailInfoList.members.map((item,key)=>{
: members && members.map((item,key)=>{
return(
<div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl">

@ -13,6 +13,33 @@ class ShixunPathCard extends Component{
let {pathList}=this.props;
return(
<div className="educontent" id="subjects_list_content">
<style>
{
`
.tag-green{
position: absolute;
left: 15px;
bottom: 95px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;
line-height: 28px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
`
}
</style>
{
pathList && pathList.length > 0 ?
(
@ -22,23 +49,31 @@ class ShixunPathCard extends Component{
return(
<div className="square-Item" id={"item_"+key}>
{
item.tag_name === null ? "" :
<div className="tag-green">
<span className="tag-name">{item.tag_name}</span>
<img src={getImageUrl('images/educoder/tag2.png')}/>
{/*<img src={getImageUrl('images/educoder/tag2.png')}/>*/}
</div>
}
<div className={item.allow_visit=== false ? "closeSquare" : "none"}>
{
item.excellent === false ? "" :
<div className="tag-orange">
<span className="tag-name">开放课程</span>
</div>
}
<div className={item.allow_visit=== false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25"/>
<p className="font-14 color-white">非试用内容需要授权</p>
</div>
<Link to={"/paths/"+item.id} className="square-img" >
{/*target="_blank"*/}
<img alt="13?1543211263" src={"/"+item.image_url} style={{"display":"block"}}/>
<img alt="详情图片" src={"/"+item.image_url} style={{"display":"block"}}/>
</Link>
<div className="square-main">
<p className="task-hide">
@ -77,4 +112,5 @@ class ShixunPathCard extends Component{
)
}
}
export default ShixunPathCard;
export default ShixunPathCard;

@ -107,7 +107,7 @@ export default class TPMFork_listComponent extends Component {
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img src={require(`./shixunCss/tag2.png`)}/>
{/*<img src={require(`./shixunCss/tag2.png`)}/>*/}
</div>
<div className={item.power === false ? "closeSquare" : "none"}>

@ -88,7 +88,7 @@ class ShixunCard extends Component {
item.tag_name === null ? "":
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>
{/*<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>*/}
</div>
}
<div className={item.power === false ? "closeSquare" : "none"}>

@ -159,7 +159,9 @@ class InfosPath extends Component{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/paths/${item.id}`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/></div>
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/}
</div>
}
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a>
<div className="square-main">

@ -1,203 +1,205 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosShixun extends Component{
constructor(props){
super(props);
this.state={
category:undefined,
page:1,
sort_by:'time',
status:undefined,
per_page:16,
isSpin:false,
totalCount:undefined,
data:undefined
}
}
componentDidMount=()=>{
this.setState({
isSpin:true
})
let{category,status,sort_by,page}=this.state;
this.getCourses(category,status,sort_by,page);
}
getCourses=(category,status,sort_by,page)=>{
let url=`/users/${this.props.match.params.username}/shixuns.json`;
axios.get((url),{params:{
category,
status,
sort_by,
page,
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
totalCount:result.data.count,
data:result.data,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//切换种类
changeCategory=(cate)=>{
this.setState({
category:cate,
status:undefined,
page:1,
isSpin:true
})
let{sort_by}=this.state;
this.getCourses(cate,undefined,sort_by,1);
}
// 切换状态
changeStatus=(status)=>{
this.setState({
status,
page:1,
isSpin:true
})
let{category,sort_by}=this.state;
this.getCourses(category,status,sort_by,1);
}
//切换页数
changePage=(page)=>{
this.setState({
page,
isSpin:true
})
let{category,sort_by,status}=this.state;
this.getCourses(category,status,sort_by,page);
}
// 进入课堂
turnToCourses=(url)=>{
this.props.history.push(url);
}
// 切换排序方式
changeOrder= (sort)=>{
this.setState({
sort_by:sort,
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,sort,page);
}
render(){
let{
category,
status,
sort_by,
page,
data,
totalCount,
isSpin
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div>
{
category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="editing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("editing")}>编辑中</a></li>
<li className={status=="applying" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("applying")}>待审核</a></li>
<li className={status=="published" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("published")}>已发布</a></li>
<li className={status=="closed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("closed")}>已关闭</a></li>
</div>
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>未通关</a></li>
<li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li>
</div>
}
<div className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span>
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{sort_by=="time"?"时间最新":"语言类别"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("time")}>时间最新</li>
<li onClick={()=>this.changeOrder("language")}>语言类别</li>
</ul>
</li>
</div>
</div>
<div className="square-list clearfix">
{
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{
(!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
}
{
data && data.shixuns && data.shixuns.map((item,key)=>{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/></div>
}
<a href="javascript:void(0)" className="square-img">
<img src={setImagesUrl(`${item.image_url}`)}/>
</a>
<div className="square-main">
<p className="task-hide">
<a href="javascript:void(0)" className="justify color-grey-name">{item.name}</a>
</p>
<div className="user-bar mt10">
<p style={{'width': `${parseFloat(parseInt(item.finished_challenges_count)/parseInt(item.challenges_count)).toFixed(2)*100}%`}}></p>
</div>
<p className="color-blue font-14 clearfix">
已完成 {item.finished_challenges_count} / {item.challenges_count}
</p>
</div>
</div>
)
})
}
</div>
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div>
}
</Spin>
</div>
)
}
}
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosShixun extends Component{
constructor(props){
super(props);
this.state={
category:undefined,
page:1,
sort_by:'time',
status:undefined,
per_page:16,
isSpin:false,
totalCount:undefined,
data:undefined
}
}
componentDidMount=()=>{
this.setState({
isSpin:true
})
let{category,status,sort_by,page}=this.state;
this.getCourses(category,status,sort_by,page);
}
getCourses=(category,status,sort_by,page)=>{
let url=`/users/${this.props.match.params.username}/shixuns.json`;
axios.get((url),{params:{
category,
status,
sort_by,
page,
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
totalCount:result.data.count,
data:result.data,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//切换种类
changeCategory=(cate)=>{
this.setState({
category:cate,
status:undefined,
page:1,
isSpin:true
})
let{sort_by}=this.state;
this.getCourses(cate,undefined,sort_by,1);
}
// 切换状态
changeStatus=(status)=>{
this.setState({
status,
page:1,
isSpin:true
})
let{category,sort_by}=this.state;
this.getCourses(category,status,sort_by,1);
}
//切换页数
changePage=(page)=>{
this.setState({
page,
isSpin:true
})
let{category,sort_by,status}=this.state;
this.getCourses(category,status,sort_by,page);
}
// 进入课堂
turnToCourses=(url)=>{
this.props.history.push(url);
}
// 切换排序方式
changeOrder= (sort)=>{
this.setState({
sort_by:sort,
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,sort,page);
}
render(){
let{
category,
status,
sort_by,
page,
data,
totalCount,
isSpin
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div>
{
category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="editing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("editing")}>编辑中</a></li>
<li className={status=="applying" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("applying")}>待审核</a></li>
<li className={status=="published" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("published")}>已发布</a></li>
<li className={status=="closed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("closed")}>已关闭</a></li>
</div>
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>未通关</a></li>
<li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li>
</div>
}
<div className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span>
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{sort_by=="time"?"时间最新":"语言类别"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("time")}>时间最新</li>
<li onClick={()=>this.changeOrder("language")}>语言类别</li>
</ul>
</li>
</div>
</div>
<div className="square-list clearfix">
{
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{
(!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
}
{
data && data.shixuns && data.shixuns.map((item,key)=>{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/>*/}
</div>
}
<a href="javascript:void(0)" className="square-img">
<img src={setImagesUrl(`${item.image_url}`)}/>
</a>
<div className="square-main">
<p className="task-hide">
<a href="javascript:void(0)" className="justify color-grey-name">{item.name}</a>
</p>
<div className="user-bar mt10">
<p style={{'width': `${parseFloat(parseInt(item.finished_challenges_count)/parseInt(item.challenges_count)).toFixed(2)*100}%`}}></p>
</div>
<p className="color-blue font-14 clearfix">
已完成 {item.finished_challenges_count} / {item.challenges_count}
</p>
</div>
</div>
)
})
}
</div>
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div>
}
</Spin>
</div>
)
}
}
export default InfosShixun;

@ -114,8 +114,25 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.smallSquare:nth-child(3n+0){margin-right: 0px;}
.partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;}
/*块状列表上面的绿色标签*/
.tag-green{position: absolute;left: 0px;top:20px;}
.tag-green .tag-name{display: block;width: auto;background-image: url("/images/educoder/tag1.png");background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-green{
position: absolute;
left: 15px;
bottom: 95px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;
line-height: 28px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
/*发送至弹框里的下拉框*/
.downSelectOption{position: relative;height: 35px;}
.downSelectOption .showOption{background-color: #F4F4F4;border: 1px solid #EAEAEA;width: 100%;padding: 5px 40px 5px 5px;outline: none;height: 100%;box-sizing: border-box;}

@ -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