杨树林 5 years ago
commit 913f519161

@ -29,7 +29,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
devtool: "source-map", // 开启调试
devtool: "eval", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -35,6 +35,10 @@
.editormd .CodeMirror-linenumbers {
padding: 0;
}
.editormd-html-preview hr, .editormd-preview-container hr {
/* 颜色加深 */
border-top: 1px solid #ccc;
}
/* 重置掉antd的一些样式 */
html, body {

@ -110,6 +110,11 @@ const CoursesIndex = Loadable({
loader: () => import('./modules/courses/Index'),
loading: Loading,
})
const SearchPage = Loadable({
loader: () => import('./search/SearchPage'),
loading: Loading,
})
// 课堂讨论
// const BoardIndex = Loadable({
// loader: () => import('./modules/courses/boards/BoardIndex'),
@ -329,8 +334,15 @@ class App extends Component {
{/*实训课程(原实训路径)*/}
<Route path="/paths" component={ShixunPaths}></Route>
<Route path="/search"
render={
(props)=>(<SearchPage {...this.props} {...props} {...this.state}></SearchPage>)
}
></Route>
{/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props}></Route>
{/* 课堂讨论 */}
{/* <Route path="/board" component = {BoardIndex} {...this.props}></Route> */}
@ -340,6 +352,7 @@ class App extends Component {
{/* <Route path="/myshixuns/:shixunId/stages/:stageId" component={Index}/> */}
{/* 兴趣页面*/}
{/*<Route path="/interest" component={Interestpage}/>*/}
<Route path="/comment" component={CommentComponent}/>
<Route path="/testMaterial" component={TestMaterialDesignComponent}/>
<Route path="/test" component={TestIndex}/>

@ -1719,6 +1719,10 @@ const options = [{
label: '其他'
}],
}];
function filter(inputValue, path) {
return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
}
class City extends Component{
constructor(props){
super(props);
@ -1739,11 +1743,16 @@ class City extends Component{
}
}
render(){
const { defaultValue } = this.props
const { defaultValue, matchInputWidth, className, popupClassName } = this.props
const { value } = this.state
// 这里用请选择所在省市的话会触发chrome的地址选择
return(
<Cascader allowClear size="large" options={options} placeholder="请选择所在省市" onChange={this.onChange}
<Cascader allowClear size="large" options={options} placeholder="请选择所在地" onChange={this.onChange}
matchInputWidth={matchInputWidth}
value={value}
showSearch={{ filter }}
className={className}
popupClassName={popupClassName}
></Cascader>
)
}

@ -50,3 +50,4 @@ export { default as DMDEditor } from './components/markdown/DMDEditor'
export { default as ImageLayerHook } from './hooks/ImageLayerHook'

@ -0,0 +1,48 @@
import React, { useState, useEffect, memo } from 'react';
import ImageLayer from '../../modules/page/layers/ImageLayer';
import { isImageExtension } from 'educoder';
const $ = window.$;
function ImageLayerHook(props) {
const [showImage, setShowImage] = useState(false)
const [imageSrc, setImageSrc] = useState('')
const { parentSel, childSel, watchPropsArray } = props
const onImageLayerClose = () => {
setShowImage(false)
setImageSrc('')
}
const onDelegateClick = (event) => {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim()
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG' || imageSrc.indexOf('base64,') != -1) {
// 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
setShowImage(true)
setImageSrc(imageSrc)
}
event.stopPropagation()
event.preventDefault && event.preventDefault()
event.originalEvent.preventDefault()
// event.originalEvent.stopPropagation()
// event.originalEvent.cancelBubble = true
return false;
}
}
useEffect(() => {
$(parentSel)
.delegate(childSel, "click", onDelegateClick);
return () => {
$(parentSel).undelegate(childSel, "click", onDelegateClick )
}
})
return (
<ImageLayer showImage={showImage} imageSrc={imageSrc} onImageLayerClose={onImageLayerClose}></ImageLayer>
)
}
export default memo(ImageLayerHook)

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

@ -905,7 +905,7 @@ class Fileslists extends Component{
isAdmin={this.props.isAdmin()}
isStudent={this.props.isStudent()}
isNotMember={this.props.isNotMember()}
checkBox={this.props.isAdmin()?<Checkbox value={item.id}></Checkbox>:""}
checkBox={this.props.isAdmin()?<Checkbox value={item.id} key={item.id}></Checkbox>:""}
Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()}

@ -428,7 +428,7 @@ class Boards extends Component{
<BoardsListItem
{...this.props}
discussMessage={item}
checkBox={ isAdmin ? <Checkbox value={item.id}></Checkbox> : ''}
checkBox={ isAdmin ? <Checkbox value={item.id} key={item.id}></Checkbox> : ''}
onItemClick={this.onItemClick}
onSticky={this.onSticky}
></BoardsListItem>

@ -135,14 +135,13 @@ class CommonWorkItem extends Component{
<div className="workList_Item">
{
mainList && isAdmin &&
<span className="fl mr12"><Checkbox value={item.homework_id}></Checkbox></span>
<span className="fl mr12"><Checkbox value={item.homework_id} key={item.homework_id}></Checkbox></span>
}
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20">
{/* 放开点击进入进入后弹框canNotLink ? () => {} : */}
<a title={item.name}
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'normal' : 'poninter'}}
onClick={() => this.onItemClick(item)}
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'default' : 'poninter'}}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</a>
{/* 只有非课堂成员且作业是私有的情况下才会为true */}

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

