Merge remote-tracking branch 'origin/master'

# Conflicts:
#	public/react/src/modules/courses/coursesDetail/CoursesBanner.js
#	public/react/src/modules/user/LoginRegisterComponent.js
dev_forum
杨树明 6 years ago
commit a3466058c7

@ -3,6 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@novnc/novnc": "^1.1.0",
"@flatten/array": "^1.1.7",
"@icedesign/base": "^0.2.5",
"antd": "^3.6.5",

@ -417,7 +417,7 @@ pop_box_new(htmlvalue, 480, 182);
*/
let user = resData.user;
user.username = resData.user.name;
// user.user_url = resData.user_url;
user.user_url = `/user/${resData.user.login}`;
// user.image_url = resData.image_url;
user.is_teacher = resData.is_teacher;
resData.user = user;

@ -442,16 +442,21 @@ class CoursesIndex extends Component{
<Switch {...this.props}>
{/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id"
<Route path="/courses/:coursesId/file/:Id" exact
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/files/:main_id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId"
render={
@ -486,9 +491,9 @@ class CoursesIndex extends Component{
></Route>
{/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id"
<Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={
(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}></Route>
@ -554,9 +559,9 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id"
<Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={
(props) => (<GraduationTasks {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
@ -591,16 +596,29 @@ class CoursesIndex extends Component{
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks"
<Route path="/courses/:coursesId/common_homeworks/" strict
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks"
<Route path="/courses/:coursesId/group_homeworks/" strict
render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} />)
}

@ -56,6 +56,14 @@ const ShixunHomework= Loadable({
loading: Loading,
})
const GraduationTopics= Loadable({
loader: () => import('./graduation/topics'),
loading: Loading,
})
const GraduationTasks= Loadable({
loader: () => import('./graduation/tasks'),
loading: Loading,
})
class ListPageIndex extends Component{
constructor(props) {
super(props)
@ -169,12 +177,34 @@ class ListPageIndex extends Component{
}
></Route>
<Route path="/courses/:coursesId/files/:main_id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/file/:Id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/graduation_topics/:Id"
render={
(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)
}></Route>
<Route path="/courses/:coursesId/graduation_tasks/:Id"
render={
(props) => (<GraduationTasks {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 默认 */}
<Route path="/courses/:coursesId"
render={
(props) => (<StudentsList {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
</div>
</div>

@ -573,7 +573,7 @@ class Fileslists extends Component{
return(
<div>
<React.Fragment >
{/*发送*/}
@ -647,7 +647,6 @@ class Fileslists extends Component{
has_course_groups={this.state.has_course_groups}
/>:""}
<CourseLayoutcomponent {...this.props}>
<Titlesearchsection
title={name}
searchValue={ searchValue }
@ -840,8 +839,7 @@ class Fileslists extends Component{
</div>
</CourseLayoutcomponent>
</div>
</React.Fragment>
)
}
}

@ -14,7 +14,7 @@ import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals'
import NoneData from "../coursesPublic/NoneData"
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import { RouteHOC } from './common'
import axios from 'axios';
import _ from 'lodash'
@ -71,6 +71,13 @@ class commonWork extends Component{
sureDelClasses(){
}
componentDidUpdate(prevProps, prevState) {
debugger;
if (prevProps.match.path != this.props.match.path) {
this.componentDidMount()
}
}
componentDidMount(){
this.setState({
@ -429,4 +436,4 @@ class commonWork extends Component{
)
}
}
export default commonWork;
export default RouteHOC() (commonWork);

@ -9,7 +9,7 @@ import '../css/Courses.css';
import Modals from "../../modals/Modals";
import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal'
import Trialapplication from "../../login/Trialapplication";
// 点击按钮复制功能
// function jsCopy(){
@ -43,34 +43,46 @@ class CoursesBanner extends Component {
metype: 0,
modalsBottomval: "",
antIcon:false,
coursedata:undefined
coursedata:undefined,
user_phone_binded:false,
isRenders:false,
showTrial:false,
}
}
componentDidMount() {
this.onloadupdatabanner()
}
onloadupdatabanner=()=>{
this.updatabanner()
}
updatabanner=()=>{
let courseId = this.props.match.params.coursesId;
let url = "/courses/" + courseId + "/top_banner.json"
axios.get(url).then((result) => {
if( result!=undefined){
let data = result.data;
this.setState({
coursedata: data
})
}else{
this.onloadupdatabanner()
}
})
}
this.onloadupdatabanner()
this.setState({
user_phone_binded :this.props.user_phone_binded,
})
}
onloadupdatabanner=()=>{
this.updatabanner()
}
updatabanner=()=>{
let courseId = this.props.match.params.coursesId;
let url = "/courses/" + courseId + "/top_banner.json"
axios.get(url).then((result) => {
if( result!=undefined){
let data = result.data;
if(result.data.status === 407){
this.setState({
isRenders:true,
coursedata: data,
showTrial:false,
})
}else{
this.setState({
coursedata: data,
showTrial:true,
})
}
}else{
this.onloadupdatabanner()
}
})
}
showeditmenu = () => {
this.setState({
show: true,
@ -323,265 +335,271 @@ class CoursesBanner extends Component {
}
render() {
let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon} = this.state;
let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,user_phone_binded} = this.state;
return (
<div>
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} ></Trialapplication>
coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}>
{
coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}>
{Addcoursestypes === true ? <Addcourses
Addcoursestype={Addcoursestypes}
hideAddcoursestype={() => this.tojoinclass(2)}
Addcoursestype={Addcoursestypes}
hideAddcoursestype={() => this.tojoinclass(2)}
/> : ""}
<Modals
modalsType={modalsType}
modalsTopval={modalsTopval}
loadtype={loadtype}
modalsBottomval={modalsBottomval}
modalCancel={this.modalCancel}
modalSave={this.ModalAction}
antIcon={antIcon}
modalsType={modalsType}
modalsTopval={modalsTopval}
loadtype={loadtype}
modalsBottomval={modalsBottomval}
modalCancel={this.modalCancel}
modalSave={this.ModalAction}
antIcon={antIcon}
></Modals>
<AddTeacherModal ref="addTeacherModal"
{...this.props}
isTeacher={this.state.isTeacher}
moduleName={this.state.isTeacher ? "教师" : "助教"}
addTeacherSuccess={this.addTeacherSuccess}
<AddTeacherModal ref="addTeacherModal"
{...this.props}
isTeacher={this.state.isTeacher}
moduleName={this.state.isTeacher ? "教师" : "助教"}
addTeacherSuccess={this.addTeacherSuccess}
></AddTeacherModal>
<AddStudentModal ref="addStudentModal"
{...this.props}
moduleName="学生"
addStudentSuccess={this.addStudentSuccess}
<AddStudentModal ref="addStudentModal"
{...this.props}
moduleName="学生"
addStudentSuccess={this.addStudentSuccess}
></AddStudentModal>
<div className="educontent clearfix educontentTop">
<div className="color-white clearfix mb10">
<div className="color-white clearfix mb10">
{
coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":
<Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}>
<span className="font-24 fl bannername">{coursedata.name}</span>
</Tooltip>
{
coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":
<Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}>
<span className="font-24 fl bannername">{coursedata.name}</span>
</Tooltip>
}
{/*访
}
{/*访
公开公开课堂非课堂成员可以访问*/}
<span className={"TabsWarp"}>
<span className={"TabsWarp"}>
<CoursesListType
typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]}
typesylename={"mt10"} tipval={coursedata.is_public === true?"":"私有课堂,非课堂成员不能访问"}/>
typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]}
typesylename={"mt10"} tipval={coursedata.is_public === true?"":"私有课堂,非课堂成员不能访问"}/>
</span>
</div>
<div className="clearfix ">
<div className="fl fl mr40 mb20">
<a href={"/users/" + coursedata.teacher_login} className="fl">
<img alt="头像" className="radius fl mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)}/>
</a>
<div className="fl mt13">
<p className="color-white">
<a href={"/users/" + coursedata.teacher_login}
className="color-white bannnerusername">{coursedata.teacher_name}</a>
</p>
</div>
<div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div>
</div>
<div className="clearfix ">
<div className="fl fl mr40 mb20">
<a href={"/users/" + coursedata.teacher_login} className="fl">
<img alt="头像" className="radius fl mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)}/>
</a>
<div className="fl mt13">
<p className="color-white">
<a href={"/users/" + coursedata.teacher_login}
className="color-white bannnerusername">{coursedata.teacher_name}</a>
</p>
</div>
<div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div>
</div>
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
</Tooltip>
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
</Tooltip>:""}
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
</Tooltip>:""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}
</div>
<div className="clearfix clearfixborder">
<ul className="fl color-grey-eb pathInfo pathInfobox mt10">
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c fl font-16">教师</span>
<span
className="color-white fl font-16 bannerurli">{coursedata.teacher_count}</span>
</Link>
</li>
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</span>
<span
className={coursedata.credit===null?"color-white fl font-16":"color-white fl font-16 bannerurli"}>{coursedata.student_count}</span>
</Link>
</li>
{/*<li className={"mt7"}>*/}
{/*<a>*/}
{/*<span className="color-grey-c fl font-16">分班</span>*/}
{/*<span className="color-white fl font-16 bannerurli">{coursedata.course_group_count}</span>*/}
{/*</a>*/}
{/*</li>*/}
{coursedata.credit===null?"":<li className={"mt7"}>
<a>
<span className="color-grey-c fl font-16 mr10">学分</span>
<span className="color-white fl font-16 "
>{coursedata.credit}</span>
</a>
</li>}
{/*{coursedata.course_end===true? <li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16">已结束</span>*/}
{/*</li>:<li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16"> 结束</span>*/}
{/*<span className="color-white fl font-16"*/}
{/*style={{*/}
{/*marginLeft:coursedata.deadline===null?"":'8px'*/}
{/*}}*/}
{/*>{coursedata.deadline===null?"--":coursedata.deadline}</span>*/}
{/*</li>}*/}
</ul>
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
</Tooltip>
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
</Tooltip>:""}
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{
position: "relative"
}}
>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(true)}>
<span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}>
<span className="color-white fl font-16 bannerurli width100f">添加学生</span>
</a>
</li>
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a>
<span className="color-grey-c fl font-16">邀请码</span>
<span
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}>
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
</Tooltip>:""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}
</div>
<div className="clearfix clearfixborder">
<ul className="fl color-grey-eb pathInfo pathInfobox mt10">
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c fl font-16">教师</span>
<span
className="color-white fl font-16 bannerurli">{coursedata.teacher_count}</span>
</Link>
</li>
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</span>
<span
className={coursedata.credit===null?"color-white fl font-16":"color-white fl font-16 bannerurli"}>{coursedata.student_count}</span>
</Link>
</li>
{/*<li className={"mt7"}>*/}
{/*<a>*/}
{/*<span className="color-grey-c fl font-16">分班</span>*/}
{/*<span className="color-white fl font-16 bannerurli">{coursedata.course_group_count}</span>*/}
{/*</a>*/}
{/*</li>*/}
{coursedata.credit===null?"":<li className={"mt7"}>
<a>
<span className="color-grey-c fl font-16 mr10">学分</span>
<span className="color-white fl font-16 "
>{coursedata.credit}</span>
</a>
</li>}
{/*{coursedata.course_end===true? <li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16">已结束</span>*/}
{/*</li>:<li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16"> 结束</span>*/}
{/*<span className="color-white fl font-16"*/}
{/*style={{*/}
{/*marginLeft:coursedata.deadline===null?"":'8px'*/}
{/*}}*/}
{/*>{coursedata.deadline===null?"--":coursedata.deadline}</span>*/}
{/*</li>}*/}
</ul>
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{
position: "relative"
}}
>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(true)}>
<span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}>
<span className="color-white fl font-16 bannerurli width100f">添加学生</span>
</a>
</li>
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a>
<span className="color-grey-c fl font-16">邀请码</span>
<span
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}>
{coursedata.code_halt === true? "已停用" : coursedata.invite_code}
{coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={
<pre>
{coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={
<pre>
成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码
</pre>
}>
<i className="iconfont icon-fuzhi color-white font-14 ml10"
onClick={() => {
jsCopy()
}}></i>
</Tooltip>
}
<input id="copy_invite_code" value={coursedata.invite_code}/>
}>
<i className="iconfont icon-fuzhi color-white font-14 ml10"
onClick={() => {
jsCopy()
}}></i>
</Tooltip>
}
<input id="copy_invite_code" value={coursedata.invite_code}/>
</span>
</a>
</li>
</a>
</li>
<li className={"mt7 ml10 mr0 "}>
<style>
{
`
<li className={"mt7 ml10 mr0 "}>
<style>
{
`
.defaults{cursor:default}
`
}
</style>
<Popover placement="bottom" content={
<ul className="sandianbox" style={{
display: 'block',
right: "-113px",
top: "20px"
}}>
{coursedata.is_public === true?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(2)}>设为私有</div>: "" : ""}
{coursedata.is_public === false?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(3)}>设为公开</div> : "": ""}
{coursedata.course_identity <3? <div className={"defaults"} onClick={() => this.ActionPoll(4)}>
{coursedata.code_halt === true ?"启用邀请码":"停用邀请码"}
</div>:""}
<div className={"defaults"} onClick={this.postsettings}>设置</div>
<div className={"defaults"} onClick={() => this.ActionPoll(5)}>复制
</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>
}
</style>
<Popover placement="bottom" content={
<ul className="sandianbox" style={{
display: 'block',
right: "-113px",
top: "20px"
}}>
{coursedata.is_public === true?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(2)}>设为私有</div>: "" : ""}
{coursedata.is_public === false?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(3)}>设为公开</div> : "": ""}
{coursedata.course_identity <3? <div className={"defaults"} onClick={() => this.ActionPoll(4)}>
{coursedata.code_halt === true ?"启用邀请码":"停用邀请码"}
</div>:""}
<div className={"defaults"} onClick={this.postsettings}>设置</div>
<div className={"defaults"} onClick={() => this.ActionPoll(5)}>复制
</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>
</li>
</li>
</ul>:""}
</ul>:""}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
)
}
}

@ -240,11 +240,15 @@ class ExerciseReviewAndAnswer extends Component{
)
}
// 调分
showSetScore=(key,flag)=>{
showSetScore=(key,flag,setId)=>{
this.setState(
(prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}})
})
}),()=>{
if (setId && (flag == undefined || flag==false)) {
$("html").animate({ scrollTop: $("#Anchor_"+setId).offset().top - 150 })
}
}
)
this.setState({
score:undefined
@ -502,6 +506,18 @@ class ExerciseReviewAndAnswer extends Component{
console.log(data&&data.exercise.user_name)
return(
<div className="newMain" style={{paddingTop:"0px"}}>
<style>{`
.inputNumber30{
height:30px;
width:115px;
}
.inputNumber30 .ant-input-number-input-wrap{
line-height: 28px;
}
.inputNumber30 .ant-input-number-input-wrap .ant-input-number-input{
height: 28px;
}
`}</style>
<p style={{height:"60px"}}></p>
<Modals
modalsType={Modalstype}
@ -665,7 +681,7 @@ class ExerciseReviewAndAnswer extends Component{
{
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
isAdmin && ((parseInt(item.answer_status) == 1 && item.question_type == 4) || item.question_type == 3) ?
<WordsBtn style="blue" className="mr20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore)}>调分</WordsBtn>:""
<WordsBtn style="blue" className="mr20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position+"_"+item.question_type)}>调分</WordsBtn>:""
}
{
// 简答题,未评分的显示未批
@ -767,11 +783,10 @@ class ExerciseReviewAndAnswer extends Component{
</div>
</div>
}
{
// 调分输入部分
isAdmin && ((item.setScore && item.question_type == 3) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4))?
<div className="ml30 mr30 bor-top-greyE pt20 mt20">
<div className="ml30 mr30 bor-top-greyE pt20 mt20" id={`${"Anchor_"+item.q_position+"_"+item.question_type}`}>
<div className="edu-txt-right">
<span><span className="color-red">*</span></span>
<li className="fr">
@ -783,8 +798,7 @@ class ExerciseReviewAndAnswer extends Component{
value={score}
step={0.1}
precision={1}
className={ setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip" : "edu-txt-center winput-115-40 fl mt3"}
style={{height:"30px",width:"115px"}}
className={ setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
onChange={this.inputScore}
></InputNumber>
<span className="ml5"></span>

@ -2030,7 +2030,7 @@ class Studentshavecompletedthelist extends Component {
//===0 不包括主观题
if (indexi === exercise_users.length) {
//都没评论 不显示评论
if (response.data.course_groups.length > 0) {
if (response.data.poll_types.groups_count > 0) {
// console.log("77771111111");
//分班大于0显示分班
//7ge
@ -2272,7 +2272,8 @@ class Studentshavecompletedthelist extends Component {
} else {
//已经评论
if (response.data.course_groups.length > 0) {
// response.data.course_groups.length
if (response.data.poll_types.groups_count > 0) {
//显示分班
//8ge
this.setState({
@ -2545,7 +2546,7 @@ class Studentshavecompletedthelist extends Component {
//包括主观题
if (indexi === exercise_users.length) {
console.log("2548包含主观题不包含分班");
if (response.data.course_groups.length > 0){
if (response.data.poll_types.groups_count> 0){
this.setState({
data: datalist,
teacherlist: teacherlist,
@ -2836,7 +2837,7 @@ class Studentshavecompletedthelist extends Component {
}
} else {
console.log("2699包含主观题包含分班");
if (response.data.course_groups.length > 0) {
if (response.data.poll_types.groups_count> 0) {
this.setState({
data: datalist,
teacherlist: teacherlist,

@ -86,6 +86,19 @@ class GraduationTasksSubmitnew extends Component{
let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){
this.setState({
Modalstype:true,
Modalstopval:'请上传附件!',
Loadtype:true,
ModalCancel:this.cancelAttachment
})
return
}
let userids=[];
for(var list of selectmemberslist){
@ -433,6 +446,8 @@ render(){
let graduation_id=workslist===undefined?"":workslist.graduation_id;
let task_id=workslist===undefined?"":workslist.task_id;
return(
<React.Fragment>
@ -637,7 +652,7 @@ render(){
<Form.Item>
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button>
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>

@ -163,8 +163,8 @@ class GraduationTasksappraise extends Component{
<div className={"educontent mb20"}>
<p className="clearfix mt10">
{/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">{datalist&&datalist.course_name}</Link></WordsBtn>*/}
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId} className="color-grey-6">{datalist&&datalist.course_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">{datalist&&datalist.graduation_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
@ -182,23 +182,22 @@ class GraduationTasksappraise extends Component{
`
}
</style>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>
<div className="mt20 mb20 clearfix lineh-25">
<p className="fl color-black summaryname lineh-25">{datalist&&datalist.task_name}</p>
<CoursesListType
typelist={datalist&&datalist.status}
typesylename={"mt23"}
/>
<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-6 fr font-16 mr20" onClick={this.goback}>返回</a>
{this.props.isStudent()?
datalist&&datalist.task_status===2?
<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""
<a className={"fr color-blue font-16 mr20"} onClick={this.addAccessory}>补交附件</a>:""
:""}
</div>
<div className=" edu-back-white " style={{"padding": "20px 15px 20px 15px","box-sizing": "border-box"}}>
<div className={"stud-class-set bor-bottom-greyE edu-back-white"} style={{ padding: '0px 10px 20px 10px'}}>
<div className={"stud-class-set edu-back-white"} style={{ padding: '0px 10px 20px 10px'}}>
<div className={"color-grey-6 h20 mb20"}>
内容
@ -251,7 +250,7 @@ class GraduationTasksappraise extends Component{
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.length===0?"":<div className={"stud-class-set bor-bottom-greyE pd20 edu-back-white"}>
<div className={"color-grey-6 mb10"}>
<div className={"color-grey-6 mb10 bor-top-greyE"}>
补交附件
</div>

@ -619,17 +619,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号',
dataIndex: 'number',
key: 'number',
className:'edu-txt-center'
}, {
title: '姓名',
dataIndex: 'name',
key: 'name',
className:'edu-txt-center'
}, {
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -639,7 +639,7 @@ class GraduationTaskssettinglist extends Component{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#9A9A9A'}}>{record.classroom==="未分班"?"--":record.classroom}</a>
@ -648,7 +648,8 @@ class GraduationTaskssettinglist extends Component{
}, {
title: '分组',
key: 'grouping',
dataIndex: 'grouping',
dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#676767'}}>{record.grouping}</a>
@ -657,7 +658,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目',
dataIndex: 'associationitems',
key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => (
<div>
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -669,7 +670,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -679,7 +680,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间',
dataIndex: 'turnovertime',
key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#989898'}}>
@ -691,11 +692,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分',
key: 'teacherrating',
dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip>
</span>
),
@ -703,11 +704,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分',
key: 'crossrating',
dataIndex: 'crossrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip>
</span>
),
@ -715,18 +716,19 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩',
key: 'finalscore',
dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip>
</span>
),
}, {
title: '操作',
key: 'operation',
dataIndex: 'operation',
dataIndex: 'operation',
className:'edu-txt-center',
render: operation => (
<div>
{this.props.isAdmin()?operation.map((tag,key) => {
@ -770,17 +772,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号',
dataIndex: 'number',
key: 'number',
className:'edu-txt-center',
}, {
title: '姓名',
dataIndex: 'name',
key: 'name',
className:'edu-txt-center',
}, {
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -789,7 +791,8 @@ class GraduationTaskssettinglist extends Component{
},{
title: '分组',
key: 'grouping',
dataIndex: 'grouping',
dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#676767'}}>{record.grouping}</a>
@ -798,7 +801,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目',
dataIndex: 'associationitems',
key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => (
<div>
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -810,7 +813,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -820,7 +823,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间',
dataIndex: 'turnovertime',
key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#989898'}}>
@ -832,11 +835,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分',
key: 'teacherrating',
dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip>
</span>
),
@ -844,11 +847,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分',
key: 'crossrating',
dataIndex: 'crossrating',
className:'none',
className:'none edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip>
</span>
),
@ -856,11 +859,11 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩',
key: 'finalscore',
dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip>
</span>
),
@ -868,6 +871,7 @@ class GraduationTaskssettinglist extends Component{
title: '操作',
key: 'operation',
dataIndex: 'operation',
className:'edu-txt-center',
render: operation => (
<div>
{this.props.isAdmin()?operation.map((tag,key) => {
@ -916,17 +920,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号',
dataIndex: 'number',
key: 'number',
className:'edu-txt-center',
}, {
title: '姓名',
dataIndex: 'name',
key: 'name',
className:'edu-txt-center',
}, {
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -936,7 +940,7 @@ class GraduationTaskssettinglist extends Component{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.classroom==="未分班"?"--":record.classroom}</a>
@ -946,6 +950,7 @@ class GraduationTaskssettinglist extends Component{
title: '分组',
key: 'grouping',
dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#676767'}}>{record.grouping}</a>
@ -954,7 +959,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目',
dataIndex: 'associationitems',
key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => (
<div>
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -967,7 +972,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -977,7 +982,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间',
dataIndex: 'turnovertime',
key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#989898'}}>
@ -989,11 +994,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分',
key: 'teacherrating',
dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip>
</span>
),
@ -1001,11 +1006,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分',
key: 'crossrating',
dataIndex: 'crossrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip>
</span>
),
@ -1013,11 +1018,11 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩',
key: 'finalscore',
dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip>
</span>
),
@ -1025,6 +1030,7 @@ class GraduationTaskssettinglist extends Component{
title: '操作',
key: 'operation',
dataIndex: 'operation',
className:'edu-txt-center',
render: operation => (
<div>
{this.props.isAdmin()?operation.map((tag,key) => {
@ -1068,17 +1074,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号',
dataIndex: 'number',
key: 'number',
className:'edu-txt-center',
}, {
title: '姓名',
dataIndex: 'name',
key: 'name',
className:'edu-txt-center',
}, {
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -1088,6 +1094,7 @@ class GraduationTaskssettinglist extends Component{
title: '分组',
key: 'grouping',
dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:'#676767'}}>{record.grouping}</a>
@ -1096,7 +1103,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目',
dataIndex: 'associationitems',
key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => (
<div className={"projectsdiv"} >
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -1110,7 +1117,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -1120,7 +1127,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间',
dataIndex: 'turnovertime',
key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#989898'}}>
@ -1132,11 +1139,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分',
key: 'teacherrating',
dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip>
</span>
),
@ -1144,11 +1151,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分',
key: 'crossrating',
dataIndex: 'crossrating',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip>
</span>
),
@ -1156,11 +1163,11 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩',
key: 'finalscore',
dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => (
<span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip>
</span>
),
@ -1168,6 +1175,7 @@ class GraduationTaskssettinglist extends Component{
title: '操作',
key: 'operation',
dataIndex: 'operation',
className:'edu-txt-center',
render: operation => (
<div>
{this.props.isAdmin()?operation.map((tag,key) => {
@ -1357,13 +1365,12 @@ class GraduationTaskssettinglist extends Component{
<span>任务详情</span>
</p>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{taskslistdata.task_name}</Link></p>
<div className="clearfix lineh-25 mt20 mb20">
<p className=" fl color-black summaryname lineh-25"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{taskslistdata.task_name}</Link></p>
<CoursesListType
typelist={taskslistdata.task_status}
typesylename={"mt22"}
/>
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
@ -1446,7 +1453,7 @@ class GraduationTaskssettinglist extends Component{
{taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
return(
<span key={key}>
<Checkbox value={item.id} onClick={this.funteachercomment} className="fl ">{item.name}
<Checkbox value={item.id} key={item.id} onClick={this.funteachercomment} className="fl ">{item.name}
<span>({item.count})</span>
</Checkbox>
</span>

@ -591,7 +591,7 @@ class GraduationTasks extends Component{
// console.log(this.props.isCourseidentity()===isNotMember)
// console.log(category_id)
return(
<CourseLayoutcomponent {...this.props}>
<React.Fragment>
{/*提示*/}
<Modals
modalsType={Modalstype}
@ -775,7 +775,7 @@ class GraduationTasks extends Component{
</div>
</CourseLayoutcomponent>
</React.Fragment>
)
}
}

@ -341,7 +341,7 @@ onBoardsNew=()=>{
// let {course_identity}=this.props.coursedata
const isAdmin =this.props.isAdmin();
return(
<CourseLayoutcomponent {...this.props}>
<React.Fragment >
<ChooseGraduateTopicModal ref="chooseGraduateTopicModal"></ChooseGraduateTopicModal>
<Titlesearchsection
title="毕设选题"
@ -446,7 +446,7 @@ onBoardsNew=()=>{
<div>
</div>
</CourseLayoutcomponent>
</React.Fragment>
)
}
}

@ -5,6 +5,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText'
import update from 'immutability-helper'
import { WordsBtn, ConditionToolTip, on, off } from 'educoder'
import axios from 'axios'
@ -28,6 +29,7 @@ const pageSize = 20;
function buildColumns(that) {
const isAdmin = that.props.isAdmin()
const isAdminOrCreator = that.props.isAdminOrCreator();
const isAdminOrTeacher = that.props.isAdminOrTeacher()
const { course_groups } = that.state
const columns = [{
title: '',
@ -55,7 +57,8 @@ function buildColumns(that) {
title: '角色',
dataIndex: 'role',
key: 'role',
}, {
}]
that.course_groups && that.course_groups.length && columns.push({
title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>,
width: 230,
key: 'course_groups',
@ -70,7 +73,7 @@ function buildColumns(that) {
const noGroups = (!course_groups || course_groups.length == 0);
return (
<ConditionToolTip title={`暂未有分班信息,不能操作`} condition={noGroups}>
<span className="drop_down" style={{color: '#29BD8B'}}>
<span className="drop_down" style={{color: '#29BD8B', display: 'inline-block'}}>
{ arg_course_groups.length == 0 ? '不限' : arg_course_groups.map(item => item.name).join(', ') }
{ isAdmin &&
<React.Fragment>
@ -83,7 +86,7 @@ function buildColumns(that) {
</p>):
''
}
<Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item)}
<Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item, index)}
value={arg_course_groups.map(item => item.id)}
disabled={!isAdminOrCreator}
>
@ -108,7 +111,7 @@ function buildColumns(that) {
</ConditionToolTip>)
}
,
}];
});
if (that.hasGraduationModule()) {
columns.push({
title: '答辩组',
@ -121,7 +124,7 @@ function buildColumns(that) {
),
})
}
if (isAdminOrCreator) {
if (isAdminOrTeacher) {
columns.push({
title: '操作',
key: 'action',
@ -136,11 +139,12 @@ function buildColumns(that) {
} else {
return (
<span>
<WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除</WordsBtn>
<Divider type="vertical" />
{record.role != ROLE_ADMIN && <WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除</WordsBtn>}
{(record.role == ROLE_TEACHER || record.role == ROLE_TEACHER_ASSISTANT || isAdminOrCreator) && record.role != ROLE_ADMIN
&& <Divider type="vertical" />}
{ record.role == ROLE_TEACHER ? <a style={{color: '#4CACFF'}} onClick={() => that.changeToAssistant(record)}>变更为助教</a> : '' }
{ record.role == ROLE_TEACHER_ASSISTANT ? <a style={{color: '#4CACFF'}} onClick={() => that.changeToTeacher(record)}>变更为教师</a> : '' }
{ record.role == ROLE_ADMIN ? <a style={{color: '#4CACFF'}} onClick={() => that.showChangeAdminModal(record)}>更换管理员</a> : '' }
{ record.role == ROLE_ADMIN && isAdminOrCreator ? <a style={{color: '#4CACFF', marginLeft: '44px'}} onClick={() => that.showChangeAdminModal(record)}>更换管理员</a> : '' }
</span> )
}
@ -237,8 +241,13 @@ class studentsList extends Component{
})
.then((response) => {
if (response.data.course_groups && response.data.course_groups.length) {
let course_groups_map = {}
response.data.course_groups.forEach(item => {
course_groups_map[item.id] = item.name
})
this.setState({
course_groups: response.data.course_groups,
course_groups_map
})
} else {
}
@ -247,7 +256,7 @@ class studentsList extends Component{
console.log(error);
});
}
joinCourseGroup = (ids, item) => {
joinCourseGroup = (ids, item, index) => {
console.log('join ', ids, item)
const courseId = this.props.match.params.coursesId
@ -262,7 +271,12 @@ class studentsList extends Component{
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('修改成功')
this.fetchAll()
const newArray = ids.map((item) => {return {id: item, name: this.state.course_groups_map[item]}});
this.setState(
(prevState) => ({
teachers : update(prevState.teachers, {[ this.state.page == 1 ? index - this.state.application_list.length : index]: { course_groups: {$set: newArray }}})
}))
// this.fetchAll()
} else {
}
})
@ -560,7 +574,7 @@ class studentsList extends Component{
<ul className="drop_down_normal">
<li onClick={() => this.onSortTypeChange(ORDER_BY_NAME)} >姓名排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_DATE)} style={{width: '125px'}}>加入时间排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li>
{this.hasGraduationModule() && <li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li>}
</ul>
</li>
</div> }

@ -13,6 +13,7 @@ import '../css/members.css';
import '../css/busyWork.css';
import Modals from '../../modals/Modals';
import axios from 'axios';
import moment from 'moment';
const Search = Input.Search;

@ -181,7 +181,12 @@ class PollDetailTabFirst extends Component{
title: '学号',
dataIndex: 'StudentNo',
key: 'StudentNo',
className:"edu-txt-center"
className:"edu-txt-center",
render:(StudentNo,item,index)=>{
return(
item.StudentNo ? <span>{item.StudentNo}</span> : "--"
)
}
}, {
title: '分班',
key: 'classes',

@ -60,21 +60,27 @@ class EducoderLogin extends Component {
if( props.match.url === "/changepassword" ){
this.state = {
showbool: false,
logini:3,
}
}else {
if(props.match.url === "/login"){
this.state = {
showbool: true,
loginstatus:true
loginstatus:true,
logini:1,
}
}else if(props.match.url === "/register"){
this.state = {
showbool: true,
loginstatus:false,
logini:2,
}
}else{
this.state = {
showbool: true,
logini:1,
}
}
@ -86,6 +92,14 @@ class EducoderLogin extends Component {
}
Setlogins=(i)=>{
console.log("96ye");
console.log(i)
this.setState({
logini:i
})
}
Setshowbool = () => {
if (this.state.showbool === true) {
@ -102,7 +116,7 @@ class EducoderLogin extends Component {
render() {
let {showbool} = this.state;
let {showbool,loginstatus,logini} = this.state;
return (
<div style={newContainer} >
<style>
@ -135,14 +149,12 @@ class EducoderLogin extends Component {
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px"}}>
<div style={{"margin-top": "40px","height":"500px"}}>
<LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></LoginRegisterComponent>
<div style={{"width":"100%","height":"350px"}}>
Setshowbool={this.Setshowbool} ></LoginRegisterComponent>
</div>
</div>
</div>
:
<div style={{
@ -151,17 +163,23 @@ class EducoderLogin extends Component {
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px"}}>
<div style={{"margin-top": "40px","height":"500px"}}>
<FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent>
<div style={{"width":"100%","height":"250px"}}>
</div>
</div>
</div>
}
<div style={{"height":"250px",
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"15px"}}>© 2019 EduCoder湘ICP备17009477号Trustie & IntelliDE inside.</div>
</div>
</div>
</div>
)

@ -77,7 +77,9 @@ class Trialapplication extends Component {
//TODO 这里如果样式变了会出现css不加载的情况
});
console.log(this.props.isRenders);
console.log("89");
console.log(this.state.props.user_phone_binded );
try {
if (this.state.props.user_phone_binded !== undefined) {
console.log(this.state.props.user_phone_binded);

@ -223,6 +223,10 @@ class Index extends Component {
challenge={context.challenge}
myshixun={context.myshixun}
shixun={context.shixun}
vnc_url={context.vnc_url}
zip_path={context.zip_path}
loading={context.loading}
discusses_count={context.discusses_count}
hide_code={context.hide_code}

@ -13,6 +13,7 @@ import ChooseEvaluateView from './main/ChooseEvaluateView'
import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button';
import VNCDisplay from './VNCDisplay'
import './tpiPage.css';
import './tpiPageForMobile.css';
@ -32,7 +33,7 @@ class MainContent extends Component {
}
render() {
const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout,
onTestSetHeaderClick, loading, codeLoading } = this.props
onTestSetHeaderClick, loading, codeLoading, shixun} = this.props
// if (output_sets && output_sets.test_sets) {
// const test_sets_array = JSON.parse("[" + output_sets.test_sets + "]");
@ -47,6 +48,9 @@ class MainContent extends Component {
}
const newProps = Object.assign({}, this.props);
delete newProps.testSetsExpandedArray
const showIframeContent = shixun && shixun.vnc == true
return (
<div className="page--body -margin-t-64 -flex tpi_content">
<style>{`
@ -57,7 +61,7 @@ class MainContent extends Component {
`}</style>
<div className="-layout -stretch -fit labelN" id="game_show_content">
<div className="split-panel--first -layout -vertical -flex -relative -flex-basic40"
id="game_left_contents" style={{ width: '28%'}}>
id="game_left_contents" style={{ width: '40%'}}>
{/* style={{width: '694px'}} */}
{/* 左侧任务说明等功能的区域 */}
@ -82,6 +86,10 @@ class MainContent extends Component {
<div className="fl pr tip-right-con" id="update_game_tip"></div>
</div>*/}
{/* { showIframeContent && vnc_url ? <VNCDisplay
vnc_url={vnc_url}
></VNCDisplay> */}
<div className="-layout-v -flex">
<div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation">

@ -237,6 +237,10 @@ class MainContentContainer extends Component {
// arg_path 点击文件目录树时传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry) {
const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) {
// vnc模式下不需要加载代码
return true;
}
if (
// true ||
hide_code) { // 隐藏code的实训

@ -0,0 +1,154 @@
// import React, { Component } from 'react';
// import RFB from '@novnc/novnc/lib/rfb.js';
// const $ = window.$;
// // const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
// class VNCDisplay extends Component {
// componentDidMount() {
// console.log(RFB)
// let rfb;
// let desktopName;
// // When this function is called we have
// // successfully connected to a server
// function connectedToServer(e) {
// status("Connected to " + desktopName);
// }
// // This function is called when we are disconnected
// function disconnectedFromServer(e) {
// if (e.detail.clean) {
// status("Disconnected");
// } else {
// status("Something went wrong, connection is closed");
// }
// }
// // When this function is called, the server requires
// // credentials to authenticate
// function credentialsAreRequired(e) {
// const password = prompt("Password Required:");
// rfb.sendCredentials({ password: password });
// }
// // When this function is called we have received
// // a desktop name from the server
// function updateDesktopName(e) {
// desktopName = e.detail.name;
// }
// // Since most operating systems will catch Ctrl+Alt+Del
// // before they get a chance to be intercepted by the browser,
// // we provide a way to emulate this key sequence.
// function sendCtrlAltDel() {
// rfb.sendCtrlAltDel();
// return false;
// }
// // Show a status text in the top bar
// function status(text) {
// document.getElementById('status').textContent = text;
// }
// // This function extracts the value of one variable from the
// // query string. If the variable isn't defined in the URL
// // it returns the default value instead.
// function readQueryVariable(name, defaultValue) {
// // A URL with a query parameter can look like this:
// // https://www.example.com?myqueryparam=myvalue
// //
// // Note that we use location.href instead of location.search
// // because Firefox < 53 has a bug w.r.t location.search
// const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
// match = document.location.href.match(re);
// if (typeof defaultValue === 'undefined') { defaultValue = null; }
// if (match) {
// // We have to decode the URL since want the cleartext value
// return decodeURIComponent(match[1]);
// }
// return defaultValue;
// }
// document.getElementById('sendCtrlAltDelButton')
// .onclick = sendCtrlAltDel;
// // Read parameters specified in the URL query string
// // By default, use the host and port of server that served this file
// // const host = readQueryVariable('host', window.location.hostname);
// // let port = readQueryVariable('port', window.location.port);
// // const password = readQueryVariable('password', '');
// const { vnc_url } = this.props;
// // http://117.50.12.63:43149/vnc_lite.html?password=headless
// let _ar1 = vnc_url.split('/');
// let ipAndPort = _ar1[2].split(':')
// let passwordAr = _ar1[3].split('password=')
// const host = ipAndPort[0]
// let port = ipAndPort[1]
// const password = passwordAr[1].split('&')[0]
// const path = readQueryVariable('path', 'websockify');
// // | | | | | |
// // | | | Connect | | |
// // v v v v v v
// status("Connecting");
// // Build the websocket URL used to connect
// let url;
// if (vnc_url.indexOf("https:") != -1) {
// url = 'wss';
// } else {
// url = 'ws';
// }
// url += '://' + host;
// if(port) {
// url += ':' + port;
// }
// url += '/' + path;
// // Creating a new RFB object will start a new connection
// rfb = new RFB(document.getElementById('screen'), url,
// { credentials: { password: password } });
// // Add listeners to important events from the RFB module
// rfb.addEventListener("connect", connectedToServer);
// rfb.addEventListener("disconnect", disconnectedFromServer);
// rfb.addEventListener("credentialsrequired", credentialsAreRequired);
// rfb.addEventListener("desktopname", updateDesktopName);
// // Set parameters that can be changed on an active connection
// rfb.viewOnly = readQueryVariable('view_only', false);
// rfb.scaleViewport = readQueryVariable('scale', false);
// }
// render() {
// const { challenge, vnc_url } = this.props
// return (
// <div className="">
// <style>{`
// #top_bar {
// background-color: #6e84a3;
// color: white;
// font: bold 12px Helvetica;
// padding: 6px 5px 4px 5px;
// border-bottom: 1px outset;
// }
// #status {
// text-align: center;
// }
// #sendCtrlAltDelButton {
// position: fixed;
// top: 0px;
// right: 0px;
// border: 1px outset;
// padding: 5px 5px 4px 5px;
// cursor: pointer;
// }
// #screen {
// flex: 1; /* fill remaining space */
// overflow: hidden;
// }
// `}</style>
// <div id="top_bar">
// <div id="status">Loading</div>
// <div id="sendCtrlAltDelButton">Send CtrlAltDel</div>
// </div>
// <div id="screen"></div>
// </div>
// );
// }
// }
// export default VNCDisplay;

@ -330,14 +330,15 @@ class NewHeader extends Component {
})
}
educoderlogin=()=>{
//出账号
//退出账号
var url = `/accounts/logout.json`;
axios.get((url)).then((result) => {
if(result!==undefined){
this.setState({
isRender:true
})
// this.setState({
// isRender:true
// })
window.location.href = "/";
}
}).catch((error) => {
console.log(error);

@ -213,6 +213,13 @@ export function TPMIndexHOC(WrappedComponent) {
return this.state.coursedata&&this.state.coursedata.course_identity === 6
}
// setTrialapplication = ()=>{
// this.setState({
// isRenders:true
// })
//
// }
/**
课堂权限相关方法暂时写这里了 ----------------------------------------END
@ -281,13 +288,13 @@ export function TPMIndexHOC(WrappedComponent) {
}
return (
<div>
{
user_phone_binded === undefined?
""
:
<Trialapplication {...this.state} user_phone_binded={user_phone_binded}></Trialapplication>
{/*{*/}
{/* user_phone_binded === undefined?*/}
{/* ""*/}
{/* :*/}
{/* <Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication>*/}
}
{/*}*/}
<SiderBar
Headertop={Headertop}

@ -1,429 +1,432 @@
import React, {Component} from 'react';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import {getImageUrl, DragValidator} from 'educoder';
import {Tabs, Input, Checkbox, Button, notification} from 'antd';
import axios from 'axios';
import './common.css'
const TabPane = Tabs.TabPane
const loginInputsyl = {
"width": " 100%",
"height": "40px",
}
//父组件 EducoderLogin.js
class LoginRegisterComponent extends Component {
constructor(props) {
super(props)
this.state = {
login: "",
password: "",
passwords: "",
seconds: 60,
codes: "",
getverificationcodes: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
s: 'text',
classpass: "text",
readonlyInput: true,
}
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool();
}
// 点击表单后改变type
changeType = () => {
this.setState({classpass: 'password'});
}
changeTypey = () => {
}
//倒计时
getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
} else {
this.openNotification("请输入正确的手机号或邮箱");
}
return;
}
if (this.state.getverificationcodes === true) {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
} else {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
}
}
//短信验证
SMSverification = () => {
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
login: this.state.login,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
}).catch((error) => {
console.log(error);
})
}
cancelReadOnly = () => {
this.setState({
readonlyInput: false,
})
}
//找回密码
Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
}
this.openNotification("请输入正确的手机号或邮箱");
return;
}
if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`);
return
} else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.password !== this.state.passwords) {
this.openNotification(`两次密码不相同`);
return
} else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`);
return
}
var url = "/accounts/reset_password.json";
axios.post(url, {
login: this.state.login,
code: this.state.codes,
new_password: this.state.password,
new_password_confirmation: this.state.passwords,
}).then((result) => {
// console.log(result);
//登录成功会生成session
this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login"
}).catch((error) => {
})
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
loginInputonChange = (e) => {
// console.log(e.target.value);
this.setState({
login: e.target.value,
})
}
loginInputonChanges = (e) => {
// console.log(e.target.value);
this.setState({
password: e.target.value,
})
}
loginInputonChangess = (e) => {
// console.log(e.target.value);
this.setState({
passwords: e.target.value,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
})
}
inputOnBlur = (e) => {
this.isCorrectname(e.target.value);
// this.Emailphonenumberverification(e.target.value, id);
}
isCorrectname = (value) => {
console.log(value.length);
if (value.length === 0) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
if (!regemail.test(value)) {
if ((value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(value)
return
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
}
//邮箱手机号验证
Emailphonenumberverification = (value) => {
var url = `/accounts/valid_email_and_phone.json`;
axios.get((url), {
params: {
login: value,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
}).catch((error) => {
console.log(error);
// this.setState({
// login:"",
// logins:"",
// })
})
}
render() {
const {
activeKey,
// 登录
autoLogin,
// 注册
readAgreement, dragOk,
login,
password,
passwords,
classpass,
seconds,
getverificationcodes,
Phonenumberisnotco,
readonlyInput,
codes,
} = this.state
// height: 346px;
return (
<div className="login_register_content">
<Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<style>{`
.login_section .section_header {
margin-bottom: 16px;
font-size: 18px;
width: 100%;
text-align: center;
border-bottom: 1px solid rgb(234, 234, 234);
height: 72px;
color: #05101A;
line-height: 73px;
}
`}</style>
<div className="login_section">
<div className="section_header">
找回密码
</div>
<div style={{width: '340px'}}>
<style>
{
`
.ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
`
}
</style>
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px'}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span>
</p>
: <div className="mt10 mb10"></div>
}
<DragValidator
height={38} className="loginInput" successGreenColor="#45E15F"
dragOkCallback={this.dragOkCallback}
></DragValidator>
<Input className="loginInput mb20" type={classpass}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} placeholder="输入8~16位密码区分大小写"></Input>
<Input className="loginInput mb20" type={classpass}
onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords}
placeholder="再次输入新密码"></Input>
<div>
<Input className="fl mr5" type="text" autoComplete="off" style={{
"width": "210px",
"margin-bottom": "16px",
"height": "38px",
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
{
getverificationcodes === undefined ?
<Button className="fl ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "38px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>验证码</Button>
:
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<Button className="login_btn" size={"large"} type="primary"
onClick={this.Retrievepassword}>完成</Button>
</div>
</div>
</div>
);
}
}
export default (LoginRegisterComponent);
import React, {Component} from 'react';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import {getImageUrl, DragValidator} from 'educoder';
import {Tabs, Input, Checkbox, Button, notification} from 'antd';
import axios from 'axios';
import './common.css'
const TabPane = Tabs.TabPane
const loginInputsyl = {
"width": " 100%",
"height": "40px",
}
//父组件 EducoderLogin.js
class LoginRegisterComponent extends Component {
constructor(props) {
super(props)
this.state = {
login: "",
password: "",
passwords: "",
seconds: 60,
codes: "",
getverificationcodes: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
s: 'text',
classpass: "text",
readonlyInput: true,
}
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool();
}
// 点击表单后改变type
changeType = () => {
this.setState({classpass: 'password'});
}
changeTypey = () => {
}
//倒计时
getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.login&&this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
} else {
this.openNotification("请输入正确的手机号或邮箱");
}
return;
}
if (this.state.getverificationcodes === true) {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
} else {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
}
}
//短信验证
SMSverification = () => {
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
login: this.state.login,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
}).catch((error) => {
console.log(error);
})
}
cancelReadOnly = () => {
this.setState({
readonlyInput: false,
})
}
//找回密码
Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
}
this.openNotification("请输入正确的手机号或邮箱");
return;
}
if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`);
return
} else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.password !== this.state.passwords) {
this.openNotification(`两次密码不相同`);
return
} else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`);
return
}
var url = "/accounts/reset_password.json";
axios.post(url, {
login: this.state.login,
code: this.state.codes,
new_password: this.state.password,
new_password_confirmation: this.state.passwords,
}).then((result) => {
// console.log(result);
//登录成功会生成session
this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login"
}).catch((error) => {
})
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
loginInputonChange = (e) => {
// console.log(e.target.value);
this.setState({
login: e.target.value,
})
}
loginInputonChanges = (e) => {
// console.log(e.target.value);
this.setState({
password: e.target.value,
})
}
loginInputonChangess = (e) => {
// console.log(e.target.value);
this.setState({
passwords: e.target.value,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
})
}
inputOnBlur = (e) => {
this.isCorrectname(e.target.value);
// this.Emailphonenumberverification(e.target.value, id);
}
isCorrectname = (value) => {
console.log(value.length);
if (value.length === 0) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
if (!regemail.test(value)) {
if ((value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(value)
return
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
}
//邮箱手机号验证
Emailphonenumberverification = (value) => {
var url = `/accounts/valid_email_and_phone.json`;
axios.get((url), {
params: {
login: value,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
// console.log(result);
this.openNotification("验证码已发送,请注意查收!",2);
}).catch((error) => {
console.log(error);
// this.setState({
// login:"",
// logins:"",
// })
})
}
render() {
const {
activeKey,
// 登录
autoLogin,
// 注册
readAgreement, dragOk,
login,
password,
passwords,
classpass,
seconds,
getverificationcodes,
Phonenumberisnotco,
readonlyInput,
codes,
} = this.state
// height: 346px;
return (
<div className="login_register_content" style={{height: "482px"}}>
<Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<style>{`
.login_section .section_header {
margin-bottom: 16px;
font-size: 18px;
width: 100%;
text-align: center;
border-bottom: 1px solid rgb(234, 234, 234);
height: 69px;
color: #05101A;
line-height: 69px;
}
`}</style>
<div className="login_section">
<div className="section_header">
找回密码
</div>
<div style={{width: '340px'}}>
<style>
{
`
.ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
`
}
</style>
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px',height: "38px"}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotco}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<DragValidator
height={38} successGreenColor="#45E15F"
style={{height:"38px",width:"100%"}}
dragOkCallback={this.dragOkCallback}
></DragValidator>
<Input type={classpass}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width:"100%",height:"38px",marginTop:'25px'}} placeholder="输入8~16位密码区分大小写"></Input>
<Input type={classpass}
onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height:"38px",marginTop:'25px',width:"100%"}}
placeholder="再次输入新密码"></Input>
<div className={"mt25"}>
<Input className="fl mr5" type="text" autoComplete="off" style={{
width: "210px",
height: "38px",
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
{
getverificationcodes === undefined ?
<Button className="fl ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "38px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<Button className="login_btn" size={"large"} type="primary"
style={{height:"46px"}}
onClick={this.Retrievepassword}>完成</Button>
</div>
</div>
</div>
);
}
}
export default (LoginRegisterComponent);

@ -10,8 +10,12 @@ import axios from 'axios';
import './common.css'
const { TabPane } = Tabs;
const loginInputsyl = {
"width": " 100%",
"height": "40px",
"width":"434px",
"height": "462px",
"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"border-radius": "6px",
"background": "#fff"
}
//父组件EducoderLogin.js
@ -135,6 +139,7 @@ class LoginRegisterComponent extends Component {
;
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool();
// this.props.Setlogins(3);
this.setState({
login: "",
password: "",
@ -356,11 +361,11 @@ class LoginRegisterComponent extends Component {
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
// console.log(result);
}).catch((error) => {
console.log(error);
// console.log(error);
// this.setState({
// login:"",
// logins:"",
@ -369,7 +374,6 @@ class LoginRegisterComponent extends Component {
}
//短信验证
SMSverification = () => {
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
@ -378,7 +382,8 @@ class LoginRegisterComponent extends Component {
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
// console.log(result);
this.openNotification("验证码已发送,请注意查收!",2);
}).catch((error) => {
@ -407,8 +412,8 @@ class LoginRegisterComponent extends Component {
//倒计时
getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.logins.length === 0) {
if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.logins&&this.state.logins.length === 0) {
this.openNotification("请输入手机号或邮箱",2);
return
}else {
@ -503,6 +508,17 @@ class LoginRegisterComponent extends Component {
this.setState({
tab:e.key
})
console.log(e.key);
if(e.key === 0){
this.setState({
Phonenumberisnotcos:undefined
})
}else{
this.setState({
Phonenumberisnotco:undefined
})
}
// this.props.history.push(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key)
@ -532,7 +548,7 @@ class LoginRegisterComponent extends Component {
// console.log(activeKey);
return (
<div className="login_register_content">
<div className="login_register_content" style={ parseInt(tab[0])==0?{height: "346px"} :{height: "462px"}}>
<div>
@ -576,63 +592,64 @@ class LoginRegisterComponent extends Component {
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange}
name="username"
className="loginInput"
style={{marginTop: '30px'}}></Input>
className="font-14 color-grey-9 loginInput"
onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span>
<span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotco}</span>
</p>
: <div className="mt15 mb15"></div>
: <div style={{height:"25px"}}></div>
}
<Input type="password" name="password" id="password" className="loginInput" value={this.state.password}
<Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInput"
placeholder="密码"></Input>
<div className="left_right mt20">
<div className="left_right mt25 font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a
onClick={this.StudyMakeMoney}
className="mr3 color-grey-9">找回密码</a>
<a onClick={this.StudyMakeMoney}
className="mr3 color-grey-9 mt3 font-12">找回密码</a>
</div>
<Button className="login_btn" type="primary" onClick={() => this.postLogin()}
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postLogin()}
size={"large"}>登录</Button>
</div>
}
{
parseInt(tab[0])==1 &&
<div style={{width: '340px'}}>
<Input className={loginInputsyl+" loginInput"} placeholder="请使用手机号/邮箱账号进行注册"
<Input className="loginInputsyl color-grey-9 loginInput" placeholder="请使用手机号/邮箱账号进行注册"
value={this.state.logins}
type="text" autoComplete="off"
onChange={this.loginInputonChanges}
onBlur={(e) => this.inputOnBlur(e, 2)}
style={{marginTop: '30px'}}></Input>
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{
Phonenumberisnotcos && Phonenumberisnotcos != "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl">{Phonenumberisnotcos}</span>
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotcos}</span>
</p>
: <div className=" mt15 mb15"></div>
: <div style={{height:"25px"}}></div>
}
<DragValidator
height={38} className="loginInput" successGreenColor="#45E15F"
style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback}
></DragValidator>
<div>
<Input className="fl mr5" name="codes" type="text" autoComplete="off" readonly
<div className="mt25">
<Input className="fl mr5 font-14 color-grey-9" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{
"width": "210px",
"margin-bottom": "16px",
"height": "38px",
width:'210px',
height:'38px',
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
@ -640,13 +657,13 @@ class LoginRegisterComponent extends Component {
</Input>
{
getverificationcodes === undefined ?
<Button className="fl ml5 " disabled style={{"width": "120px","text-align":"center", "height": "38px",}}
<Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "38px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>验证码</Button>
<Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}}
<Button className="fl ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
@ -656,8 +673,9 @@ class LoginRegisterComponent extends Component {
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
{/*<Input type="password" name="password" id="password" autoComplete="new-password"*/}
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
<Input className="loginInput" placeholder="输入8~16位密码区分大小写"
<Input className="loginInput font-14 mt25 color-grey-9" placeholder="输入8~16位密码区分大小写"
type={classpass}
autoComplete="new-password"
onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} suffix={
@ -666,9 +684,11 @@ class LoginRegisterComponent extends Component {
}></Input>
<Checkbox onChange={this.onChange}
value={Agreetotheterms}
>我已阅读并同意服务协议条款</Checkbox>
<Button className="login_btn" type="primary" onClick={() => this.postregistered()}
size={"large"}>完成</Button>
><span className="font-14 " style={{
color: '#676767',
}}>我已阅读并同意服务协议条款</span></Checkbox>
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postregistered()}
size={"large"}>注册</Button>
</div>

@ -130,14 +130,15 @@ class Infos extends Component{
let url=`/users/attendance.json`
axios.post(url).then((result)=>{
if(result){
this.setState(
(prevState) => ({
data : update(prevState.data, {attendance_signed: {$set: true} })
})
)
this.setState({
next_gold:result.data.next_gold
})
// this.setState(
// (prevState) => ({
// data : update(prevState.data, {attendance_signed: {$set: true} })
// })
// )
// this.setState({
// next_gold:result.data.next_gold
// })
this.getInfo(this.props.match.params.username);
}
}).catch((error)=>{
console.log(error);
@ -245,6 +246,9 @@ class Infos extends Component{
</div>
<div className="educontent mt10 clearfix edu-txt-center">
<div className="inline">
{
data && is_current == false && data.identity =="学生" ?"" : <span className="mypost fl mr10">{data && data.identity}</span>
}
<span className="mypost fl mr10">{data && data.identity}</span>
<a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
@ -314,7 +318,7 @@ class Infos extends Component{
</div>
<div className="edu-txt-center navInfo">
<div className="inline">
<li className={`${moduleName == 'courses' ? 'active' : '' }`}>
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>课堂</Link>
@ -348,7 +352,7 @@ class Infos extends Component{
{/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/courses"
<Route exact path="/users/:username/courses"
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} />)
}
@ -374,6 +378,11 @@ class Infos extends Component{
(props) => (<InfosProject {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username"
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
</div>

Loading…
Cancel
Save