This commit is contained in:
caishi 2020-05-06 17:52:08 +08:00
parent 5f35b8dc91
commit 3e96e210f3
5 changed files with 96 additions and 160 deletions

View File

@ -39,7 +39,7 @@ class InfosCourse extends Component {
page,
sort_by,
sort_direction,
per_page: this.props.is_current && category && page == 1 ? 17 : 16
per_page: this.props.is_current && category && page === 1 ? 17 : 16
}
}).then((result) => {
if (result) {
@ -193,39 +193,19 @@ class InfosCourse extends Component {
border: none !important;
color: #4CACFF;
}
`
}
</style>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a
onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li>
<li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
<li className={category === "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("manage")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li>
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
<li className={category === "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("study")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div>
<style>
{
` .secondNavs li {
color: #676767;
/* margin: 0px 20px; */
float: left;
}
.secondNavs li a:hover{
color: #4CACFF
}
.secondNavs li.active a{
color: #4CACFF
}
`
}
</style>
{
is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">

View File

@ -1,90 +1,59 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
const UsersInfo = Loadable({
loader: () => import('./Infos'),
loading: Loading,
loader: () => import('./Infos'),
loading: Loading,
})
const VideoUploadList = Loadable({
loader: () => import('./video/VideoUploadList'),
loading: Loading,
loader: () => import('./video/VideoUploadList'),
loading: Loading,
})
const VideoPublishSuccess = Loadable({
loader: () => import('./video/VideoPublishSuccess'),
loading: Loading,
loader: () => import('./video/VideoPublishSuccess'),
loading: Loading,
})
const VideoProtocol = Loadable({
loader: () => import('./video/VideoProtocol'),
loading: Loading,
loader: () => import('./video/VideoProtocol'),
loading: Loading,
})
const $ = window.$;
class InfosIndex extends Component{
constructor(props){
super(props);
this.state={
data:undefined,
}
}
componentDidMount =()=>{
}
class InfosIndex extends Component {
//判断是否看的是当前用户的个人主页
componentDidUpdate =(prevProps)=> {
}
render(){
let {
data ,
}=this.state;
return(
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* 视频发布 */}
<Route exact path="/users/:username/videos/upload"
render={
(props) => (<VideoUploadList {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/success"
render={
(props) => (<VideoPublishSuccess {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/protocol"
render={
(props) => (<VideoProtocol {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/users/:username"
render={
(props) => (<UsersInfo {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
render() {
return (
<Switch {...this.props}>
{/* 视频发布 */}
<Route exact path="/users/:username/videos/upload"
render={
(props) => (<VideoUploadList {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/success"
render={
(props) => (<VideoPublishSuccess {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/protocol"
render={
(props) => (<VideoProtocol {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/users/:username"
render={
(props) => (<UsersInfo {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
)
}
}
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(InfosIndex) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(InfosIndex)));

View File

@ -1,9 +1,6 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import { Tooltip, Menu, Pagination, Spin } from 'antd';
import { Pagination, Spin } from 'antd';
import axios from 'axios';
import { getImageUrl } from 'educoder';
import Modals from '../../modals/Modals';
import NoneData from '../../courses/coursesPublic/NoneData';
import "./usersInfo.css"
@ -19,7 +16,6 @@ let categorylist = [
{ name: "运维与测试", value: "devops_and_test" },
{ name: "其他", value: "other" },
]
//
function setcategorylist(val) {
let vals = ""
categorylist.some((item, key) => {
@ -29,7 +25,6 @@ function setcategorylist(val) {
}
}
)
return vals
}
class InfosPackage extends Component {
@ -139,13 +134,13 @@ class InfosPackage extends Component {
let url = `/project_packages/${id}.json`
axios.delete(url).then((response) => {
if (response.data.status == 0) {
if (response.data.status === 0) {
this.getCourses(category, status, 1);
}
})
.catch(function (error) {
console.log(error);
});
.catch(function (error) {
console.log(error);
});
this.cancelProject();
}
render() {

View File

@ -1,86 +1,69 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC';
import GotoQQgroup from '../../../modal/GotoQQgroup';
import "./usersInfo.css"
class publicCreateNew extends Component{
constructor(props){
super(props);
this.state={
}
}
class publicCreateNew extends Component {
//头部获取是否已经登录了
getUser=(url,name)=> {
if (this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email==="") {
this.props.showNotification("请先绑定邮箱,谢谢");
return
getUser = (url, name) => {
if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") {
this.props.showNotification("请先绑定邮箱,谢谢");
return
}
if (name === "新建实训") {
if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true);
return;
}
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.props.setgoshowqqgtounp(true);
return;
}
}
if(url !== undefined || url!==""){
}
if (url !== undefined || url !== "") {
window.location.href = url;
}
}
getUsers=(url,name)=> {
getUsers = (url, name) => {
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.props.setgoshowqqgtounp(true);
return;
if (name === "新建实训") {
if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true);
return;
}
}
}
if(url !== undefined || url!==""){
if (url !== undefined || url !== "") {
window.location.href = url;
}
}
render() {
let {href,name,index}=this.props;
render() {
let { href, name, index } = this.props;
return (
<div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}>
return (
<div className="square-Item" style={{ "height": `${index === "1" ? "289" : index === "2" ? "298" : index === "3" ? "295" : "289"}px` }}>
<div className="substance substancepad">
{this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href,name)}>
<div className="substance substancepad">
{this.props.Createtype === "projects" ? <a onClick={() => this.getUser(href, name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>: <a onClick={()=>this.getUsers(href,name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>}
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont">
{name}
</span>
</div>
</div>
</div>
)
}
</a> : <a onClick={() => this.getUsers(href, name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>}
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont">
{name}
</span>
</div>
</div>
</div>
)
}
}
export default publicCreateNew;

View File

@ -14,7 +14,16 @@
font-size: 16px;
position: relative;
}
.secondNavs li {
color: #676767;
float: left;
}
.secondNavs li a:hover{
color: #4CACFF
}
.secondNavs li.active a{
color: #4CACFF
}
.navInfo li.active::after {
position: absolute;
left: 0px;