@ -119,7 +119,7 @@ class AccessoryModal2 extends Component{
}
}
Saves=()=>{
debugger
// debugger
let {fileList,description} =this.state;
let newfileList=[];
for(var list of fileList){

@ -59,7 +59,7 @@ class Associationmodel extends Component{
goback=()=>{
debugger
// debugger
this.setState({
Modalstype:false,
})
@ -70,7 +70,7 @@ class Associationmodel extends Component{
setSaves=()=>{
debugger
// debugger
let {projectvalue}=this.state;
let taskid=this.props.taskid;
let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json";

@ -11,7 +11,10 @@ class PathModal extends Component{
Searchvalue:undefined,
type:'all',
page:1,
patheditarry:undefined
patheditarry:undefined,
newshixunmodallist:undefined,
hometypepvisible: false,
shixunmodallist:undefined,
}
}
@ -19,14 +22,78 @@ class PathModal extends Component{
this.props.hidecouseShixunModal()
}
componentDidMount(){
this.setState({
hometypepvisible: true,
patheditarry: [],
checkBoxValues: [],
})
let coursesId = this.props.match.params.coursesId;
let url = "/courses/" + coursesId + "/homework_commons/subjects.json";
axios.get(url).then((result) => {
if (result.status === 200) {
this.setState({
shixunpath: true,
shixunmodallist: result.data,
hometypepvisible: false,
newshixunmodallist: result.data.subject_list,
})
}
}).catch((error) => {
console.log(error);
})
}
funshixunpathlist=(search,type,loading,page)=>{
let{newshixunmodallist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunmodallist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.subject_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunpath:true,
shixunmodallist:result.data,
newshixunmodallist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//tag
changeTag=(types)=>{
let {Searchvalue}=this.state;
this.setState({
type:types,
page:1,
newshixunmodallist:undefined
})
this.props.funshixunpathlist(Searchvalue,types,true,1)
this.funshixunpathlist(Searchvalue,types,true,1)
}
//搜索
@ -40,7 +107,7 @@ class PathModal extends Component{
this.setState({
page:1,
})
this.props.funshixunpathlist(value,type,true,1)
this.funshixunpathlist(value,type,true,1)
}
@ -59,7 +126,7 @@ class PathModal extends Component{
let {Searchvalue,type,page,shixunpathlist}=this.state;
let newpage=page+1
this.props.funshixunpathlist(Searchvalue,type,true,newpage)
this.funshixunpathlist(Searchvalue,type,true,newpage)
this.setState({
page:newpage
})
@ -69,19 +136,24 @@ class PathModal extends Component{
}
//提交
savecouseShixunModal=()=>{
this.setState({
hometypepvisible:true
})
let {patheditarry}=this.state;
let {coursesId,Coursename,page,order,category_id,datas}=this.props;
let {coursesId}=this.props;
let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json";
if(patheditarry===undefined){
this.setState({
patheditarrytype:true,
patheditarryvalue:"请先选择实践课程"
patheditarryvalue:"请先选择实践课程",
hometypepvisible:false
})
return
}else if(patheditarry.length===0){
this.setState({
patheditarrytype:true,
patheditarryvalue:"请先选择实践课程"
patheditarryvalue:"请先选择实践课程",
hometypepvisible:false
})
return
}
@ -114,14 +186,16 @@ class PathModal extends Component{
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
// }
this.setState({
hometypepvisible:false
})
}).catch((error) => {
console.log(error)
})
}
render(){
let {Searchvalue,type,Modalstype}=this.state;
let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props;
let {Searchvalue,type,Modalstype,newshixunmodallist,hometypepvisible,shixunmodallist}=this.state;
let {visible}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
@ -164,7 +238,7 @@ class PathModal extends Component{
<span className="fl color-grey-9 font-16 mt3">
<span></span>
<span className="color-orange-tip">{shixunmodallist === undefined ? "":shixunmodallist.subjects_count}</span>
<span>个实</span>
<span>个实践课程</span>
</span>
<div className="fr search-new">
<Search
@ -200,6 +274,7 @@ class PathModal extends Component{
style={{"Height":"204px"}}>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
newshixunmodallist&&newshixunmodallist.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
@ -236,4 +311,4 @@ class PathModal extends Component{
)
}
}
export default PathModal;
export default PathModal;

@ -6,6 +6,7 @@ import axios from'axios';
const Option = Select.Option;
const Search = Input.Search;
class ShixunModal extends Component{
constructor(props){
super(props);
@ -13,13 +14,69 @@ class ShixunModal extends Component{
Searchvalue:undefined,
type:'all',
category_id:0,
page:1
page:1,
shixunmodallist:undefined,
hometypepvisible:false,
newshixunmodallist:undefined,
}
}
componentDidMount() {
this.setState({
hometypepvisible:true,
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
shixunmodallist:result.data,
hometypepvisible:false,
newshixunmodallist:result.data.shixun_list,
})
}
}).catch((error)=>{
console.log(error);
})
}
setupdatalist=(search,type,loading,page)=>{
let{newshixunmodallist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunmodallist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.shixun_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunmodallist:result.data,
newshixunmodallist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//勾选实训
shixunhomeworkedit=(list)=>{
@ -43,16 +100,13 @@ class ShixunModal extends Component{
contentViewScrolledit=(e)=>{
//滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
let {Searchvalue,type,page}=this.state;
let newpage=page+1
this.props.funshixunmodallist(Searchvalue,type,true,newpage)
this.setState({
page:newpage
})
let {Searchvalue,type,page}=this.state;
let newpage=page+1
this.setupdatalist(Searchvalue,type,true,newpage)
this.setState({
page:newpage
})
}
}
@ -69,7 +123,7 @@ class ShixunModal extends Component{
page:1,
})
this.props.funshixunmodallist(value,type,true,1)
this.setupdatalist(value,type,true,1)
this.props.funpatheditarry([])
}
@ -79,9 +133,10 @@ class ShixunModal extends Component{
this.setState({
type:types,
page:1,
newshixunmodallist:undefined
})
this.props.funshixunmodallist(Searchvalue,types,true,1)
this.setupdatalist(Searchvalue,types,true,1)
this.props.funpatheditarry([])
}
@ -91,17 +146,24 @@ class ShixunModal extends Component{
}
savecouseShixunModal=()=>{
this.setState({
hometypepvisible:true
})
let {coursesId,patheditarry,datas}=this.props;
let{category_id}=this.state;
if (this.props.chooseShixun) {
this.props.chooseShixun(patheditarry)
this.setState({
hometypepvisible:false
})
return;
}
if(patheditarry.length===0){
this.setState({
shixunmodelchke:true,
chekicmessage:"请先选择实训"
chekicmessage:"请先选择实训",
hometypepvisible:false
})
return
@ -119,7 +181,9 @@ class ShixunModal extends Component{
this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.props.hidecouseShixunModal()
}
this.setState({
hometypepvisible:false
})
// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch((error) => {
@ -133,8 +197,8 @@ class ShixunModal extends Component{
})
}
render(){
let {Searchvalue,type,category_id}=this.state;
let {visible,shixunmodallist,hometypepvisible,newshixunmodallist,patheditarry}=this.props;
let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state;
let {visible,patheditarry}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// console.log(patheditarry)
return(
@ -205,7 +269,7 @@ class ShixunModal extends Component{
`
}
</style>
<div className="clearfix mb10 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<div className="clearfix mb10 shixun_work_div newshixun_tab_div cdefault" id="shixun_tab_div">
<li className="fl mr5 mt5">
<a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a>
@ -277,6 +341,9 @@ class ShixunModal extends Component{
width: 11%;
box-sizing: border-box;
}
.pl12{
padding-left: 12px;
}
`
}
</style>
@ -298,7 +365,7 @@ class ShixunModal extends Component{
</li>
<li className="fl with25 edu-txt-left task-hide paddingl5">{item.school}</li>
<li className="fl with11 paddingl10">{item.myshixuns_count}</li>
<li className="fl with11 color-orange-tip paddingl10">{item.level}</li>
<li className="fl with11 color-orange-tip paddingl10 pl12">{item.level}</li>
<Tooltip title="新窗口查看详情">
<li className="fl with11"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</Tooltip>
@ -311,7 +378,7 @@ class ShixunModal extends Component{
</div>
</div>
</Spin>
{this.state.shixunmodelchke===true?<span className={"color-red"}>{this.state.chekicmessage}</span>:""}
<span className={this.state.shixunmodelchke===true?"none":"color-red"}>{this.state.chekicmessage}</span>
<div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>

@ -560,7 +560,7 @@ class Exercise extends Component{
{...this.state}
item={item}
key={key}
checkBox={<Checkbox value={item.id}
checkBox={<Checkbox value={item.id} key={item.id}
// onClick={() => this.onItemClick(item)}
></Checkbox>}
></ExerciseListItem>

@ -86,7 +86,7 @@ class Exercisestatisticalresult extends Component {
page:pageNumber
})
debugger
// debugger
$('html').animate({
scrollTop: 10
}, 1000);

@ -122,6 +122,11 @@ class GraduationTasksSubmitedit extends Component{
let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
}
if (info.file.status === 'done') {
let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
}
}
//onAttachmentRemove = (file) => {
@ -393,7 +398,7 @@ class GraduationTasksSubmitedit extends Component{
// console.log(fileList);
if(values.description===undefined||values.description===""){
this.scrollToAnchor("valuestypes");
debugger
// debugger
return
}
if(workslist.task_type===2){

@ -117,10 +117,17 @@ class GraduationTasksSubmitnew extends Component{
}
// 附件相关 START
handleChange = (info) => {
debugger
if (info.file.status === 'uploading') {
let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
}
if (info.file.status === 'done') {
let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
}
}
onAttachmentRemove = (file) => {
@ -358,7 +365,7 @@ class GraduationTasksSubmitnew extends Component{
//公用数据
Commoninterface = (fileList,selectmemberslist,workslist)=>{
debugger
// debugger
let userids=[];
for(var list of selectmemberslist){
@ -384,7 +391,7 @@ class GraduationTasksSubmitnew extends Component{
// console.log(fileList);
if(values.description===undefined||values.description===""){
this.scrollToAnchor("valuestypes");
debugger
// debugger
return
}
if(workslist&&workslist.task_type===2){
@ -460,7 +467,7 @@ class GraduationTasksSubmitnew extends Component{
//确认
hidestartshixunsreplace=()=>{
debugger
// debugger
let {fileList,selectmemberslist,workslist}=this.state;
this.Commoninterface(fileList,selectmemberslist,workslist);

@ -145,7 +145,7 @@ class GraduationTasksedit extends Component{
}
onAttachmentRemove = (file) => {
debugger
// debugger
this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`

@ -37,7 +37,7 @@ class GraduationTasks extends Component{
}
}
fetchAll = (search,page,order,count) => {
debugger
// debugger
const cid = this.props.match.params.coursesId
@ -554,7 +554,7 @@ debugger
}
// 题库选用成功后刷新页面
useBankSuccess=(checkBoxValues,object_ids)=>{
debugger
// debugger
let {search,page,order,all_count} = this.state;
this.fetchAll(search,page,order,all_count)
}
@ -730,7 +730,7 @@ debugger
isAdmin={this.props.isAdmin()}
isStudent={this.props.isStudent()}
isNotMember={this.props.isNotMember()}
checkBox={this.props.isAdmin()?<Checkbox value={item.task_id}></Checkbox>:""}
checkBox={this.props.isAdmin()?<Checkbox value={item.task_id} key={item.task_id}></Checkbox>:""}
// onItemClick={this.onItemClick}
// onSticky={this.onSticky}
funlist={()=>this.fetchAll(search,page,order)}

@ -411,7 +411,7 @@ onBoardsNew=()=>{
{...this.props}
discussMessage={item}
data={data}
checkBox={<Checkbox value={item.id} onClick={() => this.onItemClick(item)} className="mr15"></Checkbox>}
checkBox={<Checkbox value={item.id} key={item.id} onClick={() => this.onItemClick(item)} className="mr15"></Checkbox>}
onItemClick={this.onItemClick}
index={index}
chooseTopic={this.chooseTopic}

@ -1,4 +1,4 @@
import React, { useState, useEffect, useRef, memo } from 'react'
import React, { useState, useEffect, useRef, useMemo } from 'react'
import { trigger } from 'educoder'
import { Input, Checkbox } from "antd";
import CourseGroupChooser from '../CourseGroupChooser'
@ -105,4 +105,4 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
</ModalWrapper>
)
}
export default memo(CourseGroupChooserModal)
export default useMemo(CourseGroupChooserModal)

@ -17,19 +17,6 @@ import DownloadMessageysl from "../../modals/DownloadMessageysl";
import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search;
const dataSource = [{
check:<Checkbox></Checkbox>,
id: <span className="color-grey-6">1</span>,
name: <a href="javascript:void(0)"className="color-grey-3">胡莎莎</a>,
StuNo: <span className="color-grey-9">32</span>,
classes: <span className="color-grey-3 task-hide classesName">西湖区湖底公园1号</span>
}, {
check:<Checkbox></Checkbox>,
id: <span className="color-grey-6">2</span>,
name: <a href="javascript:void(0)"className="color-grey-3">胡莎莎</a>,
StuNo: <span className="color-grey-9">32</span>,
classes: <span className="color-grey-3 task-hide classesName">西湖区湖底公园2号</span>
}];
const buildColumns = (that) => {
const { course_groups } = that.state
@ -100,7 +87,7 @@ const buildColumns = (that) => {
dataIndex: 'check',
key: 'check',
render: (text, item) => {
return <Checkbox value={item.course_member_id}></Checkbox>
return <Checkbox value={item.course_member_id} key={item.course_member_id} ></Checkbox>
},
width:"5%"
})
@ -280,6 +267,7 @@ class studentsList extends Component{
}
componentDidUpdate(prevProps) {
if (prevProps.match.params.course_group_id != this.props.match.params.course_group_id) {
this.setState({checkBoxValues: []})
this.fetchAll(1)
}
// 加载了2次

@ -667,7 +667,7 @@ class studentsList extends Component{
`}</style>
<div className="mt20 edu-back-white padding20 teacherList">
{ course_groups && course_groups.length && <CourseGroupChooserModal
{ course_groups && !!course_groups.length && <CourseGroupChooserModal
props={{match: this.props.match, showNotification: this.props.showNotification}}
record={this.state.clickRecord}
fetchAll={this.fetchAll}

@ -40,6 +40,8 @@ class CoursesNew extends Component {
}
componentDidMount() {
let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school;
@ -85,7 +87,13 @@ class CoursesNew extends Component {
this.Searchvalue("")
}
componentDidUpdate(prevProps){
if(prevProps.current_user!=this.props.current_user){
if(this.props.current_user.user_identity==="学生"){
window.location.href ="/403"
}
}
}
onChangeTimepublishs = (date, dateString) => {
if(dateString===""){
this.setState({

@ -115,7 +115,7 @@ class PollDetailTabForthRules extends Component{
}
//修改发布规则里面的发布时间
changeRulePublishTime=(e,date,index)=>{
debugger
// debugger
let arr=Object.assign({}, this.state.rules[parseInt(index)]);
arr.publish_time=date=== ""?"":moment(handleDateString(date)).format("YYYY-MM-DD HH:mm");
if(!arr.end_time){

@ -71,13 +71,13 @@ class PollDetailTabThird extends Component{
<p className="pl30 pr30 pt30 pb15 font-16 clearfix">
<span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> }
{ item.question.question_type == 2 ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项"
}
</span>:""
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项"
}
</span>:""
}
</p>
<li className="pl30 pr30 pb15">{item.question.question_title}</li>

@ -382,7 +382,7 @@ class PollInfo extends Component{
<div className="pl30 pr30 mt30 mb10 clearfix">
<span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5"></span> }
{ item.question.question_type == 2 ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -22,8 +22,10 @@ class PollListItem extends Component{
const IsAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
const isNotMember = this.props.isNotMember();
const isAdminOrStudent = this.props.isAdminOrStudent();
let t= item.end_time ? moment(item.end_time) - moment() : 0;
let canNotLink = !isAdminOrStudent && item.lock_status == 0
return(
<div className="workList_Item polllisthover" style={{padding:"30px"}}>
@ -35,7 +37,9 @@ class PollListItem extends Component{
}
<div className="flex1 pr">
<p className="clearfix mb30">
<Link to={`/courses/${coursesId}/polls/${item.id}/detail`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</Link>
{ canNotLink ? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px", "cursor": "default"}} title={item.polls_name}>{item.polls_name}</a> :
<Link to={`/courses/${coursesId}/polls/${item.id}/detail`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</Link>
}
{
item.lock_status === 0 ?
<Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`}>

@ -1411,7 +1411,7 @@ class Listofworksstudentone extends Component {
// }
this.setState({
page: e.current,
teacherlists: teacherlists
// teacherlists: teacherlists
})
}

@ -27,7 +27,7 @@ import '../css/members.css'
import "../common/formCommon.css"
import '../css/Courses.css'
import './style.css'
import ShixunModal from "../coursesPublic/ShixunModal";
class TraineetraininginformationModal extends Component {
constructor(props) {

@ -454,20 +454,6 @@ class ShixunHomework extends Component{
checkBoxValues:[]
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
shixunmodallist:result.data,
hometypepvisible:false,
newshixunmodallist:result.data.shixun_list,
})
}
}).catch((error)=>{
console.log(error);
})
}
@ -477,24 +463,10 @@ class ShixunHomework extends Component{
this.setState({
hometypepvisible:true,
patheditarry:[],
checkBoxValues:[]
checkBoxValues:[],
shixunpath: true,
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
shixunpath:true,
shixunpathlist:result.data,
hometypepvisible:false,
newshixunpathlist:result.data.subject_list,
})
}
}).catch((error)=>{
console.log(error);
})
}
@ -508,116 +480,80 @@ class ShixunHomework extends Component{
})
}
funshixunmodallist=(search,type,loading,page)=>{
let{newshixunmodallist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunmodallist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.shixun_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunmodal:true,
shixunmodallist:result.data,
newshixunmodallist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
funshixunpathlist=(search,type,loading,page)=>{
let{newshixunpathlist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunpathlist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.subject_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunpath:true,
shixunpathlist:result.data,
newshixunpathlist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
funshixunpathlist=(search,type,loading,page)=>{
let{newshixunpathlist}=this.state;
let newshixunmodallists=[]
if(page>1){
newshixunmodallists=newshixunpathlist;
}
this.setState({
hometypepvisible:loading
})
let coursesId=this.props.match.params.coursesId;
let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
// funshixunmodallist=(search,type,loading,page)=>{
// let{newshixunmodallist}=this.state;
// let newshixunmodallists=[]
// if(page>1){
// newshixunmodallists=newshixunmodallist;
// }
// this.setState({
// hometypepvisible:loading
// })
// let coursesId=this.props.match.params.coursesId;
// let url ="/courses/"+coursesId+"/homework_commons/shixuns.json";
//
// axios.get(url, {
// params: {
// search: search,
// type:type,
// page:page
// }
// }).then((result)=>{
// if(result.status===200){
//
// let shixun_list=result.data.shixun_list;
// for(var i=0; i<shixun_list.length;i++){
// newshixunmodallists.push(shixun_list[i])
// }
// this.setState({
// shixunmodal:true,
// shixunmodallist:result.data,
// newshixunmodallist:newshixunmodallists,
// hometypepvisible:false
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
axios.get(url, {
params: {
search: search,
type:type,
page:page
}
}).then((result)=>{
if(result.status===200){
let shixun_list=result.data.subject_list;
for(var i=0; i<shixun_list.length;i++){
newshixunmodallists.push(shixun_list[i])
}
this.setState({
shixunpath:true,
shixunpathlist:result.data,
newshixunpathlist:newshixunmodallists,
hometypepvisible:false
})
}
}).catch((error)=>{
console.log(error);
})
}
// funshixunpathlist=(search,type,loading,page)=>{
// let{newshixunpathlist}=this.state;
// let newshixunmodallists=[]
// if(page>1){
// newshixunmodallists=newshixunpathlist;
// }
// this.setState({
// hometypepvisible:loading
// })
// let coursesId=this.props.match.params.coursesId;
// let url ="/courses/"+coursesId+"/homework_commons/subjects.json";
//
// axios.get(url, {
// params: {
// search: search,
// type:type,
// page:page
// }
// }).then((result)=>{
// if(result.status===200){
//
// let shixun_list=result.data.subject_list;
// for(var i=0; i<shixun_list.length;i++){
// newshixunmodallists.push(shixun_list[i])
// }
// this.setState({
// shixunpath:true,
// shixunpathlist:result.data,
// newshixunpathlist:newshixunmodallists,
// hometypepvisible:false
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
PaginationCourse=(pageNumber)=>{
let {Coursename,order}=this.state;
@ -1012,13 +948,16 @@ class ShixunHomework extends Component{
course_groups={course_groups}
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""}
{/*选择实训*/}
{shixunmodal===true?<ShixunModal
{...this.props}
{...this.state}
datas={datas}
category_id={this.props.match.params.category_id}
visible={shixunmodal}
shixunmodallist={shixunmodallist}
funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
// funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
newshixunmodallist={newshixunmodallist}
@ -1027,6 +966,7 @@ class ShixunHomework extends Component{
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
patheditarry={patheditarry}
/>:""}
{shixunmodal===true||shixunpath===true?<style>
{
`
@ -1038,11 +978,13 @@ class ShixunHomework extends Component{
</style>:""}
{/*选择实训路径*/}
{shixunpath===true? <PathModal
{...this.props}
{...this.state}
datas={datas}
visible={shixunpath}
shixunmodallist={this.state.shixunpathlist}
newshixunmodallist={this.state.newshixunpathlist}
funshixunpathlist={(search,type,loading,page)=>this.funshixunpathlist(search,type,loading,page)}
// funshixunpathlist={(search,type,loading,page)=>this.funshixunpathlist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
coursesId={this.props.match.params.coursesId}

@ -232,7 +232,7 @@ class ShixunsHome extends Component {
<p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"章节"}>
<span className="mr10 fl squareIconSpan">
<i className="iconfont icon-zhangjie fl mr3 iconfontzhangjie"></i>{item.stages_count}
<i className="iconfont icon-zhangjie1 fl mr3 iconfontzhangjie"></i>{item.stages_count}
</span>
</Tooltip>

@ -72,7 +72,8 @@ class EducoderLogin extends Component {
showbool: 3,
logini:3,
namezh:"",
passmm:""
passmm:"",
loginstatus:true,
}
}else {
if(props.match.url === "/login"){
@ -98,8 +99,8 @@ class EducoderLogin extends Component {
showbool: 1,
logini:1,
namezh:"",
passmm:""
passmm:"",
loginstatus:true,
}
}
@ -162,7 +163,7 @@ class EducoderLogin extends Component {
<div>
<LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={(e,name,pass)=>this.Setshowbool(e,name,pass)} ></LoginRegisterComponent>
Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent>
</div>

@ -7,7 +7,7 @@ import Dialog, {
DialogContentText,
DialogTitle,
} from 'material-ui/Dialog';
import {notification } from 'antd';
import axios from 'axios';
@ -346,10 +346,19 @@ class LoginDialog extends Component {
if(response===undefined){
return
}
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if(response.status===200){
if (response.data.status === 402) {
window.location.href = response.data.url;
}else{
}else if (response.data.status === -2) {
notification.open({
message: '提示',
description:response.data.message,
});
}else{
broadcastChannelPostMessage('refreshPage')
this.setState({
isRender:false

@ -33,6 +33,8 @@ class Trialapplication extends Component {
user_phone_binded: props.user_phone_binded,
showTrial: false,
user: undefined,
borredss:"bor-reds",
borredssz:"bor-reds fl mr5",
}
//user_phone_binded 判断是否手机号验证
// console.log("Trialapplication");
@ -371,7 +373,7 @@ class Trialapplication extends Component {
//执行view
render() {
let {login, codes, reason, isRenders, user_phone_binded, Phonenumberisnotco, getverificationcodes, Phonenumberisnotcocodes, Phonenumberisnotcoreason, seconds} = this.state;
let {login, codes, reason, isRenders, user_phone_binded,borredss,borredssz, Phonenumberisnotco, getverificationcodes, Phonenumberisnotcocodes, Phonenumberisnotcoreason, seconds} = this.state;
// console.log("Trialapplication22222222");
// console.log(this.props);
@ -600,12 +602,13 @@ class Trialapplication extends Component {
onChange={this.loginInputonChange}
onBlur={(e) => this.inputOnBlur(e)}
style={{"height": "38px",}}
className={Phonenumberisnotco && Phonenumberisnotco !== ""?borredss:""}
name="myiphone"
></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span style={{textAlign:"left"}}>{Phonenumberisnotco}</span>
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span >{Phonenumberisnotco}</span>
</p>
: <div style={{height: "20px"}}></div>
}
@ -617,7 +620,9 @@ class Trialapplication extends Component {
user_phone_binded === true ? "" :
<div style={{"display": "flex", "justify-content": "center"}}>
<Input className="fl mr5" name="codes" type="text" autoComplete="off"
<Input
className={Phonenumberisnotcocodes && Phonenumberisnotcocodes !== ""?borredssz:"fl mr5"}
name="codes" type="text" autoComplete="off"
readonly
onfocus="this.removeAttribute('readonly')" style={{
"width": "316px",
@ -644,7 +649,7 @@ class Trialapplication extends Component {
"height": "38px",
}} type="primary"
onClick={() => this.getverificationcode()}
size={"large"}>验证码</Button>
size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 " style={{
"background": "#4cacff!important",
@ -661,8 +666,8 @@ class Trialapplication extends Component {
{
Phonenumberisnotcocodes && Phonenumberisnotcocodes != "" ?
<p className="color-red " style={{width: " 100%", height: "20px"}}>
<span style={{textAlign:"left"}}>{Phonenumberisnotcocodes}</span>
<p className="color-red " style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span >{Phonenumberisnotcocodes}</span>
</p>
: <div style={{height: "20px"}}></div>
}
@ -672,12 +677,13 @@ class Trialapplication extends Component {
}}>
<Input placeholder="请在此输入推荐人信息或申请理由" value={reason}
onChange={this.loginInputonChanges}
className={Phonenumberisnotcoreason && Phonenumberisnotcoreason !== ""?borredss:""}
style={{"height": "38px",}}
name="mynames"></Input>
{
Phonenumberisnotcoreason && Phonenumberisnotcoreason != "" ?
<p className="color-red" style={{width: " 100%", height: "20px"}}>
<span style={{textAlign:"left"}}>{Phonenumberisnotcoreason}</span>
Phonenumberisnotcoreason && Phonenumberisnotcoreason !== "" ?
<p className="color-red" style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span >{Phonenumberisnotcoreason}</span>
</p>
: <div style={{height: "20px"}}></div>
}
@ -689,6 +695,7 @@ class Trialapplication extends Component {
"width": "120px",
"text-align": "center",
"height": "38px",
marginTop: "10px",
}}
size={"large"}>提交申请</Button>

@ -112,4 +112,19 @@
}
#evaluating_contents .-text-danger{
padding-bottom: 6px;
}
}
.-task-ces-top .description {
color: #616B77;
padding: 0 8px;
font-size: 12px;
}
.-task-ces-top .split {
border-right: 1px solid #616B77;
width: 1px;
display: inline-block;
height: 10px;
margin: 5px 0;
float: right;
}

@ -172,7 +172,7 @@ class CodeEvaluateView extends Component {
} else if (item.result == false) {
headIconClass = 'fa-exclamation-circle -text-danger'
}
testSetsComponentArray.push(
<div className="-task-ces-top clearfix" onClick={ this.onTestSetHeaderClick.bind(this, index) }
style={{cursor:'pointer', 'margin-top':index == 0 ? '4px' : ''}} key={index+'-0'}>
@ -180,8 +180,13 @@ class CodeEvaluateView extends Component {
<i className={`fa ${ 'fa-caret-right'} mr8 font-16`}
style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i>
<span className="font-14">测试集 {index + 1}</span>
{ headIconClass && <i className={`fa ${ headIconClass } 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 && item.ts_time && <span className="split"></span> }
{ item.ts_time && <span className="fr description">代码执行时长{item.ts_time}</span> }
</p>
</div>

@ -228,7 +228,7 @@ class DetailCards extends Component{
isSpin:true,
})
axios.get(url).then((response) => {
debugger
// debugger
if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);

@ -118,22 +118,23 @@ function loadHeader(){
function header_search(reactHeaderComponnet){
console.log(old_url)
var keyword = $("input[name='search_keyword']").val(); // 搜索关键字
if (!reactHeaderComponnet) {
reactHeaderComponnet = window._header_componentHandler
}
if (!reactHeaderComponnet) {
var index = $("#search_type").val(); // 搜索课程/项目
keyword = encodeURIComponent(keyword);
// $.get('/users/search_shixuns_or_course',
// { search: keyword,
// index: index});
window.location.href = old_url+"/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
window.location.href ="/search"+"?value="+keyword;
// if (!reactHeaderComponnet) {
// reactHeaderComponnet = window._header_componentHandler
// }
// if (!reactHeaderComponnet) {
// var index = $("#search_type").val(); // 搜索课程/项目
// keyword = encodeURIComponent(keyword);
// // $.get('/users/search_shixuns_or_course',
// // { search: keyword,
// // index: index});
// window.location.href = old_url+"/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
//e.stopPropagation();//阻止冒泡
} else {
window.__headSearchKeyword = keyword
reactHeaderComponnet.props.history.push(`/shixuns`)
trigger('searchKeywordChange', keyword)
}
// } else {
// window.__headSearchKeyword = keyword
// reactHeaderComponnet.props.history.push(`/shixuns`)
// trigger('searchKeywordChange', keyword)
// }
}
//头部导航条的隐藏
function closeSearch(){
@ -169,8 +170,8 @@ class NewHeader extends Component {
RadioGroupvalue:undefined,
submitapplications:false,
isRender:false,
isRenders:false,
showTrial:false,
// isRenders:false,
// showTrial:false,
}
// console.log("176")
// console.log(props);
@ -382,12 +383,14 @@ class NewHeader extends Component {
header_search(this)
}
onKeywordSearchKeyDown = (e) => {
let code = e.keyCode;
window.location.href ="/search?value="+e.target.value;
// let code = e.keyCode;
if(code == 13) {
header_search(this);
return false;
}
// if(code == 13) {
// header_search(this);
// return false;
// }
}
hideAddcoursestypes=()=>{
@ -547,13 +550,13 @@ submittojoinclass=(value)=>{
}
}
trialapplications =()=>{
console.log("点击了")
this.setState({
isRenders: true,
showTrial:true,
})
}
// trialapplications =()=>{
// console.log("点击了")
// this.setState({
// isRenders: true,
// showTrial:true,
// })
// }
// 关闭
cancelModulationModels = () => {
@ -618,20 +621,21 @@ submittojoinclass=(value)=>{
{/* :""*/}
{/*}*/}
isRenders&&isRenders===true?
<Trialapplication
{...this.state}
Cancel={() => this.cancelModulationModels()}
/>
:""
}
{/*{*/}
{/* isRenders&&isRenders===true?*/}
{/* <Trialapplication*/}
{/* {...this.state}*/}
{/* Cancel={() => this.cancelModulationModels()}*/}
{/* />*/}
{/* :""*/}
{/*}*/}
<Trialapplication {...this.state} Cancel={() => this.cancelModulationModels()} ></Trialapplication>
<div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">
<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img>
</a>
<div className="head-nav pr" style={{width:'716px'}}>
<div className="head-nav pr">
<ul id="header-nav">
{/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
@ -703,10 +707,11 @@ submittojoinclass=(value)=>{
style={{display: 'none'}}
>
<Search
placeholder="搜索"
placeholder="实践课程/翻转课堂/开发社区/交流问答"
// onSearch={value => console.log(value)}
onPressEnter={this.onKeywordSearchKeyDown}
style={{ width: 258 }}
style={{ width: 295 }}
/>
</div>
@ -756,7 +761,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
{/*<li><Link to={`/interest`}>兴趣页</Link></li>*/}
<li className="bor-top-greyE">
@ -787,7 +792,7 @@ submittojoinclass=(value)=>{
<div className="edu-menu-list" style={{top: '60px',width:"240px"}}>
<div className="overPart"></div>
<ul className="fl with50 edu-txt-center pr ul-leftline">
<li><Link to={"/courses/new"}>新建课堂</Link></li>
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<li><Link to={"/courses/new"}>新建课堂</Link></li>}
<li><a href="/shixuns/new">新建实训</a></li>
<li><a href={this.props.Headertop===undefined?"":"/paths/new"}>新建实践课程</a></li>
<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.new_project_url} target="_blank">新建项目</a></li>

@ -188,3 +188,7 @@ body>.-task-title {
.HeaderSearch .ant-input-search .ant-input{
color: #fff;
}
.HeaderSearch .ant-input-search .ant-input-suffix{
background: transparent !important;
}

@ -161,7 +161,20 @@ function updatamakedown(id){
}, 200)
}
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: () => [0, 60],
};
}
export default class TPMsettings extends Component {
constructor(props) {
super(props)
@ -1307,7 +1320,7 @@ export default class TPMsettings extends Component {
<div className="width15 fl mr20"
// onMouseLeave={operateauthority?this.bigopens:""}
>
<Select placeholder="请更新主类别" value={choice_main_type === "" ? undefined : choice_main_type}
<Select placeholder="请选择主类别" value={choice_main_type === "" ? undefined : choice_main_type}
style={{width: 180}}
onChange={operateauthority?this.bigClass:""}
// onMouseEnter={this.bigopen}
@ -1822,10 +1835,11 @@ export default class TPMsettings extends Component {
<span className="fl mt5">
<DatePicker
showToday={false}
showTime
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
width={178}
locale={locale}
format={dateFormat}
disabledTime={disabledDateTime}
placeholder="请选择开启时间"
value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
onChange={this.onChangeTimePicker}

@ -339,7 +339,7 @@ export default class TPMchallengesnew extends Component {
}
if(exec_time===null||exec_time===undefined||exec_time===""){
debugger
this.setState({
shixunExec_timeType:false
})

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
import {SnackbarHOC} from 'educoder';
import {SnackbarHOC,handleDateString} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd';
@ -146,6 +146,21 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback) {
return editorName;
}
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: () => [0, 60],
};
}
class Newshixuns extends Component {
constructor(props) {
@ -182,6 +197,10 @@ class Newshixuns extends Component {
testcoderunmode:undefined,
file:undefined,
deleteisnot:true,
languagewritetype:false,
systemenvironmenttype:false,
testcoderunmodetype:false,
attachmentidstype:false
}
}
@ -501,21 +520,26 @@ class Newshixuns extends Component {
// })
// }
if(languagewrite === undefined || languagewrite === "" ){
this.props.showNotification(`请填写该镜像是基于什么语言`);
// this.props.showNotification(`请填写该镜像是基于什么语言`);
this.setState({
languagewritetype:true
})
return
}
if(systemenvironment === undefined || systemenvironment === ""){
this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
// this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
this.setState({
systemenvironmenttype:true
})
return;
}
if(testcoderunmode === undefined || testcoderunmode === "") {
this.props.showNotification(`请填写该镜像中测试代码运行方式`);
// this.props.showNotification(`请填写该镜像中测试代码运行方式`);
this.setState({
testcoderunmodetype:true
})
return;
}
var attachment_ids=undefined;
if (this.state.fileList) {
@ -523,17 +547,20 @@ class Newshixuns extends Component {
return item.response ? item.response.id : item.id
})
}
debugger
if( attachment_ids === undefined || attachment_ids.length===0){
notification.open(
{
message: '提示',
description:
'请上传附件!',
if( attachment_ids === undefined || attachment_ids.length===0){
}
)
// notification.open(
// {
// message: '提示',
// description:
// '请上传附件!',
//
// }
// )
this.setState({
attachmentidstype:true
})
return;
}
// console.log("attachment_ids"+attachment_ids);
@ -669,7 +696,7 @@ class Newshixuns extends Component {
onChangeTimePicker = (value, dateString) => {
this.setState({
TimePickervalue: dateString
TimePickervalue: handleDateString(dateString)
})
}
// 附件相关 START
@ -892,7 +919,7 @@ class Newshixuns extends Component {
<div className="width15 fl mr20"
// onMouseLeave={this.bigopens}
>
<Select placeholder="请更新主类别"
<Select placeholder="请选择主类别"
style={{width: 180}}
onChange={this.bigClass}
// onMouseEnter={this.bigopen}
@ -926,38 +953,41 @@ class Newshixuns extends Component {
>
{/*<Form onSubmit={this.handleSubmit}>*/}
<div>
<li className="clearfix mb15 ml85" >
<li className="clearfix ml85" >
<label className="fl mt10 "><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150"
style={{width:'89%'}}
style={{width:'89%',height:'100px'}}
onInput={this.setlanguagewrite}
value={languagewrite}
placeholder="请填写该镜像是基于什么语言示例Python"
id="demand_info"></textarea>
</li>
<li className="clearfix mb15">
<div className={"color-red shixunspanred"}>{this.state.languagewritetype===true?"请填写该镜像语言":""}</div>
<li className="clearfix">
<label className="panel-form-label fl ml50"><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150 "
onInput={this.setsystemenvironment}
style={{height:'100px'}}
value={systemenvironment}
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea>
</li>
<li className="clearfix mb15">
<div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}</div>
<li className="clearfix">
<label className="fl mt10" ><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150 "
onInput={this.settestcoderunmode}
value={testcoderunmode}
style={{height:'100px'}}
placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea>
</li>
<li className="clearfix mb15 ml50">
<div className={"color-red shixunspanred"}>{this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}</div>
<li className="clearfix ml50">
<label className="panel-form-label fl mt-5"><span
className="color-red fl">*</span>&nbsp;&nbsp;</label>
<div className="mt10" style={{
@ -972,14 +1002,14 @@ class Newshixuns extends Component {
{
deleteisnot=== true?
<Upload {...uploadProps} >
<Icon type="upload" className="fl mt5" > </Icon>
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-blue fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
:
<Upload {...uploadProps} disabled={true} >
<Icon type="upload" className="fl mt5" > </Icon>
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-grey-c fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
@ -992,15 +1022,15 @@ class Newshixuns extends Component {
</div>
</li>
<div className={"color-red shixunspanred"}>
{this.state.attachmentidstype===true?"请上传附件":""}
</div>
<li className="edu-txt-center clearfix ">
<Form.Item>
<a className="pop_close task-btn mr30 mb30 mt35"
<a className="pop_close task-btn mr30"
onClick={() => this.sendhideModaly()}
>取消</a>
<Button type="primary" onClick={()=>this.sendsure_apply()}
className="task-btn task-btn-orange mb30 mt35">确定</Button>
</Form.Item>
className="task-btn task-btn-orange">确定</Button>
</li>
<div className="cl"></div>
</div>
@ -1203,10 +1233,12 @@ class Newshixuns extends Component {
showToday={false}
showTime
locale={locale}
showTime={{ format: 'HH:mm' }}
style={{"width": "184px"}}
format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm"
placeholder="请选择开启时间"
onChange={this.onChangeTimePicker}
disabledTime={disabledDateTime}
/>
<label style={{top: '6px'}} className="color-grey-6 ml10">
为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战

@ -376,4 +376,9 @@ a.white-btn.use_scope-btn:hover{
color:#FFF !important;
}
.shixunspanred{
margin-left: 142px;
margin-top: 5px;
margin-bottom: 5px;
}

@ -79,6 +79,22 @@ class AccountPage extends Component {
.accountPage {
display: flex;
}
.basicFormWrap{
flex:1;
width: 0;
}
/* 左侧 */
.accountNav {
width: 290px;
box-shadow: 0px 4px 9px 0px rgba(11,62,120,0.21);
border-radius: 2px;
padding-top: 8px;
padding-bottom: 30px;
margin-bottom:30px;
margin-right:20px;
height:418px;
}
`}</style>
<AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap">

@ -3,9 +3,13 @@ import React, {Component} from 'react';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import {getImageUrl, DragValidator} from 'educoder';
import DragValidatortwo from '../../../src/common/components/DragValidatortwo'
import {Tabs, Input, Checkbox, Button, notification} from 'antd';
import DragValidatortwo from '../../../src/common/components/DragValidatortwo'
import ReadPassword from './ReadPassword';
import axios from 'axios';
import './common.css'
@ -26,13 +30,19 @@ class LoginRegisterComponent extends Component {
seconds: 35,
codes: "",
getverificationcodes: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
Phonenumberisnotco: undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosmmm: undefined,
Phonenumberisnotcosymmmm:undefined,
Phonenumberisnotcosyzm:undefined,
s: 'text',
classpass: "text",
readonlyInput: true,
dragOk: false,
Whethertoverify:false,
modalsType:false,
}
}
@ -148,29 +158,67 @@ class LoginRegisterComponent extends Component {
Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) {
this.openNotification("请输入正确的手机号或邮箱");
this.setState({
Phonenumberisnotco:"请输入正确的邮箱或手机号",
})
return
}
}
if (this.state.login === undefined || this.state.login === "") {
this.openNotification(`请输入登录手机号码或邮箱`);
if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") {
this.setState({
Phonenumberisnotco:"账号不能为空",
})
return
}
if (this.state.password === undefined || this.state.password === "") {
this.openNotification(`请输入密码`);
if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
})
return
}
if (this.state.passwords === undefined || this.state.passwords === "") {
this.openNotification(`请输入密码`);
if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") {
this.setState({
Phonenumberisnotcosmmm:"密码不能为空",
})
return
}
if (this.state.password !== this.state.passwords) {
this.openNotification(`两次密码不相同`);
if (this.state.passwords === undefined || this.state.passwords.length ===0 || this.state.passwords === "") {
this.setState({
Phonenumberisnotcosymmmm:"二次密码不能为空"
})
return
}
if (this.state.codes === undefined || this.state.codes === "") {
this.openNotification(`请输入验证码`);
if (this.state.password !== this.state.passwords==="") {
this.openNotification(`两次输入的密码不一致`);
return
}
else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length<8){
this.setState({
Phonenumberisnotcosmmm:"密码不能少于8位",
})
return
} else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length>16){
this.setState({
Phonenumberisnotcosmmm:"密码不能超过16位",
})
return
}
else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length<8){
this.setState({
Phonenumberisnotcosymmmm:"二次密码不能少于8位",
})
return
} else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length>16){
this.setState({
Phonenumberisnotcosymmmm:"二次密码不能超过16位",
})
return
}
if (this.state.codes === undefined|| this.state.codes.length ===0 || this.state.codes === "") {
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空"
})
return
}
var url = "/accounts/reset_password.json";
@ -182,8 +230,30 @@ class LoginRegisterComponent extends Component {
}).then((result) => {
// console.log(result);
//登录成功会生成session
this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login"
if(result){
if(result.data.status===-2){
if(result.data.message==="验证码不正确"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else if(result.data.message==="验证码已失效"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else {
this.openNotification(result.data.message);
return;
}
}else {
this.setState({
modalsType:true
})
}
}
}).catch((error) => {
})
@ -227,6 +297,7 @@ class LoginRegisterComponent extends Component {
}
this.setState({
password: stirngt,
Phonenumberisnotcosmmm:undefined,
})
}
@ -241,13 +312,15 @@ class LoginRegisterComponent extends Component {
}
this.setState({
passwords: stirngt,
Phonenumberisnotcosymmmm:undefined,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
codes: e.target.value,
Phonenumberisnotcosyzm:undefined,
})
}
inputOnBlur = (e) => {
@ -309,6 +382,18 @@ class LoginRegisterComponent extends Component {
//是否验证通过
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)
}
@ -351,7 +436,6 @@ class LoginRegisterComponent extends Component {
render() {
const {
activeKey,
// 登录
autoLogin,
// 注册
@ -363,6 +447,10 @@ class LoginRegisterComponent extends Component {
seconds,
getverificationcodes,
Phonenumberisnotco,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosmmm,
Phonenumberisnotcosymmmm,
Phonenumberisnotcosyzm,
readonlyInput,
codes,
Whethertoverify,
@ -371,6 +459,11 @@ class LoginRegisterComponent extends Component {
return (
<div className="login_register_content" style={{height: "520px"}}>
<ReadPassword
modalsType={this.state.modalsType}
StudyMakeMoney={()=>this.StudyMakeMoney()}
/>
<Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"}
@ -433,11 +526,11 @@ class LoginRegisterComponent extends Component {
</style>
{/*onBlur={(e) => this.inputOnBlur(e)}*/}
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={"loginInputzhuche"}
className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
Phonenumberisnotco && Phonenumberisnotco !== "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotco}</span>
</p>
@ -465,21 +558,43 @@ class LoginRegisterComponent extends Component {
:
""
}
{
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !=="" ?
<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>
}
<Input type={classpass}
className={"loginInputzhuche"}
className={Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width: "100%", height: "38px", marginTop: '25px'}}
value={this.state.password} style={{width: "100%", height: "38px"}}
placeholder="输入8~16位密码区分大小写"></Input>
{
Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosmmm}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<Input type={classpass}
className={"loginInputzhuche"}
className={Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height: "38px", marginTop: '25px', width: "100%"}}
style={{height: "38px", width: "100%"}}
placeholder="再次输入新密码"></Input>
{
Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosymmmm}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<div className="yslbutondls">
<div className={"mt25"}>
<Input className="fl mr5 loginInputzhuche" type="text" autoComplete="off" style={{
<Input className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
type="text" autoComplete="off" style={{
width: "210px",
height: "38px",
}} placeholder="请输入验证码"
@ -489,16 +604,16 @@ class LoginRegisterComponent extends Component {
</Input>
{
getverificationcodes === undefined ?
<Button className="fl ml5 " disabled
<Button className=" ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 "
<Button className=" ml5 "
style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 "
<Button className=" ml5 "
style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
@ -507,9 +622,17 @@ class LoginRegisterComponent extends Component {
</div>
<Button className="login_btn" size={"large"} type="primary"
style={{height: "46px"}}
onClick={this.Retrievepassword}>完成</Button>
{
Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<Button size={"large"} type="primary"
style={{height:"46px", width: "100%",marginBottom:"26px"}}
onClick={this.Retrievepassword}>完成</Button>
</div>
</div>

@ -1,8 +1,10 @@
import React, {Component} from 'react';
import {Button,notification} from 'antd';
import {broadcastChannelPostMessage} from 'educoder';
import MyEduCoderModal from './MyEduCoderModal';
import Notcompleted from './Notcompleted';
import axios from 'axios';
import './common.css'
import './common.css';
import mytc from './img/mytc.png';
import skzbdx from './img/skzbdx.png';
import zyrs1 from './img/zyrs1.png';
@ -155,6 +157,12 @@ class InterestpageComponent extends Component {
}
setMyEduCoderModals=()=>{
this.setState({
MyEduCoderModals:true
})
}
//兴趣页面点击
Interestcompletionpage(){
if(this.state.gouxuans.length === 0){
@ -179,7 +187,8 @@ class InterestpageComponent extends Component {
}).then((response) => {
if (response !== undefined) {
// this.Jumptotheinterestpage();
window.location.href = "/"
// window.location.href = "/"
this.setMyEduCoderModals()
}
@ -218,6 +227,13 @@ class InterestpageComponent extends Component {
// console.log(error);
// })
// }
setNotcompleteds=()=>{
this.setState({
Notcompleteds:true,
MyEduCoderModals:false
})
}
render() {
const {
gouxuans,
@ -228,6 +244,14 @@ class InterestpageComponent extends Component {
<div className="ysllogin_register_contents" style={{width:"800px",height: "600px"}}>
<MyEduCoderModal
modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>
<Notcompleted
modalsType={this.state.Notcompleteds}
/>
<div className="ysllogin_section">
<div className="mt15"><span className="yslspans1">请选择你的职业</span></div>
<div className="ysldivhome1" >

@ -23,6 +23,9 @@ const loginInputsyl = {
class LoginRegisterComponent extends Component {
constructor(props) {
super(props)
//
// console.log("LoginRegisterComponent");
// console.log("29");
// console.log(props.loginstatus);
@ -30,7 +33,6 @@ class LoginRegisterComponent extends Component {
// console.log(props.loginstatus);
this.state = {
tab:["0"],
activeKey: 0,
classpass: "text",
// 登录
passopens: passoff,
@ -51,6 +53,11 @@ class LoginRegisterComponent extends Component {
codes: "",
Phonenumberisnotco: undefined,
Phonenumberisnotcos: undefined,
Phonenumberisnotcosyzm:undefined,
Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcodmm:undefined,
Phonenumberisnotcobool: false,
Whethertoverify:false,
@ -60,7 +67,6 @@ class LoginRegisterComponent extends Component {
// console.log(props.loginstatus);
this.state = {
tab:["1"],
activeKey: '1',
classpass: "text",
// 登录
passopens: passoff,
@ -81,7 +87,12 @@ class LoginRegisterComponent extends Component {
codes: "",
Phonenumberisnotco: undefined,
Phonenumberisnotcos: undefined,
Phonenumberisnotcosyzm:undefined,
Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false,
Phonenumberisnotcodmm:undefined,
Whethertoverify:false,
}
@ -100,12 +111,10 @@ class LoginRegisterComponent extends Component {
this.state = {
tab:["0"],
}
this.onTabChange('0');
} else if (this.props.match.url === "/register") {
this.state = {
tab:["1"],
}
this.onTabChange('1');
}
}
@ -121,7 +130,6 @@ class LoginRegisterComponent extends Component {
}
;
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(3);
// this.props.Setlogins(3);
@ -135,8 +143,6 @@ class LoginRegisterComponent extends Component {
}
onTabChange = (activeKey) => {
console.log("onTabChange");
// console.log(activeKey);
// this.setState({activeKey})
}
// -------------------- LOGIN START
//下次自动登入
@ -190,10 +196,14 @@ class LoginRegisterComponent extends Component {
//登入接口
postLogin = () => {
if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`,2);
this.setState({
Phonenumberisnotco:"账号不能为空",
})
return
} else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`,2);
this.setState({
Phonenumberisnotcodmm:"密码不能为空",
})
return
}
var url = "/accounts/login.json";
@ -204,6 +214,40 @@ class LoginRegisterComponent extends Component {
if (response === undefined) {
return
}
if(response.data.status === -2){
if("该手机号尚未注册" || "该邮箱尚未注册"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else if("错误的账号或密码"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else if("违反平台使用规范,账号已被锁定"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else {
this.openNotification(response.data.message);
return;
}
}
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if (response.status === 200) {
if (response.data.status === 402) {
window.location.href = response.data.url;
@ -225,18 +269,54 @@ class LoginRegisterComponent extends Component {
}
//注册接口
postregistered = () => {
if (this.state.logins === undefined || this.state.logins === "") {
this.openNotification(`请输入登录手机号码或邮箱`,2);
// if (this.state.logins === undefined || this.state.logins === "") {
// this.openNotification(`请输入登录手机号码或邮箱`,2);
//
// return
// } else if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块验证`,2);
// return
// } else if (this.state.codes === undefined || this.state.codes == "") {
// this.openNotification(`请输入验证码`,2);
// return
// } else if (this.state.passwords === undefined || this.state.passwords == "") {
// this.openNotification(`请输入密码`,2);
// return
// } else if (this.state.Agreetotheterms === false) {
// this.openNotification(`请同意服务协议条款`,2);
// return;
// }
if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({
Phonenumberisnotcos:"账号不能为空",
})
return
} else if (this.state.dragOk === false) {
this.openNotification(`请拖动滑块验证`,2);
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
})
return
} else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`,2);
} else if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) {
// this.openNotification(`请输入验证码`,2);
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空",
})
return
} else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) {
this.setState({
Phonenumberisnotcosymmm:"密码不能为空",
})
return
} else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length<8){
this.setState({
Phonenumberisnotcosymmm:"密码不能少于8位",
})
return
} else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`,2);
} else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length>16){
this.setState({
Phonenumberisnotcosymmm:"密码不能超过16位",
})
return
} else if (this.state.Agreetotheterms === false) {
this.openNotification(`请同意服务协议条款`,2);
@ -249,14 +329,33 @@ class LoginRegisterComponent extends Component {
code: this.state.codes,
}).then((result) => {
if(result){
if(result.data.status===-2){
if(result.data.message==="验证码不正确"){
this.setState({
logins: "",
dragOk: false,
codes: "",
passwords: "",
Agreetotheterms: "",
Phonenumberisnotcosyzm:"验证码不正确",
})
this.props.history.push("/interesse");
return;
}else if(result.data.message==="验证码已失效"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else {
this.openNotification(result.data.message);
return;
}
}else {
this.setState({
logins: "",
dragOk: false,
codes: "",
passwords: "",
Agreetotheterms: "",
})
this.props.history.push("/interesse");
}
}
}).catch((error) => {
@ -448,6 +547,7 @@ class LoginRegisterComponent extends Component {
}else{
this.setState({
login: stirngt,
Phonenumberisnotco:undefined,
})
}
@ -469,6 +569,7 @@ class LoginRegisterComponent extends Component {
}
this.setState({
password: stirngt,
Phonenumberisnotcodmm:undefined,
})
// this.setState({
// password: e.target.value
@ -514,12 +615,14 @@ class LoginRegisterComponent extends Component {
}
this.setState({
passwords: stirngt,
Phonenumberisnotcosymmm:undefined,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
codes: e.target.value,
Phonenumberisnotcosyzm:undefined,
})
}
//切换tab
@ -550,7 +653,6 @@ class LoginRegisterComponent extends Component {
}
render() {
const {
activeKey,
// 登录
autoLogin,
classpass,
@ -565,6 +667,10 @@ class LoginRegisterComponent extends Component {
dragOk,
Whethertoverify,
classpassbool,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm,
Phonenumberisnotcodmm,
// 注册
readAgreement,
} = this.state
@ -629,7 +735,7 @@ class LoginRegisterComponent extends Component {
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange}
name="username"
className="font-14 color-grey-9 loginInputzhuche"
className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}></Input>
@ -643,11 +749,17 @@ class LoginRegisterComponent extends Component {
<Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInputzhuche"
className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="密码"></Input>
{
Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<div className="left_right mt25 font-12 " style={{color: '#676767'}}>
<div className="left_right font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a onClick={()=>this.StudyMakeMoney()}
@ -658,39 +770,19 @@ class LoginRegisterComponent extends Component {
size={"large"}>登录</Button>
</div>
}
<style>
{
`
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhuche .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
}
`
}
</style>
{
parseInt(tab[0])==1 &&
<div style={{width: '340px'}}>
<Input className="loginInputsyl color-grey-9 loginInputzhuche" placeholder="请使用手机号/邮箱账号进行注册"
<Input placeholder="请使用手机号/邮箱账号进行注册"
className={Phonenumberisnotcos && Phonenumberisnotcos !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
value={this.state.logins}
type="text" autoComplete="off"
onChange={this.loginInputonChanges}
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{
Phonenumberisnotcos && Phonenumberisnotcos != "" ?
Phonenumberisnotcos && Phonenumberisnotcos !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcos}</span>
</p>
@ -700,7 +792,7 @@ class LoginRegisterComponent extends Component {
{
Whethertoverify===false?
<DragValidator
height={38} className="loginInput" successGreenColor="#29bd8b"
height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback}
></DragValidator>
@ -711,40 +803,61 @@ class LoginRegisterComponent extends Component {
{
Whethertoverify===true?
<DragValidatortwo
height={38} className="loginInput" successGreenColor="#29bd8b"
height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback}
></DragValidatortwo>
:
""
}
{
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
<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 className="mt25">
<Input className="fl mr5 font-14 color-grey-9 loginInputzhuche" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{
width:'210px',
height:'38px',
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
<div className="yslbutondls">
<Input
className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{
width:'210px',
height:'38px',
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
{
getverificationcodes === undefined ?
<Button className=" ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className=" ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className=" ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<div>
{
getverificationcodes === undefined ?
<Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
</div>
</div>
<style>
{
@ -756,9 +869,9 @@ class LoginRegisterComponent extends Component {
`
}
</style>
<Input className="loginInput font-14 mt25 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写"
<Input placeholder="输入8~16位密码区分大小写"
type={classpassbool===false?"text":"password"}
className={Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?" font-14 color-grey-9 loginInputzhucheysl ":" font-14 color-grey-9 loginInputzhuche"}
autoComplete="new-password"
onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges}
@ -766,12 +879,20 @@ class LoginRegisterComponent extends Component {
<img className={"mt5"} src={passopens} onClick={(key) => this.Showandhide(key)}>
</img>
}></Input>
{
Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosymmm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<Checkbox onChange={this.onChange}
value={Agreetotheterms}
><span className="font-14 " style={{
color: '#676767',
}}>我已阅读并同意服务协议条款</span></Checkbox>
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postregistered()}
<Button className=" font-16" type="primary" style={{height:"46px", width: "100%",marginTop:"26px"}} onClick={() => this.postregistered()}
size={"large"}>注册</Button>

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import 'common.css'
import './common.css'
//立即申请试用
class MyEduCoderModal extends Component {
@ -14,11 +14,12 @@ class MyEduCoderModal extends Component {
}
modalCancel=()=>{
//取消
window.location.href = "/"
}
setDownload=()=>{
//立即联系
this.props.setNotcompleteds()
}
@ -36,11 +37,12 @@ class MyEduCoderModal extends Component {
width="530px"
>
<div className="educouddiv">
<div><p>欢迎使用EduCoder您可以试用1天</p></div>
<div><p>超过期限需要经过管理员的授权审核</p></div>
<div className={"tabeltext-alignleft mt10"}><p>欢迎使用EduCoder您可以试用1天</p></div>
<div className={"tabeltext-alignleft mt10"}><p>超过期限需要经过管理员的授权审核</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.modalCancel()}>先试试看</a>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>立即申请授权</a>
{/*<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 bth100" onClick={()=>this.modalCancel()}>知道啦</a>
</div>
</div>
</Modal>

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import 'common.css'
import './common.css';
//完善个人资料
class Notcompleted extends Component {
@ -12,11 +12,11 @@ class Notcompleted extends Component {
}
modalCancel=()=>{
//取消
window.location.href = "/";
}
setDownload=()=>{
//立即联系
window.location.href ='/account/profile';
}
@ -34,11 +34,11 @@ class Notcompleted extends Component {
width="530px"
>
<div className="educouddiv">
<div><p>您尚未完善个人资料</p></div>
<div><p>请在完成资料后提交试用申请</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">
<a className="task-btn mr30" onClick={this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>立即完善资料</a>
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即完善资料</a>
</div>
</div>
</Modal>

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import 'common.css'
import './common.css'
//密码已重置,请重新登录
class ReadPassword extends Component {
@ -14,6 +14,7 @@ class ReadPassword extends Component {
setDownload=()=>{
//立即联系
this.props.StudyMakeMoney()
}
@ -30,9 +31,9 @@ class ReadPassword extends Component {
visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="530px"
>
<div className="educouddiv">
<div><p>密码已重置请重新登录</p></div>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>知道啦</a>
<div className="educouddiv tabeltext-alignleft">
<div className={"tabeltext-alignleft mb20"}><p>密码已重置请重新登录</p></div>
<a className="task-btn task-btn-orange bth100" onClick={()=>this.setDownload()}>知道啦</a>
</div>
</Modal>
)

@ -3,7 +3,7 @@ import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd'
import './common.css'
import { getHiddenName } from './AccountBasicEdit'
const RadioGroup = Radio.Group;
const Option = Select.Option
@ -70,7 +70,7 @@ class AccountBasicEdit extends Component {
label="姓名"
className="display formItemInline"
>
{basicInfo && basicInfo.name}
{basicInfo && (basicInfo.show_realname == true ? basicInfo.name : getHiddenName(basicInfo.name))}
</Form.Item>
<Form.Item

@ -10,6 +10,14 @@ const RadioGroup = Radio.Group;
const Option = Select.Option;
const map = identityMap // {"teacher":"教师", "student":"学生", "professional":"专业人士"}
export function getHiddenName(name) {
if (!name) return ''
let len=parseInt(name.length)-1;
let str="";
for(var i = 0; i < len; i++){ str += "*"; }
const newName = name.substr(0,1)+str;
return newName
}
class AccountBasic extends Component {
constructor(props){
super(props);
@ -110,11 +118,7 @@ class AccountBasic extends Component {
this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values);
let {basicInfo}=this.props;
// TODO 为什么modal里的form影响到这里的了
if (err) {
delete err.depart
}
if(!err || Object.keys(err).length == 0){
if(!err ){
let url=`/users/accounts/${basicInfo.id}.json`
axios.put((url),{
nickname:values.nickname,
@ -158,19 +162,10 @@ class AccountBasic extends Component {
}
}
getHiddenName(name) {
if (!name) return ''
let len=parseInt(name.length)-1;
let str="";
for(var i = 0; i < len; i++){ str += "*"; }
const newName = name.substr(0,1)+str;
return newName
}
// 将名字隐藏起来
hideRealName=(name)=>{
this.setState({ realName: name })
const newName = this.getHiddenName(name)
const newName = getHiddenName(name)
this.props.form.setFieldsValue({
name: newName
@ -202,16 +197,18 @@ class AccountBasic extends Component {
}
//搜索部门
searchDepartment=(e)=>{
this.props.form.setFieldsValue({
org2:e
})
let arr = this.state.departments.filter(function(item){
return item.name.indexOf(e) > -1
})
this.setState({
filterDepartments:arr,
departmentsName:e
})
if (e) {
this.props.form.setFieldsValue({
org2:e
})
let arr = this.state.departments.filter(function(item){
return item.name.indexOf(e) > -1
})
this.setState({
filterDepartments:arr,
departmentsName:e
})
}
}
// 选择部门、学院
@ -251,6 +248,9 @@ class AccountBasic extends Component {
this.props.form.setFieldsValue({
org2:result.data.departments[0].name
})
this.setState({
department_id: result.data.departments[0].id
})
}
}
}).catch((error)=>{
@ -303,12 +303,15 @@ class AccountBasic extends Component {
const { getFieldDecorator } = this.props.form;
let{basicInfo}=this.props
// form合并了
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
return (
<div>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...this.props}></ApplyForAddOrgModal>
{...propsWithoutForm}></ApplyForAddOrgModal>
<ApplyForAddChildOrgModal ref="applyForAddChildOrgModal" schoolName={school} schoolId={school_id} departmentName={departmentsName}
{...this.props} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form} ></ApplyForAddChildOrgModal>
{...propsWithoutForm} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form} ></ApplyForAddChildOrgModal>
<div className="basicForm">
<style>{`
@ -360,7 +363,7 @@ class AccountBasic extends Component {
font-size:14px;
}
.resetCityStyle .ant-form-item-control{
width:190px;
width:220px;
}
`}</style>
<div className="title">基本信息</div>
@ -402,7 +405,7 @@ class AccountBasic extends Component {
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</React.Fragment> :
<div className="df" style={{ 'justify-content': 'center' }}>
<span className="mr8" >{showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)}</span>
<span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName)}></i>
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>

@ -21,8 +21,60 @@ class AccountNav extends Component {
const isSecure = path.indexOf('secure') != -1
return (
<div className="accountNav fl">
<style>{`
.accountInfo {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
.accountInfo .name {
color: #05101A;
font-size: 24px;
height: 36px;
}
.accountInfo .role {
color: #666666;
font-size: 14px;
}
.accountManagement .title {
color: #05101A;
font-size: 18px;
font-weight: 400;
padding: 10px 28px;
margin-top: 6px;
}
.accountManagement .navItem {
font-size: 16px;
padding: 6px 0px;
padding-left: 30px;
border-left: 2px solid #fff;
cursor: pointer;
color:#4D4D4D;
}
.accountManagement .navItem i{
margin-top: -4px;
display: inline-block;
margin-right: 7px;
}
.accountManagement .navItem i.status{
margin-top: 1px;
margin-right: 24px;
}
.accountManagement .navItem.active {
border-left: 2px solid #4CACFF;
background: #E6F3FF;
}
.accountManagement .navItem.active i:first-child{
color:#4CACFF!important;
}
.color-green-light{
color: #45E660!important;
}
`}</style>
{
basicInfo &&
basicInfo && basicInfo.id &&
<React.Fragment>
<div className="accountInfo">
<AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg>

@ -35,6 +35,9 @@ class AccountSecure extends Component {
// 获取验证码倒计时
remainTime=()=>{
this.setState({
seconds: 60
})
this.timer = setInterval(() => {
let { seconds } =this.state;
let s = parseInt(seconds)-1;
@ -53,7 +56,7 @@ class AccountSecure extends Component {
// 获取验证码
getCode=(index)=>{
let url=`/account/get_verification_code.json`
let url=`/accounts/get_verification_code.json`
let login = '';
let values=this.props.form.getFieldsValue();
if(index == 3){
@ -199,9 +202,11 @@ class AccountSecure extends Component {
InputNewPassword=(rule,value,callback)=>{
const { form } = this.props;
if (value.length<8 || value.length>12) {
callback("请输入8-12个字符的新密码区分大小写");
}else {
if (!value) {
callback("请输入8-16位字符的新密码区分大小写");
} else if (value.length<8 || value.length>16) {
callback("请输入8-16位字符的新密码区分大小写");
} else {
callback();
}
}
@ -283,7 +288,7 @@ class AccountSecure extends Component {
:
<span style={{color: '#EA320E'}}>未绑定</span>
}
绑定手机号码将获得500金币的奖励哟手机号码仅自己可见~
{basicInfo.phone ? '仅自己可见可用手机号码登录EduCoder' : '绑定手机号码将获得500金币的奖励哟手机号码仅自己可见~'}
</div>
{
updating != PHONE &&
@ -305,10 +310,10 @@ class AccountSecure extends Component {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
message: '请输入要绑定的手机号码',
message: `请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`,
}],
})(
<Input placeholder="请输入要绑定的手机号码"></Input>
<Input placeholder={`请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`}></Input>
)}
</Form.Item>
@ -442,10 +447,6 @@ class AccountSecure extends Component {
>
{getFieldDecorator('p_new', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
message: '请输入816位的新密码区分大小写',
},{
validator:this.InputNewPassword
}],
})(

@ -18,9 +18,7 @@
.flexRow {
display: flex;
}
.color-green-light{
color: #45E660!important;
}
.mb15{margin-bottom: 15px!important;}
/* BUTTOn */
.ant-btn {
@ -45,72 +43,11 @@ button.ant-btn.ant-btn-primary.grayBtn {
display: none;
}
.basicFormWrap{
flex:1;
width: 0;
}
/* .basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
}
.basicForm .ant-form-item-label label {
color: #979797
} */
/* 左侧 */
.accountNav {
width: 290px;
box-shadow: 0px 4px 9px 0px rgba(11,62,120,0.21);
border-radius: 2px;
padding-top: 8px;
padding-bottom: 30px;
margin-bottom:30px;
margin-right:20px;
height:418px;
}
.accountInfo {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
.accountInfo .name {
color: #05101A;
font-size: 24px;
height: 36px;
}
.accountInfo .role {
color: #666666;
font-size: 14px;
}
.accountManagement .title {
color: #05101A;
font-size: 18px;
font-weight: 400;
padding: 10px 28px;
margin-top: 6px;
}
.accountManagement .navItem {
font-size: 16px;
padding: 6px 0px;
padding-left: 30px;
border-left: 2px solid #fff;
cursor: pointer;
color:#4D4D4D;
}
.accountManagement .navItem i{
margin-top: -4px;
display: inline-block;
margin-right: 7px;
}
.accountManagement .navItem i.status{
margin-top: 1px;
margin-right: 24px;
}
.accountManagement .navItem.active {
border-left: 2px solid #4CACFF;
background: #E6F3FF;
/* .basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
}
.accountManagement .navItem.active i:first-child{
color:#4CACFF!important;
}
.basicForm .ant-form-item-label label {
color: #979797
} */

@ -5,6 +5,12 @@
.login_register_content .ant-input {
background:rgb(244,244,244);
}
.login_register_content .loginInputzhucheyslass{
border:1px solid red !important;
}
.login_register_content .loginInputzhucheyslass:hover{
border:1px solid red !important;
}
.login_register_content {
width: 434px;
box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15);
@ -34,7 +40,7 @@
.educouddiv {
display: flex;
justify-content: center;
flex-direction: column;
}
@ -164,4 +170,90 @@
}
.yslgouxuanimg2{
height: 20px;
}
.yslbutondls{
display: flex;
flex-direction:row;
}
yslinpulsy input{
}
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhucheyslass {
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhucheyslass .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
border: 1px solid #FF0000!important;
border-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.loginInputzhucheyslass .ant-input:hover{
border: 1px solid #FF0000!important;
}
.loginInputzhuche .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
}
.loginInputzhucheysl{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
border-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.loginInputzhucheysl .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
border: 1px solid #FF0000!important;
border-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.loginInputzhucheysl .ant-input:hover{
border: 1px solid #FF0000!important;
}
.bth100{
width: 100px;
margin: 0 auto;
}

@ -40,9 +40,9 @@ class ApplyForAddOrgModal extends Component{
if(!err){
let url=`/add_school_applies.json`;
axios.post(url,{
schoolName:values.name,
province:values.city[0],
city:values.city[1],
name:values.schoolName,
province:values.city && values.city[0],
city:values.city && values.city[1],
address:values.address,
remarks:values.remarks
}).then((result)=>{
@ -95,6 +95,10 @@ class ApplyForAddOrgModal extends Component{
.explain .ant-form-explain{
top:36px;
}
.addOrg ul.ant-cascader-menu {
width: 196px;
}
`}</style>
<Form onSubmit={this.onOk}>
<Form.Item
@ -132,7 +136,7 @@ class ApplyForAddOrgModal extends Component{
{getFieldDecorator('city', {
rules: [],
})(
<City ></City>
<City matchInputWidth={true} popupClassName={"addOrg"}></City>
)}
</Form.Item>

@ -2,7 +2,7 @@ import React, { Component } from "react";
import { message, Icon, Input, Form, Upload} from "antd";
import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper"
import { City, getUploadActionUrl,getImageUrl } from 'educoder'
import { City, getUploadActionUrl, getImageUrl, ImageLayerHook } from 'educoder'
import '../account/common.css'
import authImg from '../../../images/account/auth.png'
@ -201,7 +201,11 @@ class RealNameCertificationModal extends Component{
}
.applyForModal .ant-form-item-label label {
color: #979797
}
.applyForModal .ant-upload.ant-upload-drag .ant-upload {
padding: 0px;
}
.certificationModal .ant-modal-body{
padding:20px;
}
@ -295,9 +299,9 @@ class RealNameCertificationModal extends Component{
</span>
<Dragger {...uploadProps2}>
{imageUrl2 ?
<a href={imageUrl2} target="_blank" title="点击重新上传图片">
// <a href={imageUrl2} target="_blank" title="点击重新上传图片"></a>
<img src={imageUrl2} alt="avatar" style={{ maxHeight: '110px'}}/>
</a> :
:
<React.Fragment>
<p className="ant-upload-drag-icon">
<i className="iconfont icon-cuban2shangchuanyunduan" style={{color:"#4B667F",font:"42px"}}></i>
@ -311,7 +315,9 @@ class RealNameCertificationModal extends Component{
<div className="df mt10 color-grey-9" style={{ justifyContent: 'center' }} >
<span className="fl mr20 edu-txt-center" style={{width:"160px"}}>示例图片</span>
<span className="fl edu-txt-center mr20" style={{width:"160px"}}>
<a href="javascript:void(0)" className="color-orange" style={{borderBottom:"1px solid #ff6800"}}>查看大图</a>
<ImageLayerHook parentSel={'#imageLayerBtn'} parentSel={'#imageLayerBtn'}
></ImageLayerHook>
<a href="javascript:void(0)" id="imageLayerBtn" src={imageUrl || imageUrl2} className="color-orange" style={{borderBottom:"1px solid #ff6800"}}>查看大图</a>
</span>
</div>
</div>

@ -0,0 +1,271 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd";
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import axios from 'axios';
import './searchc.css'
const Search = Input.Search;
class SearchPage extends Component{
constructor(props) {
super(props);
this.state={
tab:"0",
count:0,
keywords:undefined,
type:"shixun",
page:1,
perpages:20,
data:[],
}
}
//切换tab
changeTab=(e)=>{
let types ="";
if(parseInt(e.key)===0){
types="shixun";
}
if(parseInt(e.key)===1){
types="subject";
}
if(parseInt(e.key)===2){
types="course";
}
if(parseInt(e.key)===3){
types="memo";
}
this.setState({
tab:e.key,
type:types,
page:1,
})
this.getdata(1,types,this.state.keywords);
}
componentDidMount(){
// const query =this.props.location.search;
// const type = query.split('?tab=');
// let sum = []
// sum.push(type[1])
// // console.log("componentDidMountcomponentDidMount");
// // console.log(sum);
// this.setState({
// tab:sum,
// })
let courstype=decodeURI(decodeURI(this.props.location.search));
courstype = courstype.split('?value=');
this.setState({
keywords:courstype[1]
})
this.getdata(this.state.page,this.state.type,courstype[1]);
}
setdatafunsval=(e)=>{
this.setState({
keywords:e.target.value
})
}
setdatafuns =(value)=>{
this.setState({
keywords:value
})
this.props.history.replace(`/search?value=${value}`)
this.getdata(this.state.page,this.state.type,value);
}
paginationonChanges = (pageNumber) => {
this.setState({
page: pageNumber,
loadingstate: true,
})
this.getdata(pageNumber,this.state.type,this.state.keywords);
}
//获取数据
getdata=(pages,type,keywords)=>{
let url = "/search.json";
axios.get(url,{params:{
keyword:keywords,
type:type,
page:pages,
per_page:this.state.perpages,
}
}).then((response) => {
if(response === undefined){
return
}
this.setState({
count:response.data.count,
data:response.data.results,
})
}).catch((error) => {
});
}
render(){
let {tab,count,data,page,perpages}=this.state;
return(
<div className="newMain clearfix">
<div className="headersear" >
<div style={{height:"53px"}}></div>
<Search
style={{ width: "800px", marginTop:"53px"}}
className="packinput"
value={this.state.keywords}
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} />
</div>
<div className="tabtitle">
<div className="tabtitles2">
<Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item className={"tabtitle1"} key="0">开发社区</Menu.Item>
<Menu.Item className={"tabtitle2"} key="1">实践课程</Menu.Item>
<Menu.Item className={"tabtitle2"} key="2">翻转课堂</Menu.Item>
<Menu.Item className={"tabtitle2"} key="3">交流问答</Menu.Item>
</Menu>
</div>
</div>
{
JSON.stringify(data) === "[]" ?
<div id="forum_list" className="forum_table">
<div className="mh650 bjyss">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p>
</div>
</div>
</div>
:
<div>
<div className="counttit">
<p className="counttittext">共找到相关结果<span className="counttittexts">{count}</span></p>
</div>
<div className="mainx">
<div className="educontent project-packages-list mb30">
{data === undefined ? "" : data.map((item, key) => {
return (
<a key={key}
href={
item.type==="shixun"?`/shixuns/${item.identifier}/challenges`:item.type==="course"?`/courses/${item.id}/students`:item.type==="subject"?`/paths/${item.id}`:item.type==="memo"?`/forums/${item.id}`:""
}
target="_blank"
>
<div className="project-package-item">
<div className={"font-16 color-dark fl "} >
{/*标题*/}
<span className={"markdown-body fonttext"}
dangerouslySetInnerHTML={{__html:item.title}}/>
{/*描述*/}
<div>
{item.content.content === undefined || item.content.content===0?"": item.content.content.map((item4, key4) => {
return (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item4}} />
)
})
}
</div>
<div>
{/*内容*/}
{item.content.description === undefined || item.content.description===0?"": item.content.description.map((item3, key3) => {
return (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item3}} />
)
})
}
</div>
<div className="xuxianpro"></div>
<div>
{/*挑战名字*/}
{item.content.challenge_names === undefined || item.content.challenge_names===0?"": item.content.challenge_names.map((item5, key5) => {
return (
<span className={"markdown-body"}
dangerouslySetInnerHTML={{__html: item5}} />
)
})
}
</div>
<div>
{/*挑战标签*/}
{item.content.challenge_tag_names === undefined || item.content.challenge_tag_names===0?"": item.content.challenge_tag_names.map((item6, key6) => {
return (
<span className={key6>1?"markdown-body tzbq ":"markdown-body tzbqx"}
dangerouslySetInnerHTML={{__html:item6}} />
)
})
}
</div>
<div className="mt20">
<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>
</a>
)
})}
</div>
</div>
</div>
}
{
count && count && count> perpages ?
<div className="edu-txt-center" style={{paddingBottom:"30px"}}>
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={perpages}
total={count}></Pagination>
</div>
: ""
}
</div>
)
}
}
export default SnackbarHOC() (TPMIndexHOC ( SearchPage ));

@ -0,0 +1,129 @@
.searchinput{
width: 800px;
margin-top: 53px;
}
.headersear{
height: 160px;
background: #EAF2F9;
display: flex;
justify-content: center;
}
.packinput .ant-input{
height: 55px;
width:663px !important;
font-size: 18px;
color: #681616 !important;
border-color: #E1EDF8 !important;
}
.packinput .ant-input-group-addon .ant-btn{
width:137px !important;
font-size: 18px;
height: 53px;
background:rgba(76,172,255,1);
}
.tabtitle{
height: 62px !important;
box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15);
border-radius: 6px;
background: #fff;
display: flex;
justify-content: center;
}
.tabtitles2{
background: #fff;
height: 62px !important;
width: 1200px;
}
.tabtitless{
height: 62px !important;
line-height: 62px !important;
}
.tabtitle1{
}
.tabtitle2{
margin-left: 30px !important;
}
.counttit{
display: flex;
justify-content: center;
}
.counttittext{
text-align: left;
width: 1200px;
height: 18px;
color: #888888;
font-size: 13px;
margin-top: 24px;
}
.counttittexts{
color: #4CACFF !important;
font-size: 13px;
}
.mainx{
display: flex;
justify-content: center;
margin-top: 17px;
}
.project-packages-list{
}
.project-package-item{
display: -webkit-flex;
display: flex;
flex-direction:column;
margin-bottom: 20px;
padding: 20px;
background: white;
/* box-shadow: 1px 3px 3px 1px rgba(156,156,156,0.16); */
}
.xuxianpro{
height: 20px;
border-bottom: 1px dashed;
border-color: #EAEAEA;
margin-bottom: 18px;
}
.magr11{
margin-top: 11px;
}
.highlight{
color: #4CACFF;
}
.fonttext{
font-size: 20px;
font-weight:bold;
}
.fontextcolor{
color: #777777;
}
.tzbq{
margin-left: 68px;
}
.tzbqx{
margin-left: 24px;
}
.bjyss{
background: #F8F8F8;
}
.zj{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.ziticor{
color: #777777;
font-size: 13px;
}
Loading…
Cancel
Save