Merge branches 'dev_aliyun' and 'dev_ysm' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

competitions
杨树明 5 years ago
commit fb634042bf

@ -64,6 +64,18 @@ const EducoderLogin = Loadable({
loader: () => import('./modules/login/EducoderLogin'),
loading: Loading,
})
//微信登录
const Otherlogin=Loadable({
loader: () => import('./modules/login/Otherlogin'),
loading: Loading,
})
const Otherloginstart=Loadable({
loader: () => import('./modules/login/Otherloginstart'),
loading: Loading,
})
const TestIndex = Loadable({
loader: () => import('./modules/test'),
loading: Loading,
@ -406,6 +418,12 @@ class App extends Component {
<Route
path="/register" component={EducoderLogin}
/>
<Route
path="/otherloginstart" component={Otherloginstart}
/>
<Route
path="/otherlogin" component={Otherlogin}
/>
<Route path="/users/:username"
render={
(props) => {

@ -0,0 +1,310 @@
import React,{ Component } from "react";
import { Modal,Checkbox,DatePicker} from "antd";
import { handleDateString } from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
const CheckboxGroup = Checkbox.Group;
const dateFormat = 'YYYY-MM-DD HH:mm';
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
function disabledDateTime() {
return {
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
// disabledSeconds: () => [55, 56],
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class OneSelfOrderModal extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
endtime:""
}
}
componentDidMount() {
if(this.props.course_groups!=undefined&&this.props.course_groups.length!=0){
let arr=this.props.course_groups.map(item => item.id);
this.shixunhomeworkedit(arr);
}
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm")
})
}
}
componentDidUpdate=(prevProps)=>{
// if(prevProps.visible!=this.props.visible){
//
// if(this.props.course_groups!=undefined){
// let arr=this.props.course_groups.map(item => item.id);
// this.shixunhomeworkedit(arr);
// }
// }
if(prevProps.course_groups!=this.props.course_groups){
if(this.props.course_groups!=undefined){
let arr=this.props.course_groups.map(item => item.id);
this.shixunhomeworkedit(arr);
}
}
if(prevProps.starttimes!=this.props.starttimes){
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm")
})
}
}
}
//勾选实训
shixunhomeworkedit=(list)=>{
this.setState({
group_ids:list
})
this.props.getcourse_groupslist && this.props.getcourse_groupslist(list)
}
onChangeTimeend= (date, dateString) => {
// console.log('startValue',dateString);
this.setState({
endtime: date===null?"":handleDateString(dateString),
})
}
propsSaves=(ds,endtime)=>{
if(ds.length ===0&&endtime === ""){
this.props.Saves()
}else{
if(this.props.typs!="end"){
if(endtime === ""||endtime===undefined||endtime===null){
this.setState({
endtimetype:true,
endtimetypevalue:"截止时间不能为空"
})
return
}
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
this.setState({
endtimetype:true,
endtimetypevalue:"必须晚于发布时间"
})
return
}
}
this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm"))
}
}
render(){
let {group_ids,endtime}=this.state;
let {course_groups}=this.props;
// console.log(this.props.starttimes)
// console.log(endtime)
// console.log(this.props.starttimes)
// console.log(this.state.endtime)
// console.log(this.props.starttime,this.props.endtime)
// TODO course_groups为空时的处理
// let endtimelist=this.props.starttimes===undefined||this.props.starttimes===""?"":moment(handleDateString(endtime)).add(1,'months')
return(
<div>
{
this.props.OneSelftype===true?<style>
{
`
body {
overflow: hidden !important;
}
`
}
</style>:""
}
{
this.props.OneSelftype===true? <Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.modalname}
visible={this.props.OneSelftype}
closable={false}
footer={null}
destroyOnClose={true}
>
<div className="task-popup-content">
{ this.props.usingCheckBeforePost ?
<React.Fragment>
<p className="task-popup-text-center font-16">
<span>发布设置均可修改</span>
<span className={"color-blue underline"} onClick={this.props.onToPublishClick}>
点击修改
</span>
</p>
<p className="task-popup-text-center font-16 mt10">
此设置将对所有分班生效
</p>
</React.Fragment> :
<React.Fragment>
<p className="task-popup-text-center font-16">
{this.props.Topval}
<span className={"color-blue underline"}>{this.props.Topvalright}</span>
</p>
<p className="task-popup-text-center font-16 mt10">
{this.props.Botvalleft===undefined?"":<span className={"colorFF6800"}>"{this.props.Botvalleft}"</span>}
{this.props.Botval}
</p>
</React.Fragment> }
{this.props.starttime===undefined||
this.props.starttime===""?""
: <p className="task-popup-text-center font-16 mt20">
<span className={"font-14 mr20 color979797"}>
<span className={"mr10"}>发布时间:</span>
{this.props.starttime}</span>
{this.props.modaltype===undefined||this.props.modaltype===2? <span className={"font-14 color979797"}>
{/*{this.props.endtime}*/}
<span className={"mr10"}>截止时间:</span>
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
value={endtime===null||endtime===""?"":moment(endtime, dateFormat)}
onChange={this.onChangeTimeend}
className={ this.state.endtimetype===true?"noticeTip":""}
/>
{this.state.endtimetype===true?<div className={"color-red fr mr90 mt5"}>{this.state.endtimetypevalue}</div>:""}
</span>:""}
</p>}
{/* usingCheckBeforePost 为true的时候 全选所有分班 */}
<style>
{
`
.ant-checkbox-wrapper {
margin-top: 0px;
float: left;
}
.upload_select_box li:hover {
background: transparent;
}
.F4FAFF{
background: #F4FAFF;
}
`
}
</style>
{this.props.modaltype===undefined||this.props.modaltype===2
|| this.props.usingCheckBeforePost ?"":<div className="clearfix edu-txt-center lineh-40 F4FAFF">
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
<span style={{"float":"left","color":"#05101A"}} className="task-hide color-grey-name ml50">分班名称</span>
<span style={{"float":"right","color":"#05101A"}} className="task-hide color-grey-name mr70">截止时间</span>
</li>
</div>}
{this.props.modaltype===undefined||this.props.modaltype===2
|| this.props.usingCheckBeforePost ?"":<ul className="upload_select_box fl clearfix mb30"
style={{"overflow-y":"auto",padding:"10px 0px"}}
id="search_not_members_list"
>
{ <Checkbox.Group style={{ width: '100%' }} value={group_ids} onChange={this.shixunhomeworkedit}>
{
course_groups.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40" key={key}>
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
<Checkbox
className="task-hide edu-txt-left"
name="shixun_homework[]"
value={item.id}
key={item.id}
>
<span style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name">{item.name}</span>
</Checkbox>
<DatePicker
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
id={"endTime"}
width={"210px"}
value={item.end_time===null||item.end_time===""?"":moment(item.end_time, dateFormat)}
onChange={this.onChangeTimeend}
className={ this.state.endtimetype===true?"noticeTip fr":"fr"}
/>
</li>
</div>
)
})
}
</Checkbox.Group>}
</ul>
}
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.propsSaves(group_ids,this.state.endtime)}>{this.props.Savesname}</a>
</div>
</div>
</Modal>:""}
</div>
)
}
}
export default OneSelfOrderModal;

