dev_oauth
杨树明 6 years ago
parent c751fecf72
commit c41aec0904

@ -112,8 +112,17 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.smallSquare:nth-child(3n+0){margin-right: 0px;} .smallSquare:nth-child(3n+0){margin-right: 0px;}
.partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;} .partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;}
/*块状列表上面的绿色标签*/ /*块状列表上面的绿色标签*/
.tag-green{position: absolute;left: 0px;top:20px;} .tag-green{
.tag-green .tag-name{display: block;width: auto;background-image: url("/images/educoder/tag1.png");background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} position: absolute;
left: 15px;
bottom: 95px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;} .tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} .tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
/*发送至弹框里的下拉框*/ /*发送至弹框里的下拉框*/

@ -230,7 +230,7 @@ class ShixunsHome extends Component {
<div className="tag-green"> <div className="tag-green">
<span className="tag-name"> {item.tag_name}</span> <span className="tag-name"> {item.tag_name}</span>
<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/> {/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
</div> </div>
<div className={item.power === false ? "closeSquare" : "none"}> <div className={item.power === false ? "closeSquare" : "none"}>
@ -301,7 +301,7 @@ class ShixunsHome extends Component {
<div className="tag-green"> <div className="tag-green">
<span className="tag-name"> {item.tag_name}</span> <span className="tag-name"> {item.tag_name}</span>
<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/> {/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
</div> </div>
<div className={item.power === false ? "closeSquare" : "none"}> <div className={item.power === false ? "closeSquare" : "none"}>

@ -22,23 +22,34 @@ class ShixunPathCard extends Component{
return( return(
<div className="square-Item" id={"item_"+key}> <div className="square-Item" id={"item_"+key}>
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.tag-green{*/}
{/*position: absolute;*/}
{/*left: 15px;*/}
{/*bottom: 95px;}*/}
{/*.tag-green .tag-name{display: block;width: auto;*/}
{/*/*background-image: url("/images/educoder/tag1.png");*/*/}
{/*background: #000000;*/}
{/*border: 1px solid #fff;*/}
{/*border-radius: 3px;*/}
{/*font-size: 14px;*/}
{/*background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}*/}
{/*.tag-orange{position: absolute;right: 0px;top:20px;}*/}
{/*.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{ {
item.tag_name === null ? "" : item.tag_name === null ? "" :
<div className="tag-green"> <div className="tag-green">
<span className="tag-name">{item.tag_name}</span> <span className="tag-name">{item.tag_name}</span>
<img src={getImageUrl('images/educoder/tag2.png')}/> {/*<img src={getImageUrl('images/educoder/tag2.png')}/>*/}
</div> </div>
} }
<style>
{
`
.tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
`
}
</style>
{ {
item.excellent === true ? "" : item.excellent === true ? "" :
<div className="tag-orange"> <div className="tag-orange">
@ -53,7 +64,7 @@ class ShixunPathCard extends Component{
</div> </div>
<Link to={"/paths/"+item.id} className="square-img" > <Link to={"/paths/"+item.id} className="square-img" >
{/*target="_blank"*/} {/*target="_blank"*/}
<img alt="13?1543211263" src={"/"+item.image_url} style={{"display":"block"}}/> <img alt="详情图片" src={"/"+item.image_url} style={{"display":"block"}}/>
</Link> </Link>
<div className="square-main"> <div className="square-main">
<p className="task-hide"> <p className="task-hide">

@ -107,7 +107,7 @@ export default class TPMFork_listComponent extends Component {
<div className="tag-green"> <div className="tag-green">
<span className="tag-name"> {item.tag_name}</span> <span className="tag-name"> {item.tag_name}</span>
<img src={require(`./shixunCss/tag2.png`)}/> {/*<img src={require(`./shixunCss/tag2.png`)}/>*/}
</div> </div>
<div className={item.power === false ? "closeSquare" : "none"}> <div className={item.power === false ? "closeSquare" : "none"}>

@ -88,7 +88,7 @@ class ShixunCard extends Component {
item.tag_name === null ? "": item.tag_name === null ? "":
<div className="tag-green"> <div className="tag-green">
<span className="tag-name"> {item.tag_name}</span> <span className="tag-name"> {item.tag_name}</span>
<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/> {/*<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>*/}
</div> </div>
} }
<div className={item.power === false ? "closeSquare" : "none"}> <div className={item.power === false ? "closeSquare" : "none"}>

@ -159,7 +159,9 @@ class InfosPath extends Component{
return( return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/paths/${item.id}`)}> <div className="square-Item" onClick={()=>this.turnToCourses(`/paths/${item.id}`)}>
{ {
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/></div> item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/}
</div>
} }
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a> <a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a>
<div className="square-main"> <div className="square-main">

@ -1,203 +1,205 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd'; import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData' import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios'; import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder'; import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC' import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css" import "./usersInfo.css"
import Create from './publicCreatNew' import Create from './publicCreatNew'
class InfosShixun extends Component{ class InfosShixun extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
category:undefined, category:undefined,
page:1, page:1,
sort_by:'time', sort_by:'time',
status:undefined, status:undefined,
per_page:16, per_page:16,
isSpin:false, isSpin:false,
totalCount:undefined, totalCount:undefined,
data:undefined data:undefined
} }
} }
componentDidMount=()=>{ componentDidMount=()=>{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
let{category,status,sort_by,page}=this.state; let{category,status,sort_by,page}=this.state;
this.getCourses(category,status,sort_by,page); this.getCourses(category,status,sort_by,page);
} }
getCourses=(category,status,sort_by,page)=>{ getCourses=(category,status,sort_by,page)=>{
let url=`/users/${this.props.match.params.username}/shixuns.json`; let url=`/users/${this.props.match.params.username}/shixuns.json`;
axios.get((url),{params:{ axios.get((url),{params:{
category, category,
status, status,
sort_by, sort_by,
page, page,
per_page:this.props.is_current && category && page ==1?17:16 per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{ }}).then((result)=>{
if(result){ if(result){
this.setState({ this.setState({
totalCount:result.data.count, totalCount:result.data.count,
data:result.data, data:result.data,
isSpin:false isSpin:false
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
} }
//切换种类 //切换种类
changeCategory=(cate)=>{ changeCategory=(cate)=>{
this.setState({ this.setState({
category:cate, category:cate,
status:undefined, status:undefined,
page:1, page:1,
isSpin:true isSpin:true
}) })
let{sort_by}=this.state; let{sort_by}=this.state;
this.getCourses(cate,undefined,sort_by,1); this.getCourses(cate,undefined,sort_by,1);
} }
// 切换状态 // 切换状态
changeStatus=(status)=>{ changeStatus=(status)=>{
this.setState({ this.setState({
status, status,
page:1, page:1,
isSpin:true isSpin:true
}) })
let{category,sort_by}=this.state; let{category,sort_by}=this.state;
this.getCourses(category,status,sort_by,1); this.getCourses(category,status,sort_by,1);
} }
//切换页数 //切换页数
changePage=(page)=>{ changePage=(page)=>{
this.setState({ this.setState({
page, page,
isSpin:true isSpin:true
}) })
let{category,sort_by,status}=this.state; let{category,sort_by,status}=this.state;
this.getCourses(category,status,sort_by,page); this.getCourses(category,status,sort_by,page);
} }
// 进入课堂 // 进入课堂
turnToCourses=(url)=>{ turnToCourses=(url)=>{
this.props.history.push(url); this.props.history.push(url);
} }
// 切换排序方式 // 切换排序方式
changeOrder= (sort)=>{ changeOrder= (sort)=>{
this.setState({ this.setState({
sort_by:sort, sort_by:sort,
isSpin:true isSpin:true
}) })
let{category,status,page}=this.state; let{category,status,page}=this.state;
this.getCourses(category,status,sort,page); this.getCourses(category,status,sort,page);
} }
render(){ render(){
let{ let{
category, category,
status, status,
sort_by, sort_by,
page, page,
data, data,
totalCount, totalCount,
isSpin isSpin
} = this.state; } = this.state;
let isStudent = this.props.isStudent(); let isStudent = this.props.isStudent();
let is_current=this.props.is_current; let is_current=this.props.is_current;
return( return(
<div className="educontent"> <div className="educontent">
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt25 pb25 clearfix "> <div className="white-panel edu-back-white pt25 pb25 clearfix ">
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li> <li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li> <li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li> <li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div> </div>
{ {
category && category == "manage" && is_current && category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE"> <div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li> <li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="editing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("editing")}>编辑中</a></li> <li className={status=="editing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("editing")}>编辑中</a></li>
<li className={status=="applying" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("applying")}>待审核</a></li> <li className={status=="applying" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("applying")}>待审核</a></li>
<li className={status=="published" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("published")}>已发布</a></li> <li className={status=="published" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("published")}>已发布</a></li>
<li className={status=="closed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("closed")}>已关闭</a></li> <li className={status=="closed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("closed")}>已关闭</a></li>
</div> </div>
} }
{ {
category && category == "study" && is_current && category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE"> <div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li> <li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>未通关</a></li> <li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>未通关</a></li>
<li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li> <li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li>
</div> </div>
} }
<div className="pl25 pr25 clearfix font-12 mb20 mt20"> <div className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span> <span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span>
<div className="fr"> <div className="fr">
<li className="drop_down"> <li className="drop_down">
<span className="color-grey-9 font-12">{sort_by=="time"?"时间最新":"语言类别"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i> <span className="color-grey-9 font-12">{sort_by=="time"?"时间最新":"语言类别"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal"> <ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("time")}>时间最新</li> <li onClick={()=>this.changeOrder("time")}>时间最新</li>
<li onClick={()=>this.changeOrder("language")}>语言类别</li> <li onClick={()=>this.changeOrder("language")}>语言类别</li>
</ul> </ul>
</li> </li>
</div> </div>
</div> </div>
<div className="square-list clearfix"> <div className="square-list clearfix">
{ {
page == 1 && is_current && this.props.current_user && this.props.current_user.user_identity != "学生" ? page == 1 && is_current && this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:"" <Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
} }
{ {
(!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData> (!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
} }
{ {
data && data.shixuns && data.shixuns.map((item,key)=>{ data && data.shixuns && data.shixuns.map((item,key)=>{
return( return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}> <div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}>
{ {
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/></div> item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
} {/*<img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/>*/}
<a href="javascript:void(0)" className="square-img"> </div>
<img src={setImagesUrl(`${item.image_url}`)}/> }
</a> <a href="javascript:void(0)" className="square-img">
<div className="square-main"> <img src={setImagesUrl(`${item.image_url}`)}/>
<p className="task-hide"> </a>
<a href="javascript:void(0)" className="justify color-grey-name">{item.name}</a> <div className="square-main">
</p> <p className="task-hide">
<div className="user-bar mt10"> <a href="javascript:void(0)" className="justify color-grey-name">{item.name}</a>
<p style={{'width': `${parseFloat(parseInt(item.finished_challenges_count)/parseInt(item.challenges_count)).toFixed(2)*100}%`}}></p> </p>
</div> <div className="user-bar mt10">
<p className="color-blue font-14 clearfix"> <p style={{'width': `${parseFloat(parseInt(item.finished_challenges_count)/parseInt(item.challenges_count)).toFixed(2)*100}%`}}></p>
已完成 {item.finished_challenges_count} / {item.challenges_count} </div>
</p> <p className="color-blue font-14 clearfix">
</div> 已完成 {item.finished_challenges_count} / {item.challenges_count}
</div> </p>
) </div>
}) </div>
} )
</div> })
{ }
totalCount > 15 && </div>
<div className="mt30 mb50 edu-txt-center"> {
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> totalCount > 15 &&
</div> <div className="mt30 mb50 edu-txt-center">
} <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</Spin> </div>
</div> }
) </Spin>
} </div>
} )
}
}
export default InfosShixun; export default InfosShixun;

@ -114,8 +114,17 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.smallSquare:nth-child(3n+0){margin-right: 0px;} .smallSquare:nth-child(3n+0){margin-right: 0px;}
.partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;} .partimg{height: 180px;width: 100%;border-radius: 6px 6px 0px 0px;}
/*块状列表上面的绿色标签*/ /*块状列表上面的绿色标签*/
.tag-green{position: absolute;left: 0px;top:20px;} .tag-green{
.tag-green .tag-name{display: block;width: auto;background-image: url("/images/educoder/tag1.png");background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} position: absolute;
left: 15px;
bottom: 95px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
border: 1px solid #fff;
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;} .tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;} .tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
/*发送至弹框里的下拉框*/ /*发送至弹框里的下拉框*/

Loading…
Cancel
Save