caishi 6 years ago
commit 049daac232

@ -148,16 +148,30 @@
<!-- 在tpi js里加载这3个脚本 --> <!-- 在tpi js里加载这3个脚本 -->
<script> <script>
(function() { // Scoping function to avoid globals (function() { // Scoping function to avoid globals
var href = location.href; var href = location.href;
if (href.indexOf('/tasks/') != -1) { if(window.location.port === "3007"){
document.write('<script type="text/javascript" src="http://47.96.87.25:48080/assets/kindeditor/kindeditor.js"><\/script>'); if (href.indexOf('/tasks/') != -1) {
// build.js中会将这个url附加一个前缀 react/build document.write('<script type="text/javascript" src="https://newweb.educoder.net/assets/kindeditor/kindeditor.js"><\/script>');
document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>'); // build.js中会将这个url附加一个前缀 react/build
document.write('<script type="text/javascript" src="http://47.96.87.25:48080/javascripts/educoder/edu_application.js"><\/script>'); document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>');
} else if (href.indexOf('/paths/') != -1) { document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
document.write('<script type="text/javascript" src="http://47.96.87.25:48080/javascripts/educoder/edu_application.js"><\/script>'); } else if (href.indexOf('/paths/') != -1) {
document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
}
}
}else{
if (href.indexOf('/tasks/') != -1) {
document.write('<script type="text/javascript" src="/assets/kindeditor/kindeditor.js"><\/script>');
// build.js中会将这个url附加一个前缀 react/build
document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>');
document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>');
} else if (href.indexOf('/paths/') != -1) {
document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>');
}
}
})(); })();
</script> </script>
<!-- <script type="text/javascript" src="https://testeduplus2.educoder.net/assets/kindeditor/kindeditor.js"></script> <!-- <script type="text/javascript" src="https://testeduplus2.educoder.net/assets/kindeditor/kindeditor.js"></script>