@ -1701,4 +1701,47 @@ input.ant-input-number-input:focus {
/*}*/
.yslinputcourput .ant-form-explain{
padding-left: 0px !important;
}
.wechatloginfont{
font-size: 14px;
font-family: PingFangSC-Regular,PingFangSC;
font-weight: 400;
color: #555555;
line-height: 20px;
margin-top: 10px;
}
.wechatdiv{
margin-top: 40px !important;
width: 800px !important;
}
.wechatContent{
padding: 0px 50px;
}
.wechatpass{
width: 300px;
height: 46px;
}
.wechatnewchat{
width: 62px;
height: 62px;
background: rgba(255,170,170,1);
border-radius: 50%;
text-align: center;
line-height: 62px;
color: #fff;
margin: 0 auto;
}
.wechatweoldchat{
width: 62px;
height: 62px;
background:rgba(164,211,255,1);
border-radius: 50%;
text-align: center;
line-height: 62px;
color: #fff;
margin: 0 auto;
}

@ -20,89 +20,89 @@ import Modals from '../../../modals/Modals';
//毕设描述
const GraduationTasksquestions= Loadable({
loader: () => import('./GraduationTaskssettingquestions'),
loading: Loading,
loader: () => import('./GraduationTaskssettingquestions'),
loading: Loading,
})
//毕设任务设置
const GraduationTaskssetting=Loadable({
loader: () => import('./GraduationTaskssetting'),
loading: Loading,
loader: () => import('./GraduationTaskssetting'),
loading: Loading,
})
//毕设任务列表
const GraduationTaskslist=Loadable({
loader: () => import('./GraduationTaskssettinglist'),
loading: Loading,
loader: () => import('./GraduationTaskssettinglist'),
loading: Loading,
})
class GraduationTaskDetail extends Component{
constructor(props){
super(props);
this.state={
modalname:undefined,
visible:false,
constructor(props){
super(props);
this.state={
modalname:undefined,
visible:false,
Topval:undefined,
starttime:undefined,
starttimes:undefined,
typs:undefined,
endtime:undefined,
Cancelname:undefined,
Savesname:undefined,
Cancel:undefined,
Saves:undefined,
Topvalright:undefined,
Botvalleft:undefined,
course_groupslist:undefined,
course_groups:undefined,
questionslist:undefined,
tab:"list",
visibles:undefined,
Modalstype:undefined,
Modalstopval:undefined,
ModalCancel:undefined,
ModalSave:undefined,
acrossVisible:undefined
}
}
componentDidMount(){
this.getdatas()
}
getdatas=()=>{
const task_Id = this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+".json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
questionslist:result.data
})
}
}).catch((error)=>{
console.log(error)
})
}
// 交叉评阅设置弹框
openAcross=()=>{
this.setState({
acrossVisible:true
})
}
closeAcross=()=>{
this.setState({
acrossVisible:false
})
endtime:undefined,
Cancelname:undefined,
Savesname:undefined,
Cancel:undefined,
Saves:undefined,
Topvalright:undefined,
Botvalleft:undefined,
course_groupslist:undefined,
course_groups:undefined,
questionslist:undefined,
tab:"list",
visibles:undefined,
Modalstype:undefined,
Modalstopval:undefined,
ModalCancel:undefined,
ModalSave:undefined,
acrossVisible:undefined
}
}
componentDidMount(){
this.getdatas()
}
}
getdatas=()=>{
const task_Id = this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+".json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
questionslist:result.data
})
}
}).catch((error)=>{
console.log(error)
})
}
//返回
goback=()=>{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
// 交叉评阅设置弹框
openAcross=()=>{
this.setState({
acrossVisible:true
})
}
closeAcross=()=>{
this.setState({
acrossVisible:false
})
this.getdatas()
}
//返回
goback=()=>{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
// let courseId = this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
@ -112,66 +112,66 @@ class GraduationTaskDetail extends Component{
// this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`);
}
//立即发布
publish=()=>{
let starttime= this.props.getNowFormatDates(1,1);
let endtime=this.props.getNowFormatDates(2,1);
// this.homeworkstart()
this.setState({
modalname:"立即发布",
visible:true,
}
//立即发布
publish=()=>{
let starttime= this.props.getNowFormatDates(1,1);
let endtime=this.props.getNowFormatDates(2,1);
// this.homeworkstart()
this.setState({
modalname:"立即发布",
visible:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
// Botvalleft:"点击修改",
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",
endtime:endtime,
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.cancelmodel,
Saves:this.homepublish,
})
}
// 确定立即发布
homepublish=(ids,endtime)=>{
this.cancelmodel();
let task_Id=this.props.match.params.task_Id;
const cid = this.props.match.params.coursesId;
// let url = `/courses/${cid}/graduation_tasks/publish_task.json`;
let url="/courses/"+cid+"/graduation_tasks/publish_task.json"
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
endtime:endtime,
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.cancelmodel,
Saves:this.homepublish,
})
}
// 确定立即发布
homepublish=(ids,endtime)=>{
this.cancelmodel();
let task_Id=this.props.match.params.task_Id;
const cid = this.props.match.params.coursesId;
// let url = `/courses/${cid}/graduation_tasks/publish_task.json`;
let url="/courses/"+cid+"/graduation_tasks/publish_task.json"
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
end_time:endtime,
}).then((response)=>{
if (response.data.status == 0) {
}).then((response)=>{
if (response.data.status == 0) {
this.getdatas()
this.props.showNotification(response.data.message);
this.setState({
// Modalstopval:response.data.message,
// ModalSave:this.cancelmodel,
// Loadtype:true,
course_groupslist:[],
checkAllValue:false
})
}
}).catch((error)=>{
})
}
// 刷新
resetList=()=>{
this.getdatas();
this.child && this.child.searchValue();
}
// 立即截止
end=()=>{
this.props.showNotification(response.data.message);
this.setState({
// Modalstopval:response.data.message,
// ModalSave:this.cancelmodel,
// Loadtype:true,
course_groupslist:[],
checkAllValue:false
})
}
}).catch((error)=>{
})
}
// 刷新
resetList=()=>{
this.getdatas();
this.child && this.child.searchValue();
}
// 立即截止
end=()=>{
// this.homeworkstart()
this.setState({
modalname:"立即截止",
@ -185,74 +185,74 @@ class GraduationTaskDetail extends Component{
Saves:this.coursetaskend,
typs:"end",
})
}
coursetaskend=()=>{
const coursesId = this.props.match.params.coursesId;
const task_Id = this.props.match.params.task_Id;
let url = `/courses/${coursesId}/graduation_tasks/end_task.json`;
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
}).then((response)=>{
if (response.data.status == 0) {
this.props.showNotification(response.data.message);
this.cancelmodel();
this.getdatas();
this.child && this.child.reInit();
}
}).catch((error)=>{
})
}
// 取消
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
})
}
getcourse_groupslist=(id)=>{
this.setState({
course_groupslist:id
})
}
setTab = (tab) =>{
this.setState({
tab
})
}
// 关联项目
AssociationItems=()=>{
}
coursetaskend=()=>{
const coursesId = this.props.match.params.coursesId;
const task_Id = this.props.match.params.task_Id;
let url = `/courses/${coursesId}/graduation_tasks/end_task.json`;
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
}).then((response)=>{
if (response.data.status == 0) {
this.props.showNotification(response.data.message);
this.cancelmodel();
this.getdatas();
this.child && this.child.reInit();
}
}).catch((error)=>{
})
}
// 取消
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
})
}
getcourse_groupslist=(id)=>{
this.setState({
course_groupslist:id
})
}
setTab = (tab) =>{
this.setState({
tab
})
}
// 关联项目
AssociationItems=()=>{
this.setState({
visibles:true
})
}
Cancel=()=>{
}
Cancel=()=>{
this.setState({
visibles:false
})
}
// 取消关联
cannelAssociation=()=>{
}
// 取消关联
cannelAssociation=()=>{
this.setState({
Modalstype:true,
Modalstopval:"确定要取消该项目关联?",
ModalCancel:this.cannerassocition,
ModalSave:this.savetassociton
})
}
savetassociton=()=>{
}
savetassociton=()=>{
this.cannerassocition();
let {questionslist}=this.state;
let url = "/graduation_tasks/"+questionslist.task_id+"/graduation_works/cancel_relate_project.json";
@ -266,7 +266,7 @@ class GraduationTaskDetail extends Component{
})
}
cannerassocition=()=>{
cannerassocition=()=>{
this.setState({
Modalstype:false,
Modalstopval:"",
@ -275,10 +275,10 @@ class GraduationTaskDetail extends Component{
loadtype:false,
visibles:false
})
}
// 补交附件
handaccessory=()=>{
// let {taskslistdata}=this.state;
}
// 补交附件
handaccessory=()=>{
// let {taskslistdata}=this.state;
// let courseId=this.props.match.params.coursesId;
//
// let url="/courses/"+courseId+"/graduation_tasks/"+taskslistdata.work_id+"/appraise"
@ -292,129 +292,129 @@ class GraduationTaskDetail extends Component{
this.setState({
avisible:false
})
}
bindRef = ref => { this.child = ref } ;
render(){
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.task_Id;
let {
questionslist ,
tab ,
visibles ,
Modalstype,
Modalstopval,
ModalCancel,
ModalSave,
acrossVisible
} = this.state
const commom = {
setTab:this.setTab,
getdatas:this.getdatas
}
return(
<div className="newMain clearfix">
{
questionslist &&
<div className={"educontent mb20"}>
<HomeworkModal
starttimes={this.state.starttimes}
typs={this.state.typs}
modalname={this.state.modalname}
visible={this.state.visible}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
/>
{/*关联项目*/}
{visibles===true?
<Associationmodel
modalname={"关联项目"}
visible={visibles}
Cancel={()=>this.Cancel()}
taskid={ questionslist && questionslist.task_id }
funlist={this.resetList}
/>
:""}
{this.state.avisible===true?<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={this.state.avisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
categoryid={questionslist.work_id}
setupdate={this.resetList}
/>:""}
{/*提示*/}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalCancel={ModalCancel}
modalSave={ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
{
acrossVisible &&
<GraduationAcross
{...this.props}
{...this.state}
task_Id={task_Id}
modalVisible={acrossVisible}
modalCloss={this.closeAcross}
resetFun={this.resetList}
comment_status={ questionslist && questionslist.comment_status }
/>
}
<p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={`/courses/${courseId}/graduation_tasks/${category_id}`} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black summaryname">
<Link to={`/courses/${courseId}/graduation_tasks/${category_id}`} className="color-grey-3">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white pl30 pr30 graduationTaskMenu">
<Link className={tab && tab == "list" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+task_Id+"/list"}>任务列表</Link>
<Link className={tab && tab == "questions" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+task_Id+"/questions"}>毕设描述</Link>
<Link className={tab && tab == "setting" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+task_Id+"/setting?tab=3"}>设置</Link>
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
<style>
{ `
}
bindRef = ref => { this.child = ref } ;
render(){
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.task_Id;
let {
questionslist ,
tab ,
visibles ,
Modalstype,
Modalstopval,
ModalCancel,
ModalSave,
acrossVisible
} = this.state
const commom = {
setTab:this.setTab,
getdatas:this.getdatas
}
return(
<div className="newMain clearfix">
{
questionslist &&
<div className={"educontent mb20"}>
<HomeworkModal
starttimes={this.state.starttimes}
typs={this.state.typs}
modalname={this.state.modalname}
visible={this.state.visible}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
/>
{/*关联项目*/}
{visibles===true?
<Associationmodel
modalname={"关联项目"}
visible={visibles}
Cancel={()=>this.Cancel()}
taskid={ questionslist && questionslist.task_id }
funlist={this.resetList}
/>
:""}
{this.state.avisible===true?<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={this.state.avisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
categoryid={questionslist.work_id}
setupdate={this.resetList}
/>:""}
{/*提示*/}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalCancel={ModalCancel}
modalSave={ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
{
acrossVisible &&
<GraduationAcross
{...this.props}
{...this.state}
task_Id={task_Id}
modalVisible={acrossVisible}
modalCloss={this.closeAcross}
resetFun={this.resetList}
comment_status={ questionslist && questionslist.comment_status }
/>
}
<p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={`/courses/${courseId}/graduation_tasks/${category_id}`} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black summaryname">
<Link to={`/courses/${courseId}/graduation_tasks/${category_id}`} className="color-grey-3">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white pl30 pr30 graduationTaskMenu">
<Link className={tab && tab == "list" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+task_Id+"/list"}>任务列表</Link>
<Link className={tab && tab == "questions" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+task_Id+"/questions"}>毕设描述</Link>
<Link className={tab && tab == "setting" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/detail/"+task_Id+"/setting?tab=3"}>设置</Link>
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
<style>
{ `
.drop_down_menu{
height: 118px;
left:0px;
@ -442,63 +442,63 @@ class GraduationTaskDetail extends Component{
height: 26px;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{
return(
<span key={key} className="fr mt20">
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{
return(
<span key={key} className="fr mt20">
{item==="提交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works/"+task_Id+"/new"}>提交作品</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works/"+task_Id+"/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works"+"/"+ questionslist.work_id + "/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16 ml20"} target="_blank" href={"/courses/"+courseId+"/graduation_tasks/"+ questionslist.work_id + "/appraise"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16 ml20"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16 ml20"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16 ml20"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16 ml20"} onClick={this.handaccessory}>补交附件</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works/"+task_Id+"/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works"+"/"+ questionslist.work_id + "/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16 ml20"} target="_blank" href={"/courses/"+courseId+"/graduation_tasks/"+ questionslist.work_id + "/appraise"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16 ml20"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16 ml20"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16 ml20"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16 ml20"} onClick={this.handaccessory}>补交附件</a>:""}
</span>
)
})}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{ this.props.isAdmin() ? questionslist.status===1 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a> : "" : "" }
{ this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" }
{ this.props.isAdmin() && questionslist.cross_comment ? <a className={"fr color-blue font-16"} onClick={this.openAcross}>交叉评阅设置</a> : "" }
{ this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" }
</div>
</div>
<Switch {...this.props}>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
render={
(props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`list`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting"
render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`setting`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions"
render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`questions`}/>)
}></Route>
</Switch>
</div>
}
</div>
)
}
)
})}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{ this.props.isAdmin() ? questionslist.status===1 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a> : "" : "" }
{ this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" }
{ this.props.isAdmin() && questionslist.cross_comment ? <a className={"fr color-blue font-16"} onClick={this.openAcross}>交叉评阅设置</a> : "" }
{ this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" }
</div>
</div>
<Switch {...this.props}>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
render={
(props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`list`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting"
render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`setting`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions"
render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`questions`}/>)
}></Route>
</Switch>
</div>
}
</div>
)
}
}
// CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC))
export default (GraduationTaskDetail) ;

