dev_forum
杨树明 5 years ago
parent 8fc86ecf9b
commit 56509b2ad5

@ -9,7 +9,16 @@ class Loading extends Component {
// Loading
return (
<div className="App" style={{minHeight: '800px'}}>
<Spin size="large" />
<style>
{
`
.margintop{
margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"}/>
</div>
);
}

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

@ -1,11 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip } from "antd";
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon } from "antd";
import axios from'axios';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals';
const Option = Select.Option;
const Search = Input.Search;
class PathModal extends Component{
constructor(props){
@ -126,7 +122,7 @@ class PathModal extends Component{
render(){
let {Searchvalue,type,Modalstype}=this.state;
let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<div>
@ -148,8 +144,7 @@ class PathModal extends Component{
width="840px"
destroyOnClose={true}
>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
{ shixunmodallist && shixunmodallist.tags.length===0?"":<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
@ -203,7 +198,6 @@ class PathModal extends Component{
<div className="over210 pl20 pr20"
onScroll={this.contentViewScrolledit}
style={{"Height":"204px"}}>
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
newshixunmodallist&&newshixunmodallist.map((item,key)=>{
@ -229,7 +223,6 @@ class PathModal extends Component{
})
}
</Checkbox.Group>
</Loading>
</div>
{ this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center">
@ -237,7 +230,7 @@ class PathModal extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>
</div>
)

@ -1,9 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd";
import { Modal,Checkbox,Select,Input,Spin,Icon} from "antd";
import axios from'axios';
import NoneData from "../coursesPublic/NoneData";
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals';
const Option = Select.Option;
@ -244,7 +242,7 @@ class Selectresource extends Component{
render(){
let {Searchvalue,type,category_id,Resourcelist,hometypepvisible,patheditarry}=this.state;
let {visible,shixunmodallist}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<div>
{/*提示*/}
@ -275,8 +273,8 @@ class Selectresource extends Component{
`
}
</style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<style>{`
.newupload_conboxtop{
margin-top: -30px;
@ -343,8 +341,8 @@ class Selectresource extends Component{
>
{
Resourcelist === undefined ? "":
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
Resourcelist === undefined ?Resourcelist.files.length===0?<NoneData/>:
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
Resourcelist.files.map((item,key)=>{
@ -367,9 +365,8 @@ class Selectresource extends Component{
)
})
}
</Checkbox.Group>
{ Resourcelist.files.length===0?<NoneData/>:""}
</Loading>
</Checkbox.Group>:""
}
</div>
@ -382,7 +379,7 @@ class Selectresource extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>:""}
</div>
)

@ -1,218 +1,216 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd";
import axios from'axios';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals';
const Option = Select.Option;
const Search = Input.Search;
function formatDate(date) {
var dateee = new Date(date).toJSON();
return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
}
class Showoldfiles extends Component{
constructor(props){
super(props);
this.state={
Searchvalue:undefined,
type:'all',
category_id:0,
page:1,
Resourcelist:undefined,
getallfiles:false,
searchtype:'getallfiles'
}
}
componentDidMount() {
}
componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) {
}
}
cloasshanchudiao=()=>{
this.props.closaoldfilesprops()
}
render(){
let {visible,allfiles}=this.props;
return(
<div>
{/*提示*/}
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
loadtype= {this.state.loadtype}
/>
{visible===true?
<Modal
title="选择版本"
visible={visible}
closable={false}
footer={null}
width="600px"
destroyOnClose={true}
keyboard={false}
>
<a id='closeIcon' onClick={this.cloasshanchudiao}><i className='iconfont icon-shanchudiao'></i></a>
<style>
{
`
.ant-modal-body{
padding: 30px 0px;
}
`
}
</style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<style>{`
.newupload_conboxtop{
margin-top: -30px;
}
#shixun_tab_div{
padding: 0 30px;
padding-top:30px;
}
.selectfiles{
width: 600px;
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.selectfilesfont{
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:25px;
color:rgba(255,104,0,1);
}
`}</style>
<div className="newupload_conbox newupload_conboxtop">
<div className="clearfix cdefault" style={{"marginRight":"4px"}}>
<div className={"selectfiles"}>
<span className={"selectfilesfont"}>
该文件有历史版本请选择您需要的文件点击文件名 下载
</span>
</div>
</div>
<style>{`
.greybackHead{
padding:0px 30px;
}
.fontlefts{
width: 300px;
text-align: center;
}
.filesves{
width: 220px;
text-align: center;
}
`}</style>
<ul className="clearfix greybackHead edu-txt-center">
<li className="fl paddingleft22 fontlefts">资源名称</li>
<li className="fl filesves" >版本</li>
</ul>
<div className="over210 pl20 pr20"
onScroll={this.contentViewScroll}
style={{"Height":"204px"}}>
<style>{`
.color-grey-9a{color: #9A9A9A !important;}
.datastyle{
width: 120px;
overflow: hidden;
height: 37px;
}
`}</style>
<style>{`
.fontlefts{
width: 340px;
text-align: center;
}
.filesves{
width: 200px;
text-align: center;
}
.isabox{
max-width: 280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
float: left;
}
`}</style>
{
allfiles === undefined ? "":
<div>
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}>
<li className="fl fontlefts">
<a className={"isabox"} href={allfiles.url}>{allfiles.title}</a>
<span className={"newcolor-orange fl"}>当前版本</span>
</li>
<li className="fl filesves ">
{formatDate(allfiles.created_on)}
</li>
</div>
{
allfiles.attachment_histories.length===0?"":allfiles.attachment_histories.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}>
<li className="fl fontlefts">
<a className={"isabox"} href={item.url}>{item.title}</a>
</li>
<li className="fl filesves ">
{formatDate(item.created_on)}
</li>
</div>
)
})
}
</div>
}
</div>
</div>
</Loading>
</Modal>:""}
</div>
)
}
}
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd";
import axios from'axios';
import Modals from '../../modals/Modals';
const Option = Select.Option;
const Search = Input.Search;
function formatDate(date) {
var dateee = new Date(date).toJSON();
return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
}
class Showoldfiles extends Component{
constructor(props){
super(props);
this.state={
Searchvalue:undefined,
type:'all',
category_id:0,
page:1,
Resourcelist:undefined,
getallfiles:false,
searchtype:'getallfiles'
}
}
componentDidMount() {
}
componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) {
}
}
cloasshanchudiao=()=>{
this.props.closaoldfilesprops()
}
render(){
let {visible,allfiles}=this.props;
return(
<div>
{/*提示*/}
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
loadtype= {this.state.loadtype}
/>
{visible===true?
<Modal
title="选择版本"
visible={visible}
closable={false}
footer={null}
width="600px"
destroyOnClose={true}
keyboard={false}
>
<a id='closeIcon' onClick={this.cloasshanchudiao}><i className='iconfont icon-shanchudiao'></i></a>
<style>
{
`
.ant-modal-body{
padding: 30px 0px;
}
`
}
</style>
<style>{`
.newupload_conboxtop{
margin-top: -30px;
}
#shixun_tab_div{
padding: 0 30px;
padding-top:30px;
}
.selectfiles{
width: 600px;
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.selectfilesfont{
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:25px;
color:rgba(255,104,0,1);
}
`}</style>
<div className="newupload_conbox newupload_conboxtop">
<div className="clearfix cdefault" style={{"marginRight":"4px"}}>
<div className={"selectfiles"}>
<span className={"selectfilesfont"}>
该文件有历史版本请选择您需要的文件点击文件名 下载
</span>
</div>
</div>
<style>{`
.greybackHead{
padding:0px 30px;
}
.fontlefts{
width: 300px;
text-align: center;
}
.filesves{
width: 220px;
text-align: center;
}
`}</style>
<ul className="clearfix greybackHead edu-txt-center">
<li className="fl paddingleft22 fontlefts">资源名称</li>
<li className="fl filesves" >版本</li>
</ul>
<div className="over210 pl20 pr20"
onScroll={this.contentViewScroll}
style={{"Height":"204px"}}>
<style>{`
.color-grey-9a{color: #9A9A9A !important;}
.datastyle{
width: 120px;
overflow: hidden;
height: 37px;
}
`}</style>
<style>{`
.fontlefts{
width: 340px;
text-align: center;
}
.filesves{
width: 200px;
text-align: center;
}
.isabox{
max-width: 280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
float: left;
}
`}</style>
{
allfiles === undefined ? "":
<div>
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}>
<li className="fl fontlefts">
<a className={"isabox"} href={allfiles.url}>{allfiles.title}</a>
<span className={"newcolor-orange fl"}>当前版本</span>
</li>
<li className="fl filesves ">
{formatDate(allfiles.created_on)}
</li>
</div>
{
allfiles.attachment_histories.length===0?"":allfiles.attachment_histories.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}>
<li className="fl fontlefts">
<a className={"isabox"} href={item.url}>{item.title}</a>
</li>
<li className="fl filesves ">
{formatDate(item.created_on)}
</li>
</div>
)
})
}
</div>
}
</div>
</div>
</Modal>:""}
</div>
)
}
}
export default Showoldfiles;

@ -1,8 +1,6 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon} from "antd";
import axios from'axios';
// import Loading from '@icedesign/base/lib/loading';
// import '@icedesign/base/lib/loading/style.js';
const Option = Select.Option;
const Search = Input.Search;
@ -276,7 +274,7 @@ class ShixunModal extends Component{
`
}
</style>
{/*<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>*/}
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{
@ -303,7 +301,6 @@ class ShixunModal extends Component{
})
}
</Checkbox.Group>
{/*</Loading>*/}
</div>
</div>
</Spin>

@ -10,8 +10,6 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import SiderBar from '../tpm/SiderBar';
import Loading from '@icedesign/base/lib/loading';
import { SnackbarHOC , getImageUrl} from 'educoder';
import Slider from '@icedesign/base/lib/slider';
@ -24,9 +22,7 @@ import '@icedesign/base/lib/rating/style.js';
import './home.css';
import '@icedesign/base/lib/loading/style.js';
import {Tooltip} from 'antd';
import {Tooltip,Spin} from 'antd';
const $ = window.$;
@ -110,7 +106,7 @@ class ShixunsHome extends Component {
return (
<div className="newMain clearfix backFAFAFA">
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
{/*懒加载*/}
<SiderBar/>
@ -498,8 +494,7 @@ class ShixunsHome extends Component {
</div>
</div>
</div>
</Loading>
</Spin>
</div>
);
}

@ -1,10 +1,8 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip} from "antd";
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import '../ShixunPaths.css';
import axios from 'axios';
const $ = window.$;
@ -437,7 +435,7 @@ class DetailCardsEditAndAdd extends Component{
width="840px"
destroyOnClose={true}
>
<Loading visible={hometypepvisible} shape="dot-circle" color='#4AC7FF'>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
@ -516,7 +514,7 @@ class DetailCardsEditAndAdd extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>
</div>

@ -1,10 +1,8 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip} from "antd";
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import '../ShixunPaths.css';
import axios from 'axios';
const $ = window.$;
@ -478,8 +476,8 @@ class DetailCardsEditAndEdit extends Component{
footer={null}
width="840px"
destroyOnClose={true}
>
<Loading visible={hometypepvisible} shape="dot-circle" color='#4AC7FF'>
>Z
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
@ -558,7 +556,7 @@ class DetailCardsEditAndEdit extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>
</div>

@ -1,193 +1,192 @@
import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css";
import Rating from '@icedesign/base/lib/rating';
import Loading from '@icedesign/base/lib/loading';
import axios from 'axios';
import {getImageUrl, toPath, getUrl} from 'educoder'
import './shixunCss/fork.css';
let origin = getUrl();
let path = getUrl("/editormd/lib/")
const $ = window.$;
let timeout;
let currentValue;
export default class TPMFork_listComponent extends Component {
constructor(props) {
super(props)
this.state = {
shixuns:undefined,
total_count:0,
shixunsID:undefined,
Forkvisible: true,
Forkcurrent: 1
}
}
componentDidMount() {
let id = this.props.match.params.shixunId;
let Url="/shixuns/"+id+"/fork_list.json";
axios.get(Url, {
params: {
page:1,
limit:8
}
}).then((response)=> {
this.setState({
shixunsID:id,
shixuns:response.data.shixuns,
total_count:response.data.total_count,
Forkvisible:false
})
}).catch((error)=>{
console.log(error)
});
}
TPMForkonChange=(pageNumber)=>{
let id = this.props.match.params.shixunId;
this.setState({
Forkvisible:true
})
let Url="/shixuns/"+id+"/fork_list.json";
axios.get(Url, {
params: {
page:pageNumber,
limit:8
}
}).then((response)=> {
this.setState({
shixunsID:id,
shixuns:response.data.shixuns,
total_count:response.data.total_count,
Forkvisible: false,
Forkcurrent: pageNumber
})
}).catch((error)=>{
console.log(error)
});
}
render() {
let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state;
return (
<React.Fragment>
<div className="educontent mb20">
<div className="edu-back-white padding20 clearfix mt30">
<span className="fl font-16">Fork实训列表</span>
<a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a>
</div>
<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>
<div className="mt30 square-list clearfix mh320">
{ shixuns===undefined?" ":shixuns.map((item,key)=>{
return(
<div className="square-Item" key={key} id={item.id}>
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img src={require(`./shixunCss/tag2.png`)}/>
</div>
<div className={item.power === false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25"/>
<p className="font-14 color-white">非试用内容需要授权</p>
</div>
<a href={"/shixuns/"+item.identifier+"/challenges"} className="square-img" target="_blank">
<img src={'/'+item.pic}/>
</a>
<div className="square-main">
<p className="task-hide">
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="justify color-grey-name">
{item.name}
</a>
</p>
<p className="clearfix mt8 ml-3">
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
<Rating key={key} value={item.score_info===null?5:item.score_info} disabled allowHalf />
</span>
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span>
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"关卡"}>
<span className="mr10 fl squareIconSpan">
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
</span>
</Tooltip>
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan">*/}
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
{/*</span>*/}
{/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":'block'}}>
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
</span>
</Tooltip>
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
</p>
</div>
</div>
)
})
}
</div>
{/*<div>{total_count}</div>*/}
<div className="educontent mb80 edu-txt-center mt10" style={{display: total_count > 8 ? "block" : "none"}}>
{/*<div className={total_count < 9 ? " ml32" : "ml105"}>*/}
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={8}
total={total_count}
current={Forkcurrent}
style={
{
display: total_count < 9 ? 'none' : 'block'
}
}
onChange={this.TPMForkonChange}/>
</div>
</Loading>
</div>
</React.Fragment>
)
}
}
import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip,Spin} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css";
import Rating from '@icedesign/base/lib/rating';
import axios from 'axios';
import {getImageUrl, toPath, getUrl} from 'educoder'
import './shixunCss/fork.css';
let origin = getUrl();
let path = getUrl("/editormd/lib/")
const $ = window.$;
let timeout;
let currentValue;
export default class TPMFork_listComponent extends Component {
constructor(props) {
super(props)
this.state = {
shixuns:undefined,
total_count:0,
shixunsID:undefined,
Forkvisible: true,
Forkcurrent: 1
}
}
componentDidMount() {
let id = this.props.match.params.shixunId;
let Url="/shixuns/"+id+"/fork_list.json";
axios.get(Url, {
params: {
page:1,
limit:8
}
}).then((response)=> {
this.setState({
shixunsID:id,
shixuns:response.data.shixuns,
total_count:response.data.total_count,
Forkvisible:false
})
}).catch((error)=>{
console.log(error)
});
}
TPMForkonChange=(pageNumber)=>{
let id = this.props.match.params.shixunId;
this.setState({
Forkvisible:true
})
let Url="/shixuns/"+id+"/fork_list.json";
axios.get(Url, {
params: {
page:pageNumber,
limit:8
}
}).then((response)=> {
this.setState({
shixunsID:id,
shixuns:response.data.shixuns,
total_count:response.data.total_count,
Forkvisible: false,
Forkcurrent: pageNumber
})
}).catch((error)=>{
console.log(error)
});
}
render() {
let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state;
return (
<React.Fragment>
<div className="educontent mb20">
<div className="edu-back-white padding20 clearfix mt30">
<span className="fl font-16">Fork实训列表</span>
<a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a>
</div>
{/*<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>*/}
<Spin spinning={Forkvisible} size="large" style={{marginTop:'15%'}}>
<div className="mt30 square-list clearfix mh320">
{ shixuns===undefined?" ":shixuns.map((item,key)=>{
return(
<div className="square-Item" key={key} id={item.id}>
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
<img src={require(`./shixunCss/tag2.png`)}/>
</div>
<div className={item.power === false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25"/>
<p className="font-14 color-white">非试用内容需要授权</p>
</div>
<a href={"/shixuns/"+item.identifier+"/challenges"} className="square-img" target="_blank">
<img src={'/'+item.pic}/>
</a>
<div className="square-main">
<p className="task-hide">
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="justify color-grey-name">
{item.name}
</a>
</p>
<p className="clearfix mt8 ml-3">
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
<Rating key={key} value={item.score_info===null?5:item.score_info} disabled allowHalf />
</span>
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span>
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"关卡"}>
<span className="mr10 fl squareIconSpan">
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
</span>
</Tooltip>
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan">*/}
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
{/*</span>*/}
{/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":'block'}}>
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
</span>
</Tooltip>
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
</p>
</div>
</div>
)
})
}
</div>
{/*<div>{total_count}</div>*/}
<div className="educontent mb80 edu-txt-center mt10" style={{display: total_count > 8 ? "block" : "none"}}>
{/*<div className={total_count < 9 ? " ml32" : "ml105"}>*/}
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={8}
total={total_count}
current={Forkcurrent}
style={
{
display: total_count < 9 ? 'none' : 'block'
}
}
onChange={this.TPMForkonChange}/>
</div>
</Spin>
{/*</Loading>*/}
</div>
</React.Fragment>
)
}
}

@ -15,14 +15,14 @@
/*flex-wrap: wrap;*/
/*display: -webkit-flex; !* Safari *!*/
/*display: flex;*/
width: 340px;
width: 360px;
position:relative;
overflow: hidden;
}
.newsubscript{
position: absolute;
right: 23px;
bottom: 38px;
bottom: 16px;
cursor: pointer;
}
.newsubscript:hover{

@ -7,11 +7,9 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
// import { Rating,Loading} from '@icedesign/base';
import {getImageUrl,setImagesUrl, toPath} from 'educoder';
// import { Pagination,Row,Col } from 'antd';
import { Spin,Icon } from 'antd';
import 'antd/lib/pagination/style/index.css';
@ -21,8 +19,6 @@ import Rating from '@icedesign/base/lib/rating';
import Pagination from '@icedesign/base/lib/pagination';
// import Loading from '@icedesign/base/lib/loading';
// 引入业务组件样式
import '@icedesign/base/lib/pagination/style.js';
@ -30,8 +26,6 @@ import '@icedesign/base/lib/rating/style.js';
import { Tooltip } from 'antd';
// import '@icedesign/base/lib/loading/style.js';
import axios from 'axios';
const $ = window.$;
@ -63,8 +57,8 @@ class ShixunCard extends Component {
let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props;
return (
<div className="educontent mb80">
{/*<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>*/}
<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>
<div id="shixun_list_content"
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}>
<div className="square-list clearfix">
@ -168,7 +162,7 @@ class ShixunCard extends Component {
</div>
</div>
{/*</Loading>*/}
</Spin>
</div>
)
}

@ -6,6 +6,8 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import axios from 'axios';
import { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
@ -16,10 +18,6 @@ import ShixunSearchBar from './ShixunSearchBar';
import ShixunCard from './ShixunCard';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
const queryString = require('query-string');
const $ = window.$;
@ -362,7 +360,7 @@ class ShixunsIndex extends Component {
return (
<div className="newMain clearfix backFAFAFA">
<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>
<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>
{/*懒加载*/}
<ShixunSearchBar
@ -394,7 +392,7 @@ class ShixunsIndex extends Component {
shixunsPage={this.shixunsPage.bind(this)}
/>
</Loading>
</Spin>
</div>
);
}

Loading…
Cancel
Save