@ -2,7 +2,7 @@ import React from "react";
import axios from 'axios'; import axios from 'axios';
import { requestProxy } from "./indexEduplus2RequestProxy"; import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage } from 'educoder' import { broadcastChannelOnmessage ,SetAppModel} from 'educoder';
import { notification } from 'antd'; import { notification } from 'antd';
import './index.css' import './index.css'
broadcastChannelOnmessage('refreshPage', () => { broadcastChannelOnmessage('refreshPage', () => {
@ -10,11 +10,19 @@ broadcastChannelOnmessage('refreshPage', () => {
}) })
function locationurl(list){ function locationurl(list){
if (window.location.port === "3007") { if (window.location.port === "3007") {
} else { } else {
window.location.replace(list)
} if(list===402){
SetAppModel(402)
}else if(list===407){
}else{
window.location.replace(list)
}
}
} }
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
@ -149,7 +157,7 @@ export function initAxiosInterceptors(props) {
debugger debugger
console.log(response.data.status); console.log(response.data.status);
console.log(response.data); console.log(response.data);
locationurl(response.data.message); locationurl(402);
} }

@ -1,8 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'public/react/src/common/educoder';
import { Modal} from 'antd'; import { Modal} from 'antd';
import axios from 'axios'; import axios from 'axios';
import './common.css'; import '../../modules/user/common.css';
//完善个人资料 //完善个人资料
class Notcompleted extends Component { class Notcompleted extends Component {
@ -21,7 +21,7 @@ class Notcompleted extends Component {
render() { render() {
console.log(this.props)
return( return(
<Modal <Modal
keyboard={false} keyboard={false}

@ -0,0 +1,33 @@
import React, { Component } from 'react';
import { Modal } from 'antd';
// import Notcompleted from './Notcompleted';
export function SetAppModel(options = {}) {
return function wrap(WrappedComponent) {
return class Wrapper extends Component {
constructor(props) {
super(props);
this.state = {
}
}
componentDidMount(){
console.log(this.props)
}
render() {
const { titlemessage, Modallisttype, Modallist, singleButton } = this.state;
return (
<div>
{/*<Notcompleted*/}
{/*modalsType={this.state.Notcompleteds}*/}
{/*/>*/}
</div>
)
}
}
}
}

@ -1,53 +1,56 @@
import { from } from '_array-flatten@2.1.2@array-flatten'; import { from } from '_array-flatten@2.1.2@array-flatten';
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; // export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool'; export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC'; export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
export { trigger as trigger, on as on, off as off export { trigger as trigger, on as on, off as off
, broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil'; , broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil';
export { updatePageParams as updatePageParams } from './RouterUtil'; export { updatePageParams as updatePageParams } from './RouterUtil';
export { bytesToSize as bytesToSize } from './UnitUtil'; export { bytesToSize as bytesToSize } from './UnitUtil';
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil' export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
export { isDev as isDev } from './Env' export { isDev as isDev } from './Env'
export { toStore as toStore, fromStore as fromStore } from './Store' export { toStore as toStore, fromStore as fromStore } from './Store'
export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil' export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil'
export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const' , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
export { themes, ThemeContext } from './context/ThemeContext' export { themes, ThemeContext } from './context/ThemeContext'
export { ModalHOC } from './components/ModalHOC' export { ModalHOC } from './components/ModalHOC'
export { default as Cropper } from './components/Cropper'
export { default as ConditionToolTip } from './components/ConditionToolTip' export { SetAppModel } from './components/SetAppModel'
export { default as DragValidator } from './components/DragValidator'
export { default as Cropper } from './components/Cropper'
export { default as PopInstruction } from './components/instruction/PopInstruction' export { default as ConditionToolTip } from './components/ConditionToolTip'
export { default as DragValidator } from './components/DragValidator'
export { default as City } from './components/form/City'
export { default as PopInstruction } from './components/instruction/PopInstruction'
// course export { default as City } from './components/form/City'
export { default as WordsBtn } from './course/WordsBtn'
export { default as ActionBtn } from './course/ActionBtn' // course
export { default as WordsBtn } from './course/WordsBtn'
export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml'
export { default as ActionBtn } from './course/ActionBtn'
export { default as DMDEditor } from './components/markdown/DMDEditor'
export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml'
export { default as DMDEditor } from './components/markdown/DMDEditor'
export { default as ImageLayerHook } from './hooks/ImageLayerHook' export { default as ImageLayerHook } from './hooks/ImageLayerHook'

@ -955,7 +955,7 @@ class Fileslists extends Component{
} }
> >
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" /> <img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂无数据哦~</p></div> <p className="edu-nodata-p mb20">暂无数据哦~</p></div>
</div> </div>

@ -252,7 +252,7 @@ class UseBank extends Component{
<div style={{"height":"230px"}} className="d_middle edu-txt-center"> <div style={{"height":"230px"}} className="d_middle edu-txt-center">
<div> <div>
<p className="font-16 mb20 color-grey-3">通过职业认证的教师才能访问公共题库</p> <p className="font-16 mb20 color-grey-3">通过职业认证的教师才能访问公共题库</p>
<a className="white-btn edu-orangeback-btn" target="_blank" href="/account/professional_certification">立即认证</a> <a className="white-btn edu-orangeback-btn" target="_blank" href="/account/certification">立即认证</a>
</div> </div>
</div> </div>
: :

@ -40,8 +40,8 @@ class coursesHomeCard extends Component{
className="mt80 mb25"/> className="mt80 mb25"/>
<p className="font-14 color-white">非成员不能访问</p> <p className="font-14 color-white">非成员不能访问</p>
</div> </div>
<a href={item.first_category_url} className="square-img" > {/*<a href={item.first_category_url} className="square-img" >*/}
{/*<a href={`/courses/${item.id}/students`} className="square-img" >*/} <a href={`/courses/${item.id}/students`} className="square-img" >
{/*target="_blank"*/} {/*target="_blank"*/}
{ {
item.is_public===1&&item.id===1309? item.is_public===1&&item.id===1309?

@ -949,6 +949,11 @@ kbd,
samp { samp {
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; 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;
} }
/* 表格间距太大 */
.ant-table-tbody>tr>td, .ant-table-thead>tr>th {
padding: 16px 0px;
}
/* FORM START */ /* FORM START */
.ant-form label{ .ant-form label{
/* 为了覆盖antd的样式这里使用了importantTODO */ /* 为了覆盖antd的样式这里使用了importantTODO */

@ -72,7 +72,7 @@ class GraduationTasksappraiseMainEditor extends Component{
} }
clearInputs = () => { clearInputs = () => {
this.setState({ this.setState({
score: 0, score: undefined,
same_score: false, same_score: false,
fileList: [] fileList: []
}) })

@ -772,7 +772,7 @@ class GraduationTasks extends Component{
} }
> >
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" /> <img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂无数据哦~</p></div> <p className="edu-nodata-p mb20">暂无数据哦~</p></div>
</div> </div>

@ -351,8 +351,8 @@ class CoursesNew extends Component {
render() { render() {
let {datatime} = this.state; let {datatime} = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const options = this.state.searchlist.map(d => <Option key={d.name}>{d.name}</Option>); const options = this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
const optionschool = this.state.searchlistscholl.map(z => <Option key={z}>{z}</Option>); const optionschool = this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school) // console.log(this.props.current_user.user_school)
return ( return (
<React.Fragment> <React.Fragment>

@ -1067,7 +1067,6 @@ class Listofworksstudentone extends Component {
} }
} }
let columns2= arr; let columns2= arr;
var teacherlist = undefined;
var teacherlists = undefined; var teacherlists = undefined;
if (teacherdata !== undefined) { if (teacherdata !== undefined) {
// console.log("seacthdata设置数据") // console.log("seacthdata设置数据")
@ -1075,7 +1074,6 @@ class Listofworksstudentone extends Component {
if (teacherdata.id === undefined) { if (teacherdata.id === undefined) {
this.setState({ this.setState({
data: [], data: [],
teacherlist: undefined,
loadingstate: false, loadingstate: false,
styletable: styletable, styletable: styletable,
}) })
@ -1115,10 +1113,6 @@ class Listofworksstudentone extends Component {
// current: this.state.page, // current: this.state.page,
// } // }
styletable = {"display": "block",} styletable = {"display": "block",}
} else {
// console.log("seacthdata设置数据2")
teacherlist = undefined;
} }
} }
@ -1162,7 +1156,6 @@ class Listofworksstudentone extends Component {
this.setState({ this.setState({
data: datalist, data: datalist,
datas: datalists, datas: datalists,
teacherlist: teacherlist,
teacherlists: teacherlists, teacherlists: teacherlists,
loadingstate: false, loadingstate: false,
styletable: styletable, styletable: styletable,
@ -1488,7 +1481,7 @@ class Listofworksstudentone extends Component {
limit:20, limit:20,
} }
axios.post(urll, data).then((result) => { axios.post(urll, data).then((result) => {
// debugger debugger
if (result !== undefined) { if (result !== undefined) {
// console.log(url) // console.log(url)
// console.log("作品列表6789077") // console.log("作品列表6789077")
@ -1583,7 +1576,7 @@ class Listofworksstudentone extends Component {
// 设置数据 // 设置数据
seacthdatat = (teacherdata,student_works,work_efficiency,course_group_info) => { seacthdatat = (teacherdata,student_works,work_efficiency,course_group_info) => {
// debugger debugger
let {page, limit} = this.state; let {page, limit} = this.state;
let datalist = []; let datalist = [];
let columns = this.state.columns; let columns = this.state.columns;
@ -1707,11 +1700,9 @@ class Listofworksstudentone extends Component {
} }
} else { } else {
var teacherlist = undefined;
} }
this.setState({ this.setState({
data: datalist, data: datalist,
teacherlist: teacherlist,
columns: columns2, columns: columns2,
loadingstate: false, loadingstate: false,
}) })
@ -2197,10 +2188,10 @@ class Listofworksstudentone extends Component {
// console.log(this.state.data); // console.log(this.state.data);
// console.log("841"); // console.log("841");
// console.log(this.state.columns); console.log(this.state.columns);
// console.log(data); console.log(data);
// console.log("2202"); console.log("2202");
// console.log(this.props.isAdmin()); console.log(this.props.isAdmin());
return ( return (
this.props.isAdmin() === true ? this.props.isAdmin() === true ?
@ -2337,7 +2328,7 @@ class Listofworksstudentone extends Component {
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTimet}> (this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTimet}>
计算成绩 计算成绩
</div>:""): </div>:""):
teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": teacherdata&&teacherdata.homework_status[0]!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}> (this.props.isNotMember()===false?<div className={"computeTimes font-13"}>
计算成绩 计算成绩
</div>:"") </div>:"")
@ -2628,7 +2619,7 @@ class Listofworksstudentone extends Component {
</div> </div>
:"") :"")
: :
(teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": (teacherdata&&teacherdata.homework_status[0]!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
this.props.isNotMember()===false? this.props.isNotMember()===false?
<div className={"computeTimes font-13"}> <div className={"computeTimes font-13"}>
计算成绩 计算成绩
@ -2793,7 +2784,7 @@ class Listofworksstudentone extends Component {
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTime}> (this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩 计算成绩
</div>:""): </div>:""):
teacherdata&&teacherdata.homework_status[0]=== "未发布"? "": teacherdata&&teacherdata.homework_status[0]!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}> (this.props.isNotMember()===false?<div className={"computeTimes font-13"}>
计算成绩 计算成绩
</div>:"") </div>:"")

@ -229,7 +229,7 @@ class TraineetraininginformationModal extends Component {
<div style={{"clear": "both"}}> <div style={{"clear": "both"}}>
<div className="fl edu-back-white ml10 "> <div className="fl edu-back-white ml10 ">
<img alt="头像" className="radius mt10" height="70" id="nh_user_logo" name="avatar_image" <img alt="头像" className="radius mt10" height="70" id="nh_user_logo" name="avatar_image"
src={this.props.viewtrainingdata === undefined ? "" : "https://www.educoder.net/images/" + `${this.props.viewtrainingdata.image_url}`} src={this.props.viewtrainingdata === undefined ? "" : "/images/" + `${this.props.viewtrainingdata.image_url}`}
width="70"/> width="70"/>
</div> </div>
<div className="fl edu-back-white ml20 mt15"> <div className="fl edu-back-white ml20 mt15">

@ -1202,7 +1202,7 @@ class ShixunHomework extends Component{
} }
> >
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20" <div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src="https://www.educoder.net/images/educoder/nodata.png" /> src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂无数据哦~</p></div> <p className="edu-nodata-p mb20">暂无数据哦~</p></div>
</div> </div>
</Spin> </Spin>

@ -69,11 +69,8 @@ class EducoderInteresse extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
bottom:"0",
position: "fixed"
}}> }}>
<div className="font-14 color-grey-9 " style={{ bottom:"0",position: "absolute",marginBottom: "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 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>
</div> </div>
</div> </div>

@ -157,8 +157,7 @@ class EducoderLogin extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
height: "550px", marginTop: "25px",
marginTop: "44px",
}}> }}>
<div> <div>
@ -173,8 +172,7 @@ class EducoderLogin extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
height: "550px", marginTop: "25px",
marginTop: "44px",
}}> }}>
<div > <div >
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state}
@ -187,11 +185,8 @@ class EducoderLogin extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
bottom:"0",
position: "fixed"
}}> }}>
<div className="font-14 color-grey-9 " style={{ bottom:"0",position: "absolute",marginBottom: "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 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>
</div> </div>
</div> </div>

@ -49,7 +49,7 @@ function get_login_verification_code(btn) {
type = 7; type = 7;
} }
$.get( $.get(
'https://www.educoder.net/account/get_verification_code', '/account/get_verification_code',
{ value: $('#pass_name_input').val().trim(), { value: $('#pass_name_input').val().trim(),
type: type}, type: type},
function (data) { function (data) {
@ -346,10 +346,7 @@ class LoginDialog extends Component {
if(response===undefined){ if(response===undefined){
return return
} }
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if(response.status===200){ if(response.status===200){
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
@ -359,6 +356,10 @@ class LoginDialog extends Component {
description:response.data.message, description:response.data.message,
}); });
}else{ }else{
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
broadcastChannelPostMessage('refreshPage') broadcastChannelPostMessage('refreshPage')
this.setState({ this.setState({
isRender:false isRender:false

@ -38,7 +38,7 @@ class LeftNav extends Component {
<div className="user-info"> <div className="user-info">
<a href="/users/p69243850" alt="用户头像" className="user-info-img"> <a href="/users/p69243850" alt="用户头像" className="user-info-img">
<img alt="0?1442652658" height="50" src="https://www.educoder.net/images/avatars/User/0?1442652658" width="50"/> <img alt="0?1442652658" height="50" src="/images/avatars/User/0?1442652658" width="50"/>
</a> </a>
<a href="/users/p69243850" className="user-info-name">Jimmy</a> <a href="/users/p69243850" className="user-info-name">Jimmy</a>
</div> </div>

@ -82,7 +82,7 @@
margin-left: -154px; margin-left: -154px;
text-align: center; text-align: center;
} }
.inline{ .inlines{
display: inline-block; display: inline-block;
width: auto; width: auto;
line-height: 26px; line-height: 26px;

@ -168,7 +168,7 @@ class TaskResultLayer extends Component {
<i className="far fa-times-circle closeIcon" onClick={closeTaskResultLayer} title="关闭"></i> <i className="far fa-times-circle closeIcon" onClick={closeTaskResultLayer} title="关闭"></i>
<img src={isLastGame? passallImg : passpartImg} width="652px" className="passTaskImg"/> <img src={isLastGame? passallImg : passpartImg} width="652px" className="passTaskImg"/>
<div className="winpPerson expGold"> <div className="winpPerson expGold">
<p className="inline"><span className=" goldring"/> <p className="inline inlines"><span className=" goldring"/>
{currentPassedGameGainGold >= 0 ? `+${currentPassedGameGainGold}` : '+0'} {currentPassedGameGainGold >= 0 ? `+${currentPassedGameGainGold}` : '+0'}
</p> </p>
<p className="inline exp"> <p className="inline exp">

@ -1,383 +1,383 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import IconButton from 'material-ui/IconButton'; import IconButton from 'material-ui/IconButton';
import Tooltip from 'material-ui/Tooltip'; import Tooltip from 'material-ui/Tooltip';
import Button from 'material-ui/Button'; import Button from 'material-ui/Button';
import './CodeEvaluateView.css' import './CodeEvaluateView.css'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import { on, off } from 'educoder' import { on, off } from 'educoder'
const testSetsExpandedArrayInitVal = [false, false, false, false, false, const testSetsExpandedArrayInitVal = [false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false] false, false, false, false, false]
const $ = window.$; const $ = window.$;
const TAB_INDEX_WEB_DISPLAY = 0; const TAB_INDEX_WEB_DISPLAY = 0;
const TAB_INDEX_EVALUATE_RESULT_INDEX = 1 const TAB_INDEX_EVALUATE_RESULT_INDEX = 1
class CodeEvaluateView extends Component { class CodeEvaluateView extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.onEvaluateViewExpand = this.onEvaluateViewExpand.bind(this) this.onEvaluateViewExpand = this.onEvaluateViewExpand.bind(this)
this.state = { this.state = {
// TODO 最多20个测试集 // TODO 最多20个测试集
testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0),
evaluateViewExpanded: false, evaluateViewExpanded: false,
tabIndex: 1, tabIndex: 1,
} }
} }
componentDidMount() { componentDidMount() {
const { challenge } = this.props; const { challenge } = this.props;
on('showWebDisplayEvent', () => { on('showWebDisplayEvent', () => {
if (challenge.isHtml) { if (challenge.isHtml) {
this.setState({ this.setState({
tabIndex: TAB_INDEX_WEB_DISPLAY tabIndex: TAB_INDEX_WEB_DISPLAY
}) })
} }
}) })
if (challenge.isHtml === true) { if (challenge.isHtml === true) {
this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) this.tabIndexChange(TAB_INDEX_WEB_DISPLAY)
} }
} }
componentWillUnmount() { componentWillUnmount() {
off('showWebDisplayEvent') off('showWebDisplayEvent')
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
if (this.props.game && newProps.game && (newProps.game.id !== this.props.game.id if (this.props.game && newProps.game && (newProps.game.id !== this.props.game.id
|| newProps.gameBuilding !== this.props.gameBuilding )) { // 切换game时重置state || newProps.gameBuilding !== this.props.gameBuilding )) { // 切换game时重置state
if (newProps.gameBuilding === false) { if (newProps.gameBuilding === false) {
// 清空codemirror的内容TODO最好调用codemirror的销毁方法 // 清空codemirror的内容TODO最好调用codemirror的销毁方法
$('#evaluating_contents .result_different_show').html('') $('#evaluating_contents .result_different_show').html('')
this.setState({ this.setState({
tabIndex: TAB_INDEX_EVALUATE_RESULT_INDEX tabIndex: TAB_INDEX_EVALUATE_RESULT_INDEX
}) })
} }
this.setState({ this.setState({
testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0),
}) })
if (newProps.game.id !== this.props.game.id) { if (newProps.game.id !== this.props.game.id) {
if (this.props.challenge.isHtml === true) { if (this.props.challenge.isHtml === true) {
this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) this.tabIndexChange(TAB_INDEX_WEB_DISPLAY)
} }
} }
} }
} }
componentDidUpdate(prevProps, prevState, snapshot) { componentDidUpdate(prevProps, prevState, snapshot) {
// 通关后重置为0 // 通关后重置为0
if (!prevProps.currentGamePassed && this.props.currentGamePassed === true) { if (!prevProps.currentGamePassed && this.props.currentGamePassed === true) {
this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) this.tabIndexChange(TAB_INDEX_WEB_DISPLAY)
} }
} }
tabIndexChange(index) { tabIndexChange(index) {
this.setState({tabIndex: index}); this.setState({tabIndex: index});
} }
onTestSetHeaderClick(index) { onTestSetHeaderClick(index) {
const { output_sets, power, game } = this.props; const { output_sets, power, game } = this.props;
const { test_sets_array } = output_sets; const { test_sets_array } = output_sets;
const { testSetsInitedArray } = this.state; const { testSetsInitedArray } = this.state;
// TODO 评测了以后,测试集会变化, // TODO 评测了以后,测试集会变化,
var current_test_set = test_sets_array[index]; var current_test_set = test_sets_array[index];
if (!current_test_set.output) { if (!current_test_set.output) {
current_test_set.output = '' current_test_set.output = ''
} }
// 优化,但是会增加代码复杂度 // 优化,但是会增加代码复杂度
if (( game.test_sets_view === true || power == 1 || current_test_set.is_public == 1 ) && testSetsInitedArray[index] === false ) { // 如果测试集没有初始化过(如果重新评测了,都需要重新初始化) if (( game.test_sets_view === true || power == 1 || current_test_set.is_public == 1 ) && testSetsInitedArray[index] === false ) { // 如果测试集没有初始化过(如果重新评测了,都需要重新初始化)
const id = "result_different_show_" + index; const id = "result_different_show_" + index;
var mv = window.CodeMirror.k_init(id, current_test_set.actual_output || "", current_test_set.output); var mv = window.CodeMirror.k_init(id, current_test_set.actual_output || "", current_test_set.output);
var height=0; var height=0;
// 以前的代码用不了2个pane的高度都是300 // 以前的代码用不了2个pane的高度都是300
// if($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()>$("#"+id).find(".CodeMirror-merge-pane").eq(1).height()){ // if($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()>$("#"+id).find(".CodeMirror-merge-pane").eq(1).height()){
// height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()); // height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(0).height());
// }else{ // }else{
// height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(1).height()); // height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(1).height());
// } // }
var lineNumber = Math.max( current_test_set.output.split('\n').length var lineNumber = Math.max( current_test_set.output.split('\n').length
, (current_test_set.actual_output ? current_test_set.actual_output.split('\n').length : 1 )) , (current_test_set.actual_output ? current_test_set.actual_output.split('\n').length : 1 ))
height = lineNumber * 19 + 25; height = lineNumber * 19 + 25;
console.log('height ', height) console.log('height ', height)
$("#"+id).find(".CodeMirror").height(height); $("#"+id).find(".CodeMirror").height(height);
$(".CodeMirror-merge-gap").find("svg").css("height", height); $(".CodeMirror-merge-gap").find("svg").css("height", height);
// 取真实高度 // 取真实高度
$(".CodeMirror-merge-gap").css("height", $('.CodeMirror-merge-pane.CodeMirror-merge-editor').height()); $(".CodeMirror-merge-gap").css("height", $('.CodeMirror-merge-pane.CodeMirror-merge-editor').height());
setTimeout(()=>{ // 解决第一次打开时高度不准的问题 setTimeout(()=>{ // 解决第一次打开时高度不准的问题
$('#game_test_set_results .CodeMirror-merge').css('display', 'flex') $('#game_test_set_results .CodeMirror-merge').css('display', 'flex')
}, 100) }, 100)
// refresh一下解决CM显示不全的问题 // refresh一下解决CM显示不全的问题
mv.edit.refresh() mv.edit.refresh()
mv.right.orig.refresh() mv.right.orig.refresh()
testSetsInitedArray[index] = true; testSetsInitedArray[index] = true;
} }
this.props.onTestSetHeaderClick(index) this.props.onTestSetHeaderClick(index)
this.setState({ this.setState({
testSetsInitedArray, testSetsInitedArray,
}) })
} }
goToCertification() { goToCertification() {
window.open('/account/professional_certification', '_blank'); window.open('/account/certification', '_blank');
} }
renderTestSets() { renderTestSets() {
const { output_sets, testSetsExpandedArray, power, allowed_unlock, testSetUnlock, showDialog, challenge, game, user } = this.props; const { output_sets, testSetsExpandedArray, power, allowed_unlock, testSetUnlock, showDialog, challenge, game, user } = this.props;
const { testSetsInitedArray } = this.state; const { testSetsInitedArray } = this.state;
const { test_sets_array, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count const { test_sets_array, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count
, had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets; , had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets;
const testSetsComponentArray = [] const testSetsComponentArray = []
if (!test_sets_array) { if (!test_sets_array) {
console.error('no test_sets_array error') console.error('no test_sets_array error')
return '' return ''
} }
test_sets_array.forEach( (item, index) => { test_sets_array.forEach( (item, index) => {
// function toggle_test_case(open, output, actual_output, id, power){ // function toggle_test_case(open, output, actual_output, id, power){
// onclick={toggle_test_case(1, output, actual_output, 0, true)} // onclick={toggle_test_case(1, output, actual_output, 0, true)}
const isExpanded = testSetsExpandedArray[index] const isExpanded = testSetsExpandedArray[index]
let headIconClass = ''; let headIconClass = '';
let _headLockIconClass = ''; let _headLockIconClass = '';
if (item.is_public == 0) { if (item.is_public == 0) {
if (game.test_sets_view === true || power === 1){ if (game.test_sets_view === true || power === 1){
_headLockIconClass = 'fas fa-unlock-alt' _headLockIconClass = 'fas fa-unlock-alt'
} else { } else {
_headLockIconClass = 'fa-lock' _headLockIconClass = 'fa-lock'
} }
} }
if (item.result == true) { if (item.result == true) {
headIconClass = 'fa-check-circle color-light-green font-16' headIconClass = 'fa-check-circle color-light-green font-16'
} else if (item.result == false) { } else if (item.result == false) {
headIconClass = 'fa-exclamation-circle -text-danger' headIconClass = 'fa-exclamation-circle -text-danger'
} }
testSetsComponentArray.push( testSetsComponentArray.push(
<div className="-task-ces-top clearfix" onClick={ this.onTestSetHeaderClick.bind(this, index) } <div className="-task-ces-top clearfix" onClick={ this.onTestSetHeaderClick.bind(this, index) }
style={{cursor:'pointer', 'margin-top':index == 0 ? '4px' : ''}} key={index+'-0'}> style={{cursor:'pointer', 'margin-top':index == 0 ? '4px' : ''}} key={index+'-0'}>
<p className="clearfix"> <p className="clearfix">
<i className={`fa ${ 'fa-caret-right'} mr8 font-16`} <i className={`fa ${ 'fa-caret-right'} mr8 font-16`}
style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i> style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i>
<span className="font-14">测试集 {index + 1}</span> <span className="font-14">测试集 {index + 1}</span>
{ headIconClass && <i className={`fa ${ headIconClass } fr mt2 ml5 font-16`}></i> } { headIconClass && <i className={`fa ${ headIconClass } fr mt2 ml5 font-16`}></i> }
{ _headLockIconClass && <i className={`fa ${ _headLockIconClass } fr mt2 ml5 font-16`}></i> } { _headLockIconClass && <i className={`fa ${ _headLockIconClass } fr mt2 ml5 font-16`}></i> }
{ item.ts_mem && <span className="fr description">消耗内存{item.ts_mem}MB</span> } { item.ts_mem && <span className="fr description">消耗内存{item.ts_mem}MB</span> }
{ item.ts_mem && item.ts_time && <span className="split"></span> } { item.ts_mem && item.ts_time && <span className="split"></span> }
{ item.ts_time && <span className="fr description">代码执行时长{item.ts_time}</span> } { item.ts_time && <span className="fr description">代码执行时长{item.ts_time}</span> }
</p> </p>
</div> </div>
) )
// //
let contentText = (power === 0 && user.is_teacher) ? let contentText = (power === 0 && user.is_teacher) ?
<React.Fragment> <React.Fragment>
<div>{`已经过职业认证的教师可以免金币查看隐藏测试集。`}</div> <div>{`已经过职业认证的教师可以免金币查看隐藏测试集。`}</div>
<div>{`解锁本关所有测试集需要扣除${challenge.score*5}金币,确定要解锁吗?`}</div> <div>{`解锁本关所有测试集需要扣除${challenge.score*5}金币,确定要解锁吗?`}</div>
<div onClick={()=>this.goToCertification()} style={{color: '#4CACFF', cursor: 'pointer', 'text-decoration': 'underline' <div onClick={()=>this.goToCertification()} style={{color: '#4CACFF', cursor: 'pointer', 'text-decoration': 'underline'
, 'margin-top': '12px'}}>立即认证</div> , 'margin-top': '12px'}}>立即认证</div>
</React.Fragment> : </React.Fragment> :
<React.Fragment> <React.Fragment>
<div>{`解锁本关所有测试集需要扣除${challenge.score*5}金币`}</div> <div>{`解锁本关所有测试集需要扣除${challenge.score*5}金币`}</div>
<div>{`确定要解锁吗?`}</div> <div>{`确定要解锁吗?`}</div>
</React.Fragment> </React.Fragment>
const moreButtonsRender = () => { const moreButtonsRender = () => {
return '' return ''
// ${this.props.classes.button} // ${this.props.classes.button}
// return (power === 0 && user.is_teacher) ? ( // return (power === 0 && user.is_teacher) ? (
// <Button variant="raised" style={{ marginRight: '20px'}} className={``} // <Button variant="raised" style={{ marginRight: '20px'}} className={``}
// onClick={()=>this.goToCertification()} color="primary"> // onClick={()=>this.goToCertification()} color="primary">
// { '立即认证' } // { '立即认证' }
// </Button> // </Button>
// ) : '' // ) : ''
} }
testSetsComponentArray.push( testSetsComponentArray.push(
<div className="-task-ces-box mb10 clearfix tabContent" key={index+'-1'}> <div className="-task-ces-box mb10 clearfix tabContent" key={index+'-1'}>
<div className="-task-ces-info" style={ isExpanded ? {display:'block'} : {display:'none'}} id={`test_case_${index}`}> <div className="-task-ces-info" style={ isExpanded ? {display:'block'} : {display:'none'}} id={`test_case_${index}`}>
{ {
(game.test_sets_view === true || power == 1 || item.is_public == 1) ? (game.test_sets_view === true || power == 1 || item.is_public == 1) ?
( (
<React.Fragment> <React.Fragment>
{ item.input ? { item.input ?
<div className="pl20 pb5 -task-testline"> <div className="pl20 pb5 -task-testline">
<div className="clearfix df inputTitle"> <div className="clearfix df inputTitle">
<span className="fl fb color-grey">测试输入</span> <span className="fl fb color-grey">测试输入</span>
<div className="fl color-blue" style={{flex:1}} dangerouslySetInnerHTML={{__html: item.input.replace(/\r\n/g,"</br>")}}></div> <div className="fl color-blue" style={{flex:1}} dangerouslySetInnerHTML={{__html: item.input.replace(/\r\n/g,"</br>")}}></div>
</div> </div>
</div> </div>
: "" } : "" }
<div className="clearfix" className="outputTitle"> <div className="clearfix" className="outputTitle">
<p className="fl with52">- 预期输出 -</p> <p className="fl with52">- 预期输出 -</p>
<p className="fl with48 pl5" style={{boxSizing:'border-box'}}>- 实际输出 -</p> <p className="fl with48 pl5" style={{boxSizing:'border-box'}}>- 实际输出 -</p>
</div> </div>
</React.Fragment> </React.Fragment>
) : ) :
<p className="color-orange -task-testline pl20 " style={{ 'padding-bottom': '8px' }}> <p className="color-orange -task-testline pl20 " style={{ 'padding-bottom': '8px' }}>
{ !allowed_unlock ? '隐藏测试集,暂不支持解锁和查看。' : '此为隐藏测试项。'} { !allowed_unlock ? '隐藏测试集,暂不支持解锁和查看。' : '此为隐藏测试项。'}
{ (power === 0 && allowed_unlock == true) ? <a href="javascript:void(0)" className="color_white test_set_data" { (power === 0 && allowed_unlock == true) ? <a href="javascript:void(0)" className="color_white test_set_data"
onClick={()=>showDialog({ contentText, callback: testSetUnlock , moreButtonsRender})} onClick={()=>showDialog({ contentText, callback: testSetUnlock , moreButtonsRender})}
style={{"textDecoration": "underline"}}>解锁</a> : '' } style={{"textDecoration": "underline"}}>解锁</a> : '' }
</p> </p>
} }
</div> </div>
{/*测试集已解锁||管理员||公开的测试集||TODO应该是全通过时 已通过的测试集*/} {/*测试集已解锁||管理员||公开的测试集||TODO应该是全通过时 已通过的测试集*/}
{ {
(game.test_sets_view == true || power == 1 || item.is_public == 1 || !!item.result === true) ? (game.test_sets_view == true || power == 1 || item.is_public == 1 || !!item.result === true) ?
<div className="result_different_show" id={`result_different_show_${index}`} style={ (!testSetsInitedArray[index] || isExpanded) ? {display:'block'} : {display:'none'}}></div> <div className="result_different_show" id={`result_different_show_${index}`} style={ (!testSetsInitedArray[index] || isExpanded) ? {display:'block'} : {display:'none'}}></div>
: "" : ""
} }
</div> </div>
) )
}) })
return testSetsComponentArray; return testSetsComponentArray;
} }
onEvaluateViewExpand() { onEvaluateViewExpand() {
window.valuation_extend_and_zoom(); window.valuation_extend_and_zoom();
this.setState({ this.setState({
evaluateViewExpanded: !this.state.evaluateViewExpanded evaluateViewExpanded: !this.state.evaluateViewExpanded
}) })
} }
render() { render() {
const { evaluateViewExpanded, tabIndex } = this.state; const { evaluateViewExpanded, tabIndex } = this.state;
const { output_sets, latest_output, record, challenge, gameBuilding, myshixun } = this.props; const { output_sets, latest_output, record, challenge, gameBuilding, myshixun } = this.props;
if (!output_sets) { if (!output_sets) {
return ( return (
<div>loading</div> <div>loading</div>
) )
} }
const { test_sets, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count const { test_sets, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count
, had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets; , had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets;
/* /*
<a href="javascript:void(0);" data-tip-left="展开" className="fr mt10 mr15" onClick={this.onEvaluateViewExpand} id="valuation_extend_and_zoom"> <a href="javascript:void(0);" data-tip-left="展开" className="fr mt10 mr15" onClick={this.onEvaluateViewExpand} id="valuation_extend_and_zoom">
<i className="fa fa-expand font-16 color-grey"></i> <i className="fa fa-expand font-16 color-grey"></i>
</a> </a>
<li className="blacktab_con" onclick="check_tab('blacktab_con','blacktab_hover',this);"> <li className="blacktab_con" onclick="check_tab('blacktab_con','blacktab_hover',this);">
<a href="javascript:void(0);" className="tab_type tab_color">评测信息</a> <a href="javascript:void(0);" className="tab_type tab_color">评测信息</a>
</li> </li>
onclick="check_tab('blacktab_con','blacktab_hover',this);" onclick="check_tab('blacktab_con','blacktab_hover',this);"
*/ */
return ( return (
<React.Fragment> <React.Fragment>
<ul id="blacktab_nav"> <ul id="blacktab_nav">
<li className="blacktab_con undis" > <li className="blacktab_con undis" >
</li> </li>
{ challenge.isHtml ? { challenge.isHtml ?
<li className={`blacktab_con ${ tabIndex === 0 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(0)}> <li className={`blacktab_con ${ tabIndex === 0 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(0)}>
<a href="javascript:void(0);" className="tab_type tab_color">效果显示</a> <a href="javascript:void(0);" className="tab_type tab_color">效果显示</a>
</li> : ''} </li> : ''}
<li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}> <li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type tab_color">测试结果</a> <a href="javascript:void(0);" className="tab_type tab_color">测试结果</a>
</li> </li>
<Tooltip id="tooltip-icon-expand" title={ evaluateViewExpanded ? "收起" : "展开"}> <Tooltip id="tooltip-icon-expand" title={ evaluateViewExpanded ? "收起" : "展开"}>
{/*TODO 按钮大小改造css*/} {/*TODO 按钮大小改造css*/}
<a className="iconButton fr mr15" onClick={this.onEvaluateViewExpand} id="extend_and_zoom" > <a className="iconButton fr mr15" onClick={this.onEvaluateViewExpand} id="extend_and_zoom" >
<i className={ evaluateViewExpanded ? "font-18 iconfont icon-shousuo" : "iconfont icon-zhankai font-18" }></i> <i className={ evaluateViewExpanded ? "font-18 iconfont icon-shousuo" : "iconfont icon-zhankai font-18" }></i>
</a> </a>
</Tooltip> </Tooltip>
<div className="cl"></div> <div className="cl"></div>
</ul> </ul>
<CircularProgress size={40} thickness={3} <CircularProgress size={40} thickness={3}
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: gameBuilding ? 'block': 'none' }}/> style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: gameBuilding ? 'block': 'none' }}/>
<div id="evaluateMiddleStatusText" style={{ <div id="evaluateMiddleStatusText" style={{
marginTop: "4px", marginTop: "4px",
textAlign: "center", textAlign: "center",
color: "#4CACFF", color: "#4CACFF",
display: gameBuilding ? 'block': 'none' display: gameBuilding ? 'block': 'none'
}} }}
></div> ></div>
<div id="game_test_set_results" className="-flex -relative blacktab-inner" <div id="game_test_set_results" className="-flex -relative blacktab-inner"
style={{ display: gameBuilding ? 'none': 'block' }}> style={{ display: gameBuilding ? 'none': 'block' }}>
<React.Fragment> <React.Fragment>
<div id="blacktab_con_1" className="htmlContainer" style={ (challenge.isHtml && tabIndex === 0) ? {display: 'block'} : {display: 'none'} }> <div id="blacktab_con_1" className="htmlContainer" style={ (challenge.isHtml && tabIndex === 0) ? {display: 'block'} : {display: 'none'} }>
<form id="html_form" method="post" target="myFrame" action={`/api/myshixuns/${myshixun.identifier}/html_content.html`}> <form id="html_form" method="post" target="myFrame" action={`/api/myshixuns/${myshixun.identifier}/html_content.html`}>
<input type="hidden" name="contents" id="data_param" value=""></input> <input type="hidden" name="contents" id="data_param" value=""></input>
<input type="hidden" name="educodercss" id="data_css_param" value=""></input> <input type="hidden" name="educodercss" id="data_css_param" value=""></input>
<input type="hidden" name="educoderscript" id="data_js_param" value=""></input> <input type="hidden" name="educoderscript" id="data_js_param" value=""></input>
</form> </form>
<iframe id="htmlIframe" frameBorder="0" name="myFrame" style={{background: '#fff', height: '100%', width: '100%'}} > <iframe id="htmlIframe" frameBorder="0" name="myFrame" style={{background: '#fff', height: '100%', width: '100%'}} >
</iframe> </iframe>
</div> </div>
<div id="blacktab_con_2" className=" " style={ tabIndex === 1 ? {display: 'block'} : {display: 'none'} }> <div id="blacktab_con_2" className=" " style={ tabIndex === 1 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll"> <div className="fit -scroll">
<div className="-layout-v -fit"> <div className="-layout-v -fit">
<div className="-flex -scroll task-padding16 loading-center undis" id="evaluating_ajax_loading"></div> <div className="-flex -scroll task-padding16 loading-center undis" id="evaluating_ajax_loading"></div>
<div className="-flex -scroll task-padding16" id="evaluating_contents"> <div className="-flex -scroll task-padding16" id="evaluating_contents">
{/* {/*
record ? <span className="fr mr5 tab_color">本次评测耗时{ record } </span> : "" record ? <span className="fr mr5 tab_color">本次评测耗时{ record } </span> : ""
*/} */}
{ had_test_count === 0 || test_sets_count == null ? <div></div> : { had_test_count === 0 || test_sets_count == null ? <div></div> :
had_passed_testsests_error_count === test_sets_count ? had_passed_testsests_error_count === test_sets_count ?
<p className="color-light-green mb10 evaluateResult" > <p className="color-light-green mb10 evaluateResult" >
<i className="fa fa-check-circle font-16"></i> <i className="fa fa-check-circle font-16"></i>
<span className="ml5 mr5">{test_sets_count}/{test_sets_count}</span> <span className="ml5 mr5">{test_sets_count}/{test_sets_count}</span>
</p> : </p> :
<p className="-text-danger mb10 evaluateResult"> <p className="-text-danger mb10 evaluateResult">
<i className="fa fa-exclamation-circle font-16"></i> <i className="fa fa-exclamation-circle font-16"></i>
<span className="ml5 mr5 -text-danger">{had_passed_testsests_error_count}/{test_sets_count}</span> <span className="ml5 mr5 -text-danger">{had_passed_testsests_error_count}/{test_sets_count}</span>
{/*.replace(/\\u/gi, '%u') unicode转码 */} {/*.replace(/\\u/gi, '%u') unicode转码 */}
{latest_output ? {latest_output ?
<span dangerouslySetInnerHTML={{__html: latest_output.replace(/\\r/g,'')}}></span> <span dangerouslySetInnerHTML={{__html: latest_output.replace(/\\r/g,'')}}></span>
: ""} : ""}
</p> </p>
} }
{this.renderTestSets()} {this.renderTestSets()}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</React.Fragment> </React.Fragment>
</div> </div>
</React.Fragment> </React.Fragment>
); );
} }
} }
export default CodeEvaluateView; export default CodeEvaluateView;

@ -68,7 +68,7 @@ const styles = MUIDialogStyleUtil.getTwoButtonStyle(
class LeftView extends Component { class LeftView extends Component {
goToCertification() { goToCertification() {
window.open('/account/professional_certification', '_blank'); window.open('/account/certification', '_blank');
} }
// /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88 // /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88
render() { render() {

@ -5,9 +5,10 @@ export function loadSshScript(callback) {
let prefix = 'react/build' let prefix = 'react/build'
if (window.location.port == 3007) { if (window.location.port == 3007) {
prefix = '' prefix = ''
_url_origin = 'https://newweb.educoder.net/';
} else { } else {
// _url_origin = `https://testeduplus2.educoder.net/`; // _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = 'http://47.96.87.25:48080/'; _url_origin = '/';
} }
const $ = window.$; const $ = window.$;
// 未加载过 // 未加载过

@ -1,207 +1,207 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col } from "antd"; import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col } from "antd";
import axios from 'axios'; import axios from 'axios';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
const Option = Select.Option; const Option = Select.Option;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
class sendPanel extends Component{ class sendPanel extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
sentShixunPath:false, sentShixunPath:false,
sendToCourseList:undefined, sendToCourseList:undefined,
openSearch:false, openSearch:false,
sendToCourseId:undefined, sendToCourseId:undefined,
sendToShixunArray:[], sendToShixunArray:[],
shixunNum:0, shixunNum:0,
Modalstype:false, Modalstype:false,
cardsModalcancel:this.cardsModalcancel, cardsModalcancel:this.cardsModalcancel,
cardsModalsave:this.cardsModalsave, cardsModalsave:this.cardsModalsave,
modalsTopval:'', modalsTopval:'',
Modalsbottomval:'', Modalsbottomval:'',
courseurl:'' courseurl:''
} }
} }
//发送至 //发送至
SentToLesson =() =>{ SentToLesson =() =>{
this.setState({ this.setState({
sentShixunPath:true sentShixunPath:true
}) })
} }
//隐藏发送至弹框 //隐藏发送至弹框
hideSenttothevalue =()=>{ hideSenttothevalue =()=>{
this.setState({ this.setState({
sentShixunPath:false sentShixunPath:false
}) })
} }
//打开课堂列表下拉框 //打开课堂列表下拉框
openList=()=>{ openList=()=>{
this.setState({ this.setState({
openSearch:true openSearch:true
}) })
} }
//关闭课堂列表下拉框 //关闭课堂列表下拉框
closeList=()=>{ closeList=()=>{
this.setState({ this.setState({
openSearch:false openSearch:false
}) })
} }
// 选择课堂获取选中的Id // 选择课堂获取选中的Id
selectCloseList=(e)=>{ selectCloseList=(e)=>{
this.setState({ this.setState({
openSearch:false, openSearch:false,
sendToCourseId:e sendToCourseId:e
}) })
} }
//选择checkbox //选择checkbox
changeCheckBoxs=(list)=>{ changeCheckBoxs=(list)=>{
this.setState({ this.setState({
sendToShixunArray:list, sendToShixunArray:list,
shixunNum:list.length shixunNum:list.length
}) })
} }
//确认提交 //确认提交
submitInfo=()=>{ submitInfo=()=>{
let {sendToCourseId,sendToShixunArray}=this.state; let {sendToCourseId,sendToShixunArray}=this.state;
if(sendToCourseId===undefined){ if(sendToCourseId===undefined){
this.props.showSnackbar("您还未选择发送的课堂"); this.props.showSnackbar("您还未选择发送的课堂");
}else if(parseInt(sendToShixunArray.length)==0){ }else if(parseInt(sendToShixunArray.length)==0){
this.props.showSnackbar("您还未选择实训"); this.props.showSnackbar("您还未选择实训");
}else{ }else{
let id=this.props.detailInfoList.id; let id=this.props.detailInfoList.id;
let url="/paths/"+id+"/send_to_course.json"; let url="/paths/"+id+"/send_to_course.json";
axios.post(url,{ axios.post(url,{
shixun_ids:sendToShixunArray, shixun_ids:sendToShixunArray,
course_id:sendToCourseId course_id:sendToCourseId
}).then((result)=>{ }).then((result)=>{
if(result.data.status===1){ if(result.data.status===1){
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
sentShixunPath:false, sentShixunPath:false,
Modalstopval:result.data.message, Modalstopval:result.data.message,
courseurl:result.data.url courseurl:result.data.url
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
} }
} }
componentDidMount(){ componentDidMount(){
let id=this.props.detailInfoList.id; let id=this.props.detailInfoList.id;
let url="/paths/"+id+"/choose_course.json"; let url="/paths/"+id+"/choose_course.json";
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.status==200){ if(result.status==200){
this.setState({ this.setState({
sendToCourseList:result.data sendToCourseList:result.data
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
} }
cardsModalcancel=()=>{ cardsModalcancel=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
} }
cardsModalsave=()=>{ cardsModalsave=()=>{
let {courseurl}=this.state; let {courseurl}=this.state;
window.location.href = "https://www.educoder.net/"+courseurl; window.location.href =courseurl;
} }
render(){ render(){
let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state; let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
return( return(
<div> <div>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={cardsModalsave} modalSave={cardsModalsave}
> >
</Modals> </Modals>
{ {
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true? this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?
<Tooltip placement="bottom" title="以实训作业的形式发送到我的课堂"> <Tooltip placement="bottom" title="以实训作业的形式发送到我的课堂">
<a onClick = {this.SentToLesson} className="user_default_btn edu-greenline-btn fr font-18 mr20"> <a onClick = {this.SentToLesson} className="user_default_btn edu-greenline-btn fr font-18 mr20">
发送至 发送至
</a> </a>
</Tooltip>:'' </Tooltip>:''
} }
<Modal <Modal
keyboard={false} keyboard={false}
title="发送至课堂" title="发送至课堂"
visible={sentShixunPath} visible={sentShixunPath}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
> >
<div className="newupload_conbox"> <div className="newupload_conbox">
<div className="mb20" onMouseLeave={this.closeList}> <div className="mb20" onMouseLeave={this.closeList}>
<Select <Select
placeholder="请选择您要发送的课堂" placeholder="请选择您要发送的课堂"
style={{"width":"100%"}} style={{"width":"100%"}}
onSelect={this.selectCloseList} onSelect={this.selectCloseList}
onMouseEnter={this.openList} onMouseEnter={this.openList}
defaultOpen={false} defaultOpen={false}
open={openSearch} open={openSearch}
optionLabelProp="name" optionLabelProp="name"
> >
{ {
sendToCourseList === undefined ? "": sendToCourseList.courses.map((item,key)=>{ sendToCourseList === undefined ? "": sendToCourseList.courses.map((item,key)=>{
return( return(
<Option key={item.course_id} id={key} name={item.course_name}> <Option key={item.course_id} id={key} name={item.course_name}>
<Row> <Row>
<Col className="fl with70 task-hide">{item.course_name}</Col> <Col className="fl with70 task-hide">{item.course_name}</Col>
<Col className="fl color-grey-9 with30 edu-txt-center">{item.created_at}</Col> <Col className="fl color-grey-9 with30 edu-txt-center">{item.created_at}</Col>
</Row> </Row>
</Option> </Option>
) )
}) })
} }
</Select> </Select>
</div> </div>
<div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5"> <div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5">
<CheckboxGroup onChange={this.changeCheckBoxs}> <CheckboxGroup onChange={this.changeCheckBoxs}>
{ {
sendToCourseList && sendToCourseList.stages.map((item,key)=>{ sendToCourseList && sendToCourseList.stages.map((item,key)=>{
return( return(
item.shixuns.map((items,keys)=>{ item.shixuns.map((items,keys)=>{
return( return(
<div className="mt5" key={keys}> <div className="mt5" key={keys}>
<Checkbox name={key} value={items.shixun_id}>{items.shixun_name}</Checkbox> <Checkbox name={key} value={items.shixun_id}>{items.shixun_name}</Checkbox>
</div> </div>
) )
}) })
) )
}) })
} }
</CheckboxGroup> </CheckboxGroup>
</div> </div>
<p className="color-grey-9 pl15 font-12 mt10">已选择 {shixunNum} 个实训</p> <p className="color-grey-9 pl15 font-12 mt10">已选择 {shixunNum} 个实训</p>
<div className="mt20 clearfix edu-txt-center"> <div className="mt20 clearfix edu-txt-center">
<a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a> <a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a> <a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a>
</div> </div>
</div> </div>
</Modal> </Modal>
</div> </div>
) )
} }
} }
export default SnackbarHOC()(sendPanel); export default SnackbarHOC()(sendPanel);

@ -317,11 +317,11 @@ class NewHeader extends Component {
}) })
if(submitapplicationssum===0){ if(submitapplicationssum===0){
if(submitapplicationsvaluedata!=undefined){ if(submitapplicationsvaluedata!=undefined){
window.location.href = "https://www.educoder.net/courses/"+submitapplicationsvaluedata; window.location.href = "/courses/"+submitapplicationsvaluedata;
} }
}else if(submitapplicationssum===1){ }else if(submitapplicationssum===1){
if(submitapplicationsvaluedata!=undefined){ if(submitapplicationsvaluedata!=undefined){
window.location.href = "https://www.educoder.net/projects/"+submitapplicationsvaluedata; window.location.href = "/projects/"+submitapplicationsvaluedata;
} }
} }
} }
@ -480,7 +480,7 @@ submittojoinclass=(value)=>{
} }
if(value===0){ if(value===0){
let url="https://www.educoder.net/courses/join_course_multi_role.json" let url="/courses/join_course_multi_role.json"
const form = new FormData(); const form = new FormData();
form.append('invite_code', tojoinclasstitle); form.append('invite_code', tojoinclasstitle);
form.append('role', pamst); form.append('role', pamst);
@ -526,7 +526,7 @@ submittojoinclass=(value)=>{
} }
if(value===1){ if(value===1){
let url="https://www.educoder.net/applied_project/applied_project_info.json" let url="/applied_project/applied_project_info.json"
const form = new FormData(); const form = new FormData();
form.append('invite_code', tojoinclasstitle); form.append('invite_code', tojoinclasstitle);
form.append('member', RadioGroupvalue); form.append('member', RadioGroupvalue);

@ -45,7 +45,7 @@ function _initSider() {
return; return;
} }
var $tool = $(this).attr("tooltips"); var $tool = $(this).attr("tooltips");
$descSide.html($tool+"<div><img src='https://www.educoder.net/images/edu_user/jt.png'></div>"); $descSide.html($tool+"<div><img src='/images/edu_user/jt.png'></div>");
$descSide.data('_dom', this) $descSide.data('_dom', this)
$descSide.show().css({ $descSide.show().css({
left:$(this).offset().left - $descSide.width()-30, left:$(this).offset().left - $descSide.width()-30,

@ -18,7 +18,11 @@ import Trialapplication from "../login/Trialapplication";
const $ = window.$; const $ = window.$;
const versionNum = '0001'; const versionNum = '0001';
// let _url_origin = getUrl() // let _url_origin = getUrl()
let _url_origin=`http://47.96.87.25:48080`; let _url_origin='';
if(window.location.port === "3007"){
_url_origin="https://newweb.educoder.net";
}
// let _url_origin=`https://www.educoder.net`; // let _url_origin=`https://www.educoder.net`;
if (!window['indexHOCLoaded']) { if (!window['indexHOCLoaded']) {

@ -865,7 +865,7 @@ class Newshixuns extends Component {
<div className="mb10 edu-back-white"> <div className="mb10 edu-back-white">
<p className="padding10-20 bor-bottom-greyE color-grey-3 clearfix"> <p className="padding10-20 bor-bottom-greyE color-grey-3 clearfix">
<span className="fl font-18 lineh-35">创建实训</span> <span className="fl font-18 lineh-35">创建实训</span>
<a className="fr font-16 mt3 color-blue" href="https://www.educoder.net/forums/2943" <a className="fr font-16 mt3 color-blue" href="/forums/2943"
target="_blank">实训制作指南</a> target="_blank">实训制作指南</a>
</p> </p>

@ -80,7 +80,7 @@ class Repository extends Component {
<input id="rev" name="rev" size="8" type="hidden" value=""></input> <input id="rev" name="rev" size="8" type="hidden" value=""></input>
</form> */} </form> */}
<a href="https://www.educoder.net/forums/2784" target="_blank" <a href="/forums/2784" target="_blank"
className=" guideBtn" >Git使用指南</a> className=" guideBtn" >Git使用指南</a>
<div className="fr font-12 color-grey-9 pr"> <div className="fr font-12 color-grey-9 pr">

@ -42,11 +42,32 @@ class LoginRegisterComponent extends Component {
dragOk: false, dragOk: false,
Whethertoverify:false, Whethertoverify:false,
modalsType:false, modalsType:false,
pciphone:true,
} }
} }
//判断是否是手机端
IsPC=()=> {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = true;//这个意思是说自己的是pc 端
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
componentDidMount = () => {
let pcipns=this.IsPC();
this.setState({
pciphone:pcipns,
})
}
openNotification = (messge) => { openNotification = (messge) => {
notification.open({ notification.open({
message: "提示", message: "提示",
@ -170,13 +191,16 @@ class LoginRegisterComponent extends Component {
}) })
return return
} }
if (this.state.dragOk === false) { if(this.state.pciphone===true){
// this.openNotification(`请拖动滑块完成验证`,2); if (this.state.dragOk === false) {
this.setState({ // this.openNotification(`请拖动滑块完成验证`,2);
Phonenumberisnotcosytdhk:"请拖动滑块完成验证", this.setState({
}) Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
return })
return
}
} }
if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") { if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") {
this.setState({ this.setState({
Phonenumberisnotcosmmm:"密码不能为空", Phonenumberisnotcosmmm:"密码不能为空",
@ -379,9 +403,9 @@ class LoginRegisterComponent extends Component {
return return
} }
} }
//是否验证通过
dragOkCallback = () => { inputOnBlurzhuche = (e)=>{
console.log(this.state.login); if(this.state.pciphone===false) {
if(this.state.login===""||this.state.login.length===0){ if(this.state.login===""||this.state.login.length===0){
this.setState({ this.setState({
Phonenumberisnotco: "账号不能为空", Phonenumberisnotco: "账号不能为空",
@ -394,7 +418,29 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosytdhk:undefined,
}) })
this.Emailphonenumberverification(this.state.login) this.Emailphonenumberverification(e.target.value)
}
}
//是否验证通过
dragOkCallback = () => {
console.log(this.state.login);
if (this.state.login === "" || this.state.login.length === 0) {
this.setState({
Phonenumberisnotco: "账号不能为空",
Phonenumberisnotcobool: true,
dragOk: false,
Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return
}
this.setState({
Phonenumberisnotcosytdhk: undefined,
})
this.Emailphonenumberverification(this.state.login)
} }
//邮箱手机号验证 //邮箱手机号验证
@ -454,6 +500,7 @@ class LoginRegisterComponent extends Component {
readonlyInput, readonlyInput,
codes, codes,
Whethertoverify, Whethertoverify,
pciphone,
} = this.state } = this.state
// height: 346px; // height: 346px;
return ( return (
@ -528,6 +575,7 @@ class LoginRegisterComponent extends Component {
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey} <Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"} className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login} placeholder="输入注册手机号或邮箱" value={this.state.login}
onBlur={(e) => this.inputOnBlurzhuche(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input> onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{ {
Phonenumberisnotco && Phonenumberisnotco !== "" ? Phonenumberisnotco && Phonenumberisnotco !== "" ?
@ -538,7 +586,7 @@ class LoginRegisterComponent extends Component {
} }
{ {
Whethertoverify===false? Whethertoverify===false&&pciphone===true?
<DragValidator <DragValidator
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}} style={{height: "38px", width: "100%"}}
@ -549,7 +597,7 @@ class LoginRegisterComponent extends Component {
} }
{ {
Whethertoverify===true? Whethertoverify===true&&pciphone===true?
<DragValidatortwo <DragValidatortwo
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}} style={{height: "38px", width: "100%"}}
@ -558,13 +606,17 @@ class LoginRegisterComponent extends Component {
: :
"" ""
} }
{ <div>
{pciphone===true?
(
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !=="" ? Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !=="" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosytdhk}</span> <span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p> </p>
: <div style={{height: "25px"}}></div> : <div style={{height: "25px"}}></div>
} )
:""}
</div>
<Input type={classpass} <Input type={classpass}
className={Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"} className={Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges} onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {Button,notification} from 'antd'; import {Button,notification} from 'antd';
import {broadcastChannelPostMessage} from 'educoder'; import {broadcastChannelPostMessage} from 'educoder';
import MyEduCoderModal from './MyEduCoderModal'; import MyEduCoderModal from './MyEduCoderModal';
import Notcompleted from './Notcompleted'; // import Notcompleted from '../../common/Notcompleted';
import axios from 'axios'; import axios from 'axios';
import './common.css'; import './common.css';
import mytc from './img/mytc.png'; import mytc from './img/mytc.png';
@ -31,7 +31,7 @@ class InterestpageComponent extends Component {
passmm:this.props.passmm, passmm:this.props.passmm,
homedatalist:undefined, homedatalist:undefined,
hometypepvisible: undefined, hometypepvisible: undefined,
MyEduCoderModals:false
} }
} }
openNotification = (messge) => { openNotification = (messge) => {
@ -242,16 +242,13 @@ class InterestpageComponent extends Component {
// height: 346px; // height: 346px;
return ( return (
<div className="ysllogin_register_contents" style={{width:"800px",height: "600px"}}> <div className="ysllogin_register_contents" style={{width:"800px",height: "550px"}}>
<MyEduCoderModal <MyEduCoderModal
modalsType={this.state.MyEduCoderModals} modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}} setNotcompleteds={()=>{this.setNotcompleteds()}}
/> />
<Notcompleted
modalsType={this.state.Notcompleteds}
/>
<div className="ysllogin_section"> <div className="ysllogin_section">
<div className="mt15"><span className="yslspans1">请选择你的职业</span></div> <div className="mt15"><span className="yslspans1">请选择你的职业</span></div>
<div className="ysldivhome1" > <div className="ysldivhome1" >
@ -283,7 +280,7 @@ class InterestpageComponent extends Component {
) )
})} })}
</div> </div>
<Button className="yslbutton" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "36px",background: "#4CACFF",marginTop: "30px"} }>完成</Button> <Button className="yslbutton" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "35px",background: "#4CACFF",marginTop: "17px"} }>完成</Button>
</div> </div>
</div> </div>

@ -60,6 +60,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcodmm:undefined, Phonenumberisnotcodmm:undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Whethertoverify:false, Whethertoverify:false,
pciphone:true,
} }
} }
@ -94,11 +95,27 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Phonenumberisnotcodmm:undefined, Phonenumberisnotcodmm:undefined,
Whethertoverify:false, Whethertoverify:false,
pciphone:true,
} }
} }
} }
//判断是否是手机端
IsPC=()=> {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = true;//这个意思是说自己的是pc 端
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
// 点击表单后改变type // 点击表单后改变type
changeType = () => { changeType = () => {
this.setState({classpass: 'password'}); this.setState({classpass: 'password'});
@ -106,17 +123,21 @@ class LoginRegisterComponent extends Component {
componentDidMount = () => { componentDidMount = () => {
// console.log("componentDidUpdate"); // console.log("componentDidUpdate");
// console.log(this.props); // console.log(this.props);
let pcipns=this.IsPC();
if (this.props.match.url === "/login") { if (this.props.match.url === "/login") {
console.log("11111111111111111111111111"); console.log("11111111111111111111111111");
this.state = { this.state = {
tab:["0"], tab:["0"],
pciphone:pcipns,
} }
} else if (this.props.match.url === "/register") { } else if (this.props.match.url === "/register") {
this.state = { this.state = {
tab:["1"], tab:["1"],
pciphone:pcipns,
} }
} }
} }
openNotification = (messge,type) => { openNotification = (messge,type) => {
// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
@ -214,10 +235,7 @@ class LoginRegisterComponent extends Component {
if (response === undefined) { if (response === undefined) {
return return
} }
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if(response.data.status === -2){ if(response.data.status === -2){
if("该手机号尚未注册" || "该邮箱尚未注册"){ if("该手机号尚未注册" || "该邮箱尚未注册"){
this.setState({ this.setState({
@ -246,6 +264,11 @@ class LoginRegisterComponent extends Component {
} }
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if (response.status === 200) { if (response.status === 200) {
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
@ -284,17 +307,20 @@ class LoginRegisterComponent extends Component {
// this.openNotification(`请同意服务协议条款`,2); // this.openNotification(`请同意服务协议条款`,2);
// return; // return;
// } // }
if(this.state.pciphone===true){
if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
})
return
}
}
if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) { if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({ this.setState({
Phonenumberisnotcos:"账号不能为空", Phonenumberisnotcos:"账号不能为空",
}) })
return return
} else if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
})
return
} else if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { } else if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) {
// this.openNotification(`请输入验证码`,2); // this.openNotification(`请输入验证码`,2);
this.setState({ this.setState({
@ -555,6 +581,11 @@ class LoginRegisterComponent extends Component {
this.isCorrectname(e.target.value, id); this.isCorrectname(e.target.value, id);
// this.Emailphonenumberverification(e.target.value, id); // this.Emailphonenumberverification(e.target.value, id);
} }
inputOnBlurzhuche = (e, id) => {
if(this.state.pciphone===false) {
this.Emailphonenumberverification(e.target.value, id);
}
}
//获取登入密码 //获取登入密码
passwordonChange = (e) => { passwordonChange = (e) => {
// console.log(e.target.value); // console.log(e.target.value);
@ -671,6 +702,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcodmm, Phonenumberisnotcodmm,
// 注册 // 注册
readAgreement, readAgreement,
pciphone,
} = this.state } = this.state
// height: 346px; // height: 346px;
if (this.state.seconds === 0) { if (this.state.seconds === 0) {
@ -778,6 +810,7 @@ class LoginRegisterComponent extends Component {
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
onBlur={(e) => this.inputOnBlurzhuche(e, 2)}
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input> style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{ {
Phonenumberisnotcos && Phonenumberisnotcos !== "" ? Phonenumberisnotcos && Phonenumberisnotcos !== "" ?
@ -788,7 +821,7 @@ class LoginRegisterComponent extends Component {
} }
{ {
Whethertoverify===false? Whethertoverify===false&&pciphone===true?
<DragValidator <DragValidator
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px'}}
@ -799,7 +832,7 @@ class LoginRegisterComponent extends Component {
} }
{ {
Whethertoverify===true? Whethertoverify===true&&pciphone===true?
<DragValidatortwo <DragValidatortwo
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px'}}
@ -808,14 +841,21 @@ class LoginRegisterComponent extends Component {
: :
"" ""
} }
{ <div>
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ? {
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}> pciphone===true?
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span> (
</p> Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
: <div style={{height:"25px"}}></div> <p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p>
: <div style={{height:"25px"}}></div>
)
:""
}
</div>
}
<div className="yslbutondls"> <div className="yslbutondls">

@ -40,8 +40,9 @@ class MyEduCoderModal extends Component {
<div className={"tabeltext-alignleft mt10"}><p>欢迎使用EduCoder您可以试用1天</p></div> <div className={"tabeltext-alignleft mt10"}><p>欢迎使用EduCoder您可以试用1天</p></div>
<div className={"tabeltext-alignleft mt10"}><p>超过期限需要经过管理员的授权审核</p></div> <div className={"tabeltext-alignleft mt10"}><p>超过期限需要经过管理员的授权审核</p></div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a> {/*<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a>*/}
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即申请授权</a> {/*<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即申请授权</a>*/}
<a className="task-btn task-btn-orange bth100" onClick={()=>this.modalCancel()}>知道啦</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -424,8 +424,8 @@ class AccountBasic extends Component {
}], }],
})( })(
<RadioGroup> <RadioGroup>
<Radio value="0"></Radio> <Radio value="0" disabled={basicInfo.authentication != 'uncertified'}></Radio>
<Radio value="1"></Radio> <Radio value="1" disabled={basicInfo.authentication != 'uncertified'}></Radio>
</RadioGroup> </RadioGroup>
)} )}
</Form.Item> </Form.Item>

@ -71,7 +71,7 @@
} }
.ysldivhomediv{ .ysldivhomediv{
width: 101px; width: 101px;
height: 147px; height: 130px;
} }
.ysldivhomediv1{ .ysldivhomediv1{
@ -83,7 +83,7 @@
display: flex; display: flex;
flex-direction:column; flex-direction:column;
margin-left: 73px; margin-left: 73px;
margin-top: 8px; margin-top: 5px;
} }
.ysldivhomediv2{ .ysldivhomediv2{
width: 110px; width: 110px;
@ -94,7 +94,7 @@
display: flex; display: flex;
flex-direction:column; flex-direction:column;
margin-left: 73px; margin-left: 73px;
margin-top: 20px; margin-top: 15px;
} }
.ysldivhomedivtxt{ .ysldivhomedivtxt{
width:101px; width:101px;
@ -159,7 +159,7 @@
display: flex; display: flex;
justify-content:center; justify-content:center;
width: 60px; width: 60px;
margin-left: 27px; margin-left: 21px;
} }
.yslgouxuanimg{ .yslgouxuanimg{

@ -63,6 +63,10 @@ class Infos extends Component{
login:this.props.current_user.login login:this.props.current_user.login
}) })
} }
} else {
if (prevProps.match.params.username != this.props.match.params.username) {
this.getInfo(this.props.match.params.username);
}
} }
} }
@ -338,7 +342,7 @@ class Infos extends Component{
to={`/users/${username}/projects`}>项目</Link> to={`/users/${username}/projects`}>项目</Link>
</li> </li>
{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>} {/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
</div> </div>
</div> </div>

@ -45,7 +45,8 @@ class SearchPage extends Component{
} }
this.setState({ this.setState({
tab:e.key, tab:e.key,
type:types type:types,
page:1,
}) })
this.getdata(1,types,this.state.keywords); this.getdata(1,types,this.state.keywords);
} }
@ -228,7 +229,7 @@ class SearchPage extends Component{
<div className="mt20"> <div className="mt20">
<span className="ziticor"><i className="fa fa-user ziticor"></i><span>{item.author_name}</span></span><span className="ml10 ziticor "><span>{item.author_school_name}</span></span> <span className="ml20 ziticor"><i className="iconfont icon-shixunguanqia ziticor"></i><span>:<span className="ml10 ziticor">{item.challenges_count===undefined?0:item.challenges_count}</span></span></span> <span className="ml20 ziticor"><i className="iconfont icon-chengyuan ziticor"></i><span>:<span className="ml10 ziticor">{item.study_count===undefined?0:item.study_count}</span></span></span> <span className="ziticor"><i className="fa fa-user ziticor"></i><span className="ml10">{item.author_name}</span></span><span className="ml10 ziticor "><span>{item.author_school_name}</span></span> <span className="ml20 ziticor"><i className="iconfont icon-shixunguanqia ziticor"></i><span>:<span className="ml10 ziticor">{item.challenges_count===undefined?0:item.challenges_count}</span></span></span> <span className="ml20 ziticor"><i className="iconfont icon-chengyuan ziticor"></i><span>:<span className="ml10 ziticor">{item.study_count===undefined?0:item.study_count}</span></span></span>
</div> </div>
</div> </div>

@ -125,4 +125,5 @@
} }
.ziticor{ .ziticor{
color: #777777; color: #777777;
font-size: 13px;
} }
Loading…
Cancel
Save