@ -473,7 +473,7 @@ class GraduationTasks extends Component{
checkAllValue:false
})
this.publishcanner();
debugger
let {search,page,order} = this.state
this.fetchAll(search,page,order);
}

@ -4,6 +4,7 @@ import { WordsBtn,on, off, trigger } from 'educoder';
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import ShixunModal from "../coursesPublic/ShixunModal";
import PathModal from "../coursesPublic/PathModal";
import NewShixunModel from '../coursesPublic/NewShixunModel';
@ -227,10 +228,11 @@ class ShixunHomework extends Component{
addnametab:undefined,
typs:undefined,
starttimes:undefined,
OneSelftype:false
})
this.cancelmodel()
this.homeworkupdatalist(Coursename,page,order);
this.props.updataleftNavfun()
this.homeworkupdatalist(Coursename,page,order);
this.cancelmodel()
}
@ -272,6 +274,48 @@ class ShixunHomework extends Component{
});
}
//立即发布
homeworkOneSelfstart=()=>{
let selectnum= this.testonSelect();
if(selectnum===true){
this.noSelect();
return
}
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/all_course_groups.json";
axios.get(url).then((response) => {
if(response.status===200){
let starttime= this.props.getNowFormatDates(1);
let endtime=this.props.getNowFormatDates(2);
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
OneSelftype:true,
typs:"start",
Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`,
starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:starttime,
endtime:"截止时间:"+endtime,
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
course_groups:response.data.course_groups,
})
}
}).catch((error) => {
console.log(error)
});
}
cancelmodels=()=>{
this.setState({
Modalstype:false,
@ -316,10 +360,12 @@ class ShixunHomework extends Component{
})
}
this.props.showNotification(result.data.message)
this.homeworkupdatalist(Coursename,page,order);
this.cancelmodel()
this.props.showNotification(result.data.message)
this.props.updataleftNavfun()
this.homeworkupdatalist(Coursename,page,order);
this.cancelmodel()
}
}).catch((error)=>{
console.log(error);
@ -414,11 +460,11 @@ class ShixunHomework extends Component{
Loadtype:false,
course_groups:[]
})
this.homeworkupdatalist(Coursename,page,order);
this.cancelmodel()
this.props.showNotification(response.data.message)
this.props.updataleftNavfun()
this.homeworkupdatalist(Coursename,page,order);
this.cancelmodel()
}
})
.catch(function (error) {
@ -722,8 +768,8 @@ class ShixunHomework extends Component{
checkedtype:false,
antIcon:false
})
this.homeworkupdatalist(Coursename,page,order);
this.props.showNotification(response.data.message)
this.homeworkupdatalist(Coursename,page,order);
this.props.updataleftNavfun()
}else{
this.setState({
@ -782,6 +828,7 @@ class ShixunHomework extends Component{
this.setState({
Modalstype:false,
OneSelftype:false,
Loadtype:false,
visible:false,
Modalstopval:"",
@ -834,9 +881,10 @@ class ShixunHomework extends Component{
Loadtype:false,
checkBoxValues:[]
})
this.homeworkupdatalist(Coursename,page,order);
this.props.showNotification(response.data.message)
this.homeworkupdatalist(Coursename,page,order);
}
})
.catch(function (error) {
@ -886,9 +934,10 @@ class ShixunHomework extends Component{
checkBoxValues:[],
checkAllValue:false
})
this.homeworkupdatalist(Coursename,page,order);
this.props.showNotification('已完成')
this.props.updataleftNavfun()
this.homeworkupdatalist(Coursename,page,order);
}
})
}
@ -1022,7 +1071,7 @@ class ShixunHomework extends Component{
loadtype={this.state.Loadtype}
antIcon={this.state.antIcon}
/>:""}
{/*立即发布*/}
{/*批量立即发布*/}
{visible===true?<HomeworkModal
datas={datas}
category_id={this.props.match.params.category_id}
@ -1045,7 +1094,28 @@ class ShixunHomework extends Component{
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""}
{/*{单个立即发布}*/}
{/*<OneSelfOrderModal*/}
{/*OneSelftype={this.state.OneSelftype}*/}
{/*datas={datas}*/}
{/*category_id={this.props.match.params.category_id}*/}
{/*modaltype={modaltype}*/}
{/*modalname={modalname}*/}
{/*Topval={Topval}*/}
{/*Topvalright={Topvalright}*/}
{/*Botvalleft={Botvalleft}*/}
{/*Botval={Botval}*/}
{/*starttime={starttime}*/}
{/*starttimes={this.state.starttimes}*/}
{/*typs={this.state.typs}*/}
{/*endtime={endtime}*/}
{/*Cancelname={Cancelname}*/}
{/*Savesname={Savesname}*/}
{/*Cancel={Cancel}*/}
{/*Saves={Saves}*/}
{/*course_groups={course_groups}*/}
{/*getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}*/}
{/*/>*/}
{shixunmodal===true||shixunpath===true?<style>
{
`
@ -1128,7 +1198,9 @@ class ShixunHomework extends Component{
<Checkbox className="fl" style={{marginTop:'0px'}} checked={checkedtype} onClick={this.funselect}>已选 {checkBoxValues&&checkBoxValues.length} 不支持跨页勾选</Checkbox>
<div className="studentList_operation_ul">
<li className="li_line"><a className="color-grey-9" onClick={this.onDelete}>删除</a></li>
<li className="li_line"><a className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>
{/*{checkBoxValues&&checkBoxValues.length>1?<li className="li_line"><a className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>*/}
{/*:<li className="li_line"><a className="color-grey-9" onClick={this.homeworkOneSelfstart}>单个立即发布</a></li>}*/}
<li className="li_line"><a className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>
{/*onClick={this.homeworkstart}*/}
<li className="li_line"><a className="color-grey-9" onClick={this.homeworkends}>立即截止</a></li>
<li className="li_line" style={{display:datas===undefined?"none":datas.course_public===true?"block":"none"}}>

@ -20,9 +20,6 @@ var newContainer={
top: "0px",
bottom: "0px",
minHeight: "100%",
overflow:"hidden",
}
class EducoderInteresse extends Component {
constructor(props) {

@ -60,7 +60,6 @@ var newContainer={
top: "0px",
bottom: "0px",
minHeight: "100%",
overflow:"hidden",
paddingTop: "40px",
}

@ -21,7 +21,7 @@
overflow-y:hidden !important;
}
#log_reg_content{
top: 0px !important;
top: -64px !important;
}
#log_reg_content{
width:405px !important;
@ -106,7 +106,7 @@
#closeIcon{
position: absolute;
top: -30px;
top: -100px;
right: -27px;
z-index: 100000;
}
@ -114,7 +114,7 @@
.bluebutton{
width: 100%;
text-align: center;
color: #FFFFff!important;
color: #FFFFff !important;
display: block;
background: #cbcbcb;
height: 45px;
@ -130,4 +130,13 @@
.startlogin{
color:#888;
}
.weixinheight390{
height: 390px;
}
#log_reg_content {
padding: 38px 30px 20px !important;
}
.textcenter{
text-align: center;
}

@ -104,6 +104,7 @@ class LoginDialog extends Component {
MyEduCoderModals:false,
Phonenumberisnotco:undefined,
Phonenumberisnotcobool:false,
weixinlogin:false
};
}
@ -506,9 +507,19 @@ class LoginDialog extends Component {
getloginurl=(url)=>{
window.location.href = url;
};
openweixinlogin=()=>{
this.setState({
weixinlogin:true
})
}
hideweixinlogin=()=>{
this.setState({
weixinlogin:false
})
}
render() {
let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco,
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state;
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender,weixinlogin}=this.state;
if (isRender === undefined) {
isRender = false
@ -532,14 +543,14 @@ class LoginDialog extends Component {
</div>
<div id="log_reg_content" >
<ul className="log_nav clearfix">
{weixinlogin===true?"": <ul className="log_nav clearfix">
<li className={login==0?'active':''} onClick={()=>{this.enter(0)}}>登录</li>
{/*<li className={speedy==0?'active':''} onClick={()=>{this.register(0)}}>快捷登录</li>*/}
</ul>
</ul>}
<div className="login-panel" id="login-panel-1" style={{display: login==0?'block':'none'}}>
<form acceptCharset="UTF-8" action="/login" id="main_login_form" method="post">
{weixinlogin===true?"":<form acceptCharset="UTF-8" action="/login" id="main_login_form" method="post">
<div style={{"display":"inline","padding":"0","margin":"0"}}>
<input name="utf8" type="hidden" value="✓"></input>
@ -611,12 +622,26 @@ class LoginDialog extends Component {
</p>
{/*<p className="clearfix mt20">*/}
{/*<span className={"startlogin"}>———————— 快速登录 ————————</span>*/}
{/*</p>*/}
</form>
<p className="clearfix mt20">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={()=>this.openweixinlogin()}>
<img src={require('./WeChat.png')} alt="微信登录"/>
</a>
</div>
</p>
</form>}
{weixinlogin===true?<iframe
className={"weixinheight390"}
frameBorder="0"
sandbox="allow-scripts allow-same-origin allow-top-navigation"
scrolling="no"
src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect"></iframe>:""}
{weixinlogin===true?<p className="clearfix">
<a className={"startlogin color-blue"} onClick={()=>this.hideweixinlogin()}>返回账号登录</a>
</p>:""}
</div>
{/*快捷登录*/}

@ -0,0 +1,291 @@
import React, {Component} from "react";
import {
Form,
Select,
Input,
Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Divider,
InputNumber,
Tag,
DatePicker,
Radio,
Tooltip,
notification,
Layout,
Spin
} from "antd";
import axios from 'axios';
const { Header, Footer, Sider, Content } = Layout;
import { getImageUrl } from 'educoder'
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import '../courses/css/members.css';
import "../courses/common/formCommon.css"
import '../courses/css/Courses.css';
import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png';
//educoder登入页面
var sectionStyle = {
"height": "100%",
"width": "100%",
"min-width": "1000px",
// makesure here is String确保这里是一个字符串以下是es6写法
};
var imgback = {
" background-size":"cover",
"background-repeat":"no-repeat",
backgroundImage: `url(${beijintulogontwo})`,
}
var imgmian ={
width: "100%",
background: `url(${beijintulogontwo})`,
position: "relative",
}
var newContainer={
// background: `url(${beijintulogontwo})`,
backgroundPosition: "center" ,
backgroundRepeat: "no-repeat",
backgroundAttachment: "fixed",
backgroundSize: "100% 100%",
height:" 100%",
width:" 100%",
position: "absolute",
top: "0px",
bottom: "0px",
minHeight: "100%",
paddingTop: "40px",
}
class Otherlogin extends Component {
constructor(props) {
super(props);
this.state={
login:undefined,
password:undefined,
data:undefined,
logintypes:undefined,
spinnings:true
}
}
componentDidMount() {
let url = `/users/get_user_info.json`
axios.get(url).then((result)=> {
console.log(result);
if(result){
this.setState({
data:result.data,
spinnings:false
})
}
}).catch((error)=>{
this.setState({
spinnings:false
})
})
}
loginInputonChange=(e)=>{
if(e.target.value===undefined||e.target.value===""||e.target.value===null){
}else{
if(this.state.logintypes==="username"){
this.setState({
logintypes:undefined
})
}
}
this.setState({
login:e.target.value,
})
}
passwordonChange=(e)=>{
if(e.target.value===undefined||e.target.value===""||e.target.value===null){
}else{
if(this.state.logintypes==="password"){
this.setState({
logintypes:undefined
})
}
}
this.setState({
password:e.target.value,
})
}
postwechatlogin=(type,username,password)=>{
if(type===false){
if(username===undefined||username===""||username===null){
this.setState({
logintypes:"username"
})
return
}
if(password===undefined||password===""||password===null){
this.setState({
logintypes:"password"
})
return
}
}
let url = "/bind_user.json";
axios.post(url, {
type: 'wechat',
not_bind:type,
username:username,
password:password
}).then((response) => {
if(response.data.status===0){
window.location.href="/"
}
}).catch((error) => {
console.log(error)
});
}
render() {
let {data,logintypes,spinnings} = this.state;
console.log(logintypes)
return (
<div style={newContainer} className=" clearfix" >
<Spin size="large" spinning={spinnings} >
<style>
{
`
#root{
background:#fff !important;
}
`
}
</style>
<div>
<div style={{
"width": "100%"
}}>
<div >
<div className={"textcenter"} >
<img src={getImageUrl(data&&data.image_url)}/>
</div>
<div className={"textcenter wechatloginfont"}>
为了更好的为您服务请关联一个EduCoder账号
</div>
</div>
<div className={"educontent clearfix wechatdiv"}>
<style>
{
`
.ant-layout,.ant-layout-sider,.ant-layout-content{
background: #FFF;
}
.ant-layout-header {
height: 50px;
padding: 0 48px;
line-height: inherit;
background: #001529;
background: #FFF;
font-size: 14px;
font-family: PingFangSC-Regular,PingFangSC;
font-weight: 400;
color: rgba(0,0,0,1);
}
.ant-layout-footer {
padding: 0px 50px;
background: #FFF;
}
.wechattiyan{
width:300px;
height:46px;
background:rgba(25,144,255,1);
border-radius:4px;
}
`
}
</style>
<p>
<Layout>
<Sider>
<div className={"wechatnewchat"}>
新用户
</div>
</Sider>
<Layout>
<Header>欢迎来到EduCoder新用户登录EduCoder可以到账号管理-安全设置中绑定手机/邮箱以后可以用绑定的手机/邮箱设置的密码登录EduCoder了</Header>
<Content className={"wechatContent"}>立即体验表示您已经同意我们的 <span><a href="https://forge.educoder.net/help?index=4" target="_blank" className={"color-blue"}> 服务协议条款</a></span></Content>
<Footer>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{height:"46px"}} onClick={() => this.postwechatlogin(true)}
size={"large"}>立即体验</Button>
</Footer>
</Layout>
</Layout>
</p>
<Divider />
<p>
<Layout>
<Sider>
<div className={"wechatweoldchat"}>
老用户
</div>
</Sider>
<Layout>
<Header>已有EduCoder账号可以输入您的账号和密码将您的微信账号与EduCoder账号进行绑定</Header>
<Content className={"wechatContent"}>
<Input placeholder="请输入手机号/邮箱/登录名"
value={this.state.login}
onInput={this.loginInputonChange}
className={this.state.logintypes==="username"?"bor-red mb20 wechatpass":" mb20 wechatpass"}
></Input>
<Input value={this.state.password}
onInput={this.passwordonChange}
className={this.state.logintypes==="password"?"bor-red wechatpass":" wechatpass"}
placeholder="请输入密码"></Input>
</Content>
{this.state.logintypes==="username"?<span className={"color-red ml50"}>请填写账号</span>:this.state.logintypes==="password"?<span className={"color-red ml50"}></span>:""}
<Footer>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{height:"46px"}} onClick={() => this.postwechatlogin(false,this.state.login,this.state.password)}
size={"large"}>绑定</Button>
</Footer>
</Layout>
</Layout>
</p>
</div>
</div>
<div style={{
display: "flex",
justifyContent: "center",
width: "100%",
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>
</div>
</Spin>
</div>
)
}
}
export default Otherlogin;

@ -0,0 +1,52 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Spin } from 'antd';
import axios from 'axios';
class Otherloginstart extends Component {
componentDidMount() {
let query=this.props.location.search;
const type = query.split('?code=');
const types = type[1].split('&state=');
let codeurl = `/auth/wechat/callback.json`
axios.get(codeurl,{params:{
code:types[0]
}}).then((result)=> {
if(result){
if(result.data.status===0){
if(result.data.true===false){
window.location.href="/otherlogin"
}else{
// this.getinfo()
window.location.href="/"
}
}
}
}).catch((error)=>{
})
}
render() {
// Loading
return (
<div className="App" style={{minHeight: '800px',width:"100%"}}>
<style>
{
`
.margintop{
margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"}/>
</div>
);
}
}
export default Otherloginstart;

@ -594,7 +594,10 @@ class LoginRegisterComponent extends Component {
})
}
gobackshowbool=()=>{
this.props.history.push("/login");
this.props.Setshowbool(1)
}
render() {
const {
// 登录
@ -621,7 +624,7 @@ class LoginRegisterComponent extends Component {
// height: 346px;
return (
<div className="login_register_content" style={{height: "470px"}}>
<div className="login_register_content" >
<ReadPassword
modalsType={this.state.modalsType}
StudyMakeMoney={()=>this.StudyMakeMoney()}
@ -801,6 +804,9 @@ class LoginRegisterComponent extends Component {
<Button size={"large"} type="primary"
style={{height:"46px", width: "100%",marginBottom:"26px"}}
onClick={this.Retrievepassword}>完成</Button>
<p className="clearfix mb20 textcenter">
<a className={"startlogin color-blue"} onClick={()=>this.gobackshowbool()}>返回登录注册</a>
</p>
</div>
</div>

@ -67,7 +67,7 @@ class LoginRegisterComponent extends Component {
MyEduCoderModals:false,
registered:undefined,
Phonenumberisnotcodmms:undefined,
weixinlogin:false,
}
}
if(props.loginstatus === false){
@ -105,6 +105,7 @@ class LoginRegisterComponent extends Component {
MyEduCoderModals:false,
registered:undefined,
Phonenumberisnotcodmms:undefined,
weixinlogin:false,
}
}
@ -135,15 +136,22 @@ class LoginRegisterComponent extends Component {
let pcipns=this.IsPC();
if (this.props.match.url === "/login") {
console.log("11111111111111111111111111");
this.state = {
tab:["0"],
}
// this.state = {
// tab:["0"],
//
// }
this.setState({
tab:["0"]
})
} else if (this.props.match.url === "/register") {
this.state = {
tab:["1"],
}
console.log("11111111111111111111111111");
// this.state = {
// tab:["1"],
//
// }
this.setState({
tab:["1"]
})
}
this.setState({
pciphone:pcipns,
@ -857,6 +865,18 @@ class LoginRegisterComponent extends Component {
registered:"注册成功"
})
};
openweixinlogin=()=>{
this.setState({
weixinlogin:true
})
}
hideweixinlogin=()=>{
this.setState({
weixinlogin:false,
tab:["0"]
})
}
render() {
const {
// 登录
@ -881,16 +901,19 @@ class LoginRegisterComponent extends Component {
readAgreement,
pciphone,
Phonenumberisnotcodmms,
weixinlogin
} = this.state
// height: 346px;
if (this.state.seconds === 0) {
// window.location.href='http://www.cnblogs.com/a-cat/';
}
console.log(classpass);
return (
<div className="login_register_content login_register_contents" style={ parseInt(tab[0])==0?{height: "366px"} :{height: "510px"}}>
<div className="login_register_content login_register_contents"
// style={ parseInt(tab[0])==0?{height: "366px"} :{height: "510px"}}
>
<style>
{
`
@ -903,13 +926,13 @@ class LoginRegisterComponent extends Component {
</style>
<div>
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab} className="mt20">
{weixinlogin===false?<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab} className="mt20">
<Menu.Item key="0" className={tab===0?"active font-18":"font-18"} > 登录</Menu.Item>
<Menu.Item key="1" className={tab===1?"active font-18 ":"font-18 "} style={{marginLeft:"10px"}} >注册</Menu.Item>
</Menu>
</Menu>:""}
{
parseInt(tab[0])==0 &&
{
weixinlogin===false&&parseInt(tab[0])==0 &&
<div style={{width: '340px'}}>
<style>
{
@ -992,12 +1015,21 @@ class LoginRegisterComponent extends Component {
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postLogin()}
size={"large"}>登录</Button>
<p className="clearfix mb10 textcenter">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={()=>this.openweixinlogin()}>
<img src={require('./img/WeChat.png')} alt="微信登录"/>
</a>
</div>
</p>
</div>
}
{
parseInt(tab[0])==1 &&
weixinlogin===false&&parseInt(tab[0])==1 &&
<div style={{width: '340px'}}>
<Input placeholder="请使用手机号/邮箱账号进行注册"
className={Phonenumberisnotcos && Phonenumberisnotcos !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
@ -1139,15 +1171,33 @@ class LoginRegisterComponent extends Component {
color: '#676767',
}}>我已阅读并同意
<span>
<a href={'/help?index=4'} target="_blank" >服务协议条款</a>
<a href={'https://forge.educoder.net/help?index=4'} target="_blank" className={"color-blue"}>服务协议条款</a>
</span></span></Checkbox>
<Button className=" font-16" type="primary" style={{height:"46px", width: "100%",marginTop:"26px"}} onClick={() => this.postregistered()}
<Button className=" font-16 mb20" type="primary" style={{height:"46px", width: "100%",marginTop:"26px"}} onClick={() => this.postregistered()}
size={"large"}>注册</Button>
<p className="clearfix mb10 textcenter">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={()=>this.openweixinlogin()}>
<img src={require('./img/WeChat.png')} alt="微信登录"/>
</a>
</div>
</p>
</div>
}
{weixinlogin===true?<iframe
className={"weixinheight390 mt20"}
frameBorder="0"
sandbox="allow-scripts allow-same-origin allow-top-navigation"
scrolling="no"
src="https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect"></iframe>:""}
{weixinlogin===true?<p className="clearfix mb20 textcenter">
<a className={"startlogin color-blue"} onClick={()=>this.hideweixinlogin()}>返回登录注册</a>
</p>:""}
</div>
</div>
);
}

@ -153,20 +153,28 @@ class AccountSecure extends Component {
})
}
onPasswordSubmit = () => {
let {basicInfo}=this.props;
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
if(values.p_old == values.p_new){
this.props.showNotification("新密码不能与旧密码相同!");
return;
}
if(basicInfo&&basicInfo.has_password===true){
if(values.p_old == values.p_new){
this.props.showNotification("新密码不能与旧密码相同!");
return;
}
}
if(values.p_again != values.p_new){
this.props.showNotification("两次输入的新密码必须一致!");
return;
}
let {login}=this.props.current_user;
let url=`/users/accounts/${login}/password.json`;
let p_old=undefined;
if(basicInfo&&basicInfo.has_password===true){
p_old=values.p_old
}
axios.put((url),{
old_password:values.p_old,
old_password:p_old,
password:values.p_new
}).then((result)=>{
if(result){
@ -215,6 +223,8 @@ class AccountSecure extends Component {
let {basicInfo}=this.props;
const { getFieldDecorator } = this.props.form;
const { updating,seconds,secondsFlag } = this.state
console.log(basicInfo&&basicInfo.has_password)
return (
<div>
<div className="basicForm settingForm">
@ -426,7 +436,7 @@ class AccountSecure extends Component {
{ updating == PASSWORD &&
<React.Fragment>
<Form.Item
{basicInfo&&basicInfo.has_password===true?<Form.Item
label="旧密码"
className="mb20 formItemInline hideRequireTag"
>
@ -439,7 +449,7 @@ class AccountSecure extends Component {
})(
<Input type="password" placeholder="请设置816位密码区分大小写" autoComplete="new-password"></Input>
)}
</Form.Item>
</Form.Item>:""}
<Form.Item
label="新密码"

@ -265,4 +265,14 @@
}
.ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
background: transparent !important;
}
.startlogin{
color:#888;
}
.weixinheight390{
height: 390px;
}
#log_reg_content {
padding: 38px 30px 20px !important;
}

@ -58,7 +58,7 @@
.login_btn {
width: 100%;
margin-top: 26px;
margin-bottom: 26px;
margin-bottom: 20px;
}
.dragValidator {
margin-bottom: 16px;
@ -273,4 +273,8 @@
}
.ysllw100{
width: 100%;
}
.textcenter{
text-align: center;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Loading…
Cancel
Save