import React, { Component } from 'react'; import { SnackbarHOC } from 'educoder'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {Tooltip,Pagination,Spin} from 'antd'; import axios from 'axios'; import NoneData from '../../courses/coursesPublic/NoneData' import {getImageUrl} from 'educoder'; import "./usersInfo.css" import Create from './publicCreatNew' class InfosProject extends Component{ constructor(props){ super(props); this.state={ category:undefined, status:undefined, page:1, per_page:16, totalCount:undefined, data:undefined, isSpin:false } } componentDidMount=()=>{ this.setState({ isSpin:true }) let{category,status,page}=this.state; this.getCourses(category,status,page); } getCourses=(category,status,page)=>{ let url=`/users/${this.props.match.params.username}/projects.json`; axios.get((url),{params:{ category, status, page, per_page:this.props.is_current && category && page ==1?17:16 }}).then((result)=>{ if(result){ this.setState({ totalCount:result.data.count, data:result.data, isSpin:false }) } }).catch((error)=>{ console.log(error); }) } //切换种类 changeCategory=(cate)=>{ this.setState({ category:cate, page:1, isSpin:true }) let{status}=this.state; this.getCourses(cate,status,1); } //切换状态 changeStatus=(status)=>{ this.setState({ status:status, page:1, isSpin:true }) let{category}=this.state; this.getCourses(category,status,1); } //切换页数 changePage=(page)=>{ this.setState({ page, isSpin:true }) let{category,status}=this.state; this.getCourses(category,status,page); } // 进入项目 turnToCourses=(url,flag)=>{ if(flag){ window.location.href=url; } } render(){ let{ category, status, page, data, totalCount, isSpin } = this.state; let isStudent = this.props.isStudent(); let is_current=this.props.is_current; return(
共参与{totalCount}个{category?category=="manage"?"发布":"学习":"项目"} 时间最新
非成员不能访问
{item.name}
{item.owner.real_name}
{item.owner.school_name}