hjm 6 years ago
commit e33e0bff12

@ -26,9 +26,10 @@ function locationurl(list){
} }
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : const debugType =""
window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' // window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window._debugType = debugType; // window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
// window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {

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

@ -702,10 +702,9 @@ submittojoinclass=(value)=>{
{/*<input type="text" className="search-input fl" id="search-input" */} {/*<input type="text" className="search-input fl" id="search-input" */}
{/*onKeyDown={this.onKeywordSearchKeyDown} name="search_keyword" placeholder="搜索实训项目"/>*/} {/*onKeyDown={this.onKeywordSearchKeyDown} name="search_keyword" placeholder="搜索实训项目"/>*/}
<div <div className={"HeaderSearch"}
className={"HeaderSearch"} style={{display: 'none'}}
style={{display: 'none'}} >
>
<Search <Search
placeholder="实践课程/翻转课堂/开发社区/交流问答" placeholder="实践课程/翻转课堂/开发社区/交流问答"
// onSearch={value => console.log(value)} // onSearch={value => console.log(value)}
@ -795,7 +794,7 @@ submittojoinclass=(value)=>{
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<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="/shixuns/new">新建实训</a></li>
<li><a href={this.props.Headertop===undefined?"":"/paths/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> <li><a href={"/projects/new"} target="_blank">新建项目</a></li>
</ul> </ul>
<ul className="fl with50 edu-txt-center"> <ul className="fl with50 edu-txt-center">

@ -253,22 +253,34 @@ class Infos extends Component{
{ {
data && is_current == false && data.identity =="学生" ? "" : <span className="mypost fl mr10">{data && data.identity}</span> data && is_current == false && data.identity =="学生" ? "" : <span className="mypost fl mr10">{data && data.identity}</span>
} }
<a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}> <a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}> <Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-shenfenrenzheng font-13 color-blue":"iconfont icon-shenfenrenzheng font-13 color-grey-9"}></i> <i className={ data && data.authentication ? "iconfont icon-shenfenrenzheng font-13 color-blue":"iconfont icon-shenfenrenzheng font-13 color-grey-9"}></i>
</Tooltip> </Tooltip>
</a> </a>
<a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/professional_certification` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}> <a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/professional_certification` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}> <Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-zhiyerenzheng font-13 color-blue":"iconfont icon-zhiyerenzheng font-13 color-grey-9"}></i> <i className={ data && data.professional_certification ? "iconfont icon-zhiyerenzheng font-13 color-blue":"iconfont icon-zhiyerenzheng font-13 color-grey-9"}></i>
</Tooltip> </Tooltip>
</a> </a>
<a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/change_or_bind?type=phone` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}> <a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/change_or_bind?type=phone` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.phone_binded ?"已手机认证":"未手机认证"}> <Tooltip placement='bottom' title={ data && data.phone_binded ?"已手机认证":"未手机认证"}>
<i className={ data && data.phone_binded ? "iconfont icon-shoujirenzheng font-13 color-blue":"iconfont icon-shoujirenzheng font-13 color-grey-9"}></i> <i className={ data && data.phone_binded ? "iconfont icon-shoujirenzheng font-13 color-blue":"iconfont icon-shoujirenzheng font-13 color-grey-9"}></i>
</Tooltip> </Tooltip>
</a> </a>
<a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/my/account` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}> <a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/my/account` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.email_binded ?"已邮箱认证":"未邮箱认证"}> <Tooltip placement='bottom' title={ data && data.email_binded ?"已邮箱认证":"未邮箱认证"}>
<i className={ data && data.email_binded ? "iconfont icon-youxiangrenzheng font-13 color-blue":"iconfont icon-youxiangrenzheng font-13 color-grey-9"}></i> <i className={ data && data.email_binded ? "iconfont icon-youxiangrenzheng font-13 color-blue":"iconfont icon-youxiangrenzheng font-13 color-grey-9"}></i>
</Tooltip> </Tooltip>
@ -276,7 +288,9 @@ class Infos extends Component{
{/* <!--学院管理员身份--> */} {/* <!--学院管理员身份--> */}
{ {
data && data.college_identifier && data && data.college_identifier &&
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/colleges/${data.college_identifier}/statistics`} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}> <a
// href={`${this.props.Headertop && this.props.Headertop.old_url}/colleges/${data.college_identifier}/statistics`} target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title="学院管理员"> <Tooltip placement='bottom' title="学院管理员">
<i className="iconfont icon-chengyuanguanli font-12 color-blue" data-tip-down="学院管理员"></i> <i className="iconfont icon-chengyuanguanli font-12 color-blue" data-tip-down="学院管理员"></i>
</Tooltip> </Tooltip>

@ -1,192 +1,192 @@
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,Pagination,Spin} from 'antd'; import {Tooltip,Pagination,Spin} from 'antd';
import axios from 'axios'; import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData' import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import "./usersInfo.css" import "./usersInfo.css"
import Create from './publicCreatNew' import Create from './publicCreatNew'
class InfosProject extends Component{ class InfosProject extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
category:undefined, category:undefined,
status:undefined, status:undefined,
page:1, page:1,
per_page:16, per_page:16,
totalCount:undefined, totalCount:undefined,
data:undefined, data:undefined,
isSpin:false isSpin:false
} }
} }
componentDidMount=()=>{ componentDidMount=()=>{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
let{category,status,page}=this.state; let{category,status,page}=this.state;
this.getCourses(category,status,page); this.getCourses(category,status,page);
} }
getCourses=(category,status,page)=>{ getCourses=(category,status,page)=>{
let url=`/users/${this.props.match.params.username}/projects.json`; let url=`/users/${this.props.match.params.username}/projects.json`;
axios.get((url),{params:{ axios.get((url),{params:{
category, category,
status, status,
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,
page:1, page:1,
isSpin:true isSpin:true
}) })
let{status}=this.state; let{status}=this.state;
this.getCourses(cate,status,1); this.getCourses(cate,status,1);
} }
//切换状态 //切换状态
changeStatus=(status)=>{ changeStatus=(status)=>{
this.setState({ this.setState({
status:status, status:status,
page:1, page:1,
isSpin:true isSpin:true
}) })
let{category}=this.state; let{category}=this.state;
this.getCourses(category,status,1); this.getCourses(category,status,1);
} }
//切换页数 //切换页数
changePage=(page)=>{ changePage=(page)=>{
this.setState({ this.setState({
page, page,
isSpin:true isSpin:true
}) })
let{category,status}=this.state; let{category,status}=this.state;
this.getCourses(category,status,page); this.getCourses(category,status,page);
} }
// 进入项目 // 进入项目
turnToCourses=(url,flag)=>{ turnToCourses=(url,flag)=>{
if(flag){ if(flag){
this.props.history.push(url); this.props.history.push(url);
} }
} }
render(){ render(){
let{ let{
category, category,
status, status,
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>
{ {
is_current && 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=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("publicly")}>公开</a></li> <li className={status=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("publicly")}>公开</a></li>
<li className={status=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("personal")}>私有</a></li> <li className={status=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("personal")}>私有</a></li>
</div> </div>
} }
<p className="pl25 pr25 clearfix font-12 mb20 mt20"> <p 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>
<span className="fr color-grey-9">时间最新</span> <span className="fr color-grey-9">时间最新</span>
</p> </p>
<div className="square-list clearfix"> <div className="square-list clearfix">
{ {
!isStudent && page == 1 && !category && is_current && !isStudent && page == 1 && !category && is_current &&
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建项目"} index="4"></Create> <Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建项目"} index="4"></Create>
} }
{ {
(!data || data.projects.length==0) && (isStudent || category) && <NoneData></NoneData> (!data || data.projects.length==0) && (isStudent || category) && <NoneData></NoneData>
} }
{ {
data && data.projects && data.projects.map((item,key)=>{ data && data.projects && data.projects.map((item,key)=>{
return( return(
<div className="square-Item" onClick={()=>this.turnToCourses(`${this.props.Headertop && this.props.Headertop.old_url}/projects/${item.id}`,item.can_visited)} style={{"cursor": "pointer"}}> <div className="square-Item" onClick={()=>this.turnToCourses(`/projects/${item.id}`,item.can_visited)} style={{"cursor": "pointer"}}>
{ {
item.is_public==1 && item.is_public==1 &&
<React.Fragment> <React.Fragment>
<div className="publicpart"></div> <div className="publicpart"></div>
<span className="smalltrangle"></span> <span className="smalltrangle"></span>
<span className="publicword">公开</span> <span className="publicword">公开</span>
</React.Fragment> </React.Fragment>
} }
{ {
item.can_visited ==false? item.can_visited ==false?
<div className="closeSquare"> <div className="closeSquare">
<img src={getImageUrl("/images/educoder/icon/lockclose.svg")} className="mt80 mb25"/> <img src={getImageUrl("/images/educoder/icon/lockclose.svg")} className="mt80 mb25"/>
<p className="font-14 color-white">非成员不能访问</p> <p className="font-14 color-white">非成员不能访问</p>
</div>:"" </div>:""
} }
<div className="substance"> <div className="substance">
<p className="subName font-16"> <p className="subName font-16">
<span>{item.name}</span> <span>{item.name}</span>
</p> </p>
<span><img alt="用户" className="radius mt15" height="60" src={getImageUrl(`images/${item.owner.avatar_url}`)} width="60"/></span> <span><img alt="用户" className="radius mt15" height="60" src={getImageUrl(`images/${item.owner.avatar_url}`)} width="60"/></span>
<p className="font-14 mt10"><span>{item.owner.real_name}</span></p> <p className="font-14 mt10"><span>{item.owner.real_name}</span></p>
<p className="font-16 mb15 mt10 task-hide"><span className="color-grey-9">{item.owner.school_name}</span></p> <p className="font-16 mb15 mt10 task-hide"><span className="color-grey-9">{item.owner.school_name}</span></p>
</div> </div>
<div className="edu-txt-center course-bottom"> <div className="edu-txt-center course-bottom">
<div className="inline color-grey-6"> <div className="inline color-grey-6">
{ {
item.members_count> 0 && item.members_count> 0 &&
<span className="mr10 ml10 fl squareIconSpan"> <span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span> <i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span>
} }
{ {
item.issues_count> 0 && item.issues_count> 0 &&
<span className="mr10 ml10 fl squareIconSpan"> <span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-issue fl mr3" data-tip-down="issues数"></i>{item.issues_count}</span> <i className="iconfont icon-issue fl mr3" data-tip-down="issues数"></i>{item.issues_count}</span>
} }
{ {
item.changesets_count> 0 && item.changesets_count> 0 &&
<span className="mr10 ml10 fl squareIconSpan"> <span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-banbenku fl mr3" data-tip-down="版本库"></i>{item.changesets_count}</span> <i className="iconfont icon-banbenku fl mr3" data-tip-down="版本库"></i>{item.changesets_count}</span>
} }
</div> </div>
</div> </div>
</div> </div>
) )
}) })
} }
</div> </div>
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div> </div>
} }
</Spin> </Spin>
</div> </div>
) )
} }
} }
export default InfosProject; export default InfosProject;
Loading…
Cancel
Save