diff --git a/src/modules/user/usersInfo/InfosCourse.js b/src/modules/user/usersInfo/InfosCourse.js index f32358830..71ca840d9 100644 --- a/src/modules/user/usersInfo/InfosCourse.js +++ b/src/modules/user/usersInfo/InfosCourse.js @@ -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; } - - - ` }
  • this.changeCategory()} className="font-16 w32">全部
  • -
  • this.changeCategory("manage")} className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的
  • -
  • this.changeCategory("study")} className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的
  • - - { is_current &&
    diff --git a/src/modules/user/usersInfo/InfosIndex.js b/src/modules/user/usersInfo/InfosIndex.js index 89d69ab5d..e132220fe 100644 --- a/src/modules/user/usersInfo/InfosIndex.js +++ b/src/modules/user/usersInfo/InfosIndex.js @@ -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( - - - {/* --------------------------------------------------------------------- */} - - - {/* 视频发布 */} - () - } - > - () - } - > - () - } - > - - - - - - - () - } - > - - + render() { + return ( + + {/* 视频发布 */} + () + } + > + () + } + > + () + } + > + () + } + > + ) } } -export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(InfosIndex) )); \ No newline at end of file +export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(InfosIndex))); \ No newline at end of file diff --git a/src/modules/user/usersInfo/InfosPackage.js b/src/modules/user/usersInfo/InfosPackage.js index 903353e21..ec1659c96 100644 --- a/src/modules/user/usersInfo/InfosPackage.js +++ b/src/modules/user/usersInfo/InfosPackage.js @@ -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() { diff --git a/src/modules/user/usersInfo/publicCreatNew.js b/src/modules/user/usersInfo/publicCreatNew.js index da89143df..be365b10c 100644 --- a/src/modules/user/usersInfo/publicCreatNew.js +++ b/src/modules/user/usersInfo/publicCreatNew.js @@ -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 ( -
    + return ( +
    -
    - {this.props.Createtype==="projects"?this.getUser(href,name)}> +
    + {this.props.Createtype === "projects" ? this.getUser(href, name)}>
    -
    : this.getUsers(href,name)}> -
    -
    -
    -
    -
    } -
    -
    -
    - - {name} - -
    -
    -
    - ) - } + : this.getUsers(href, name)}> +
    +
    +
    +
    +
    } +
    +
    +
    + + {name} + +
    +
    +
    + ) + } } export default publicCreateNew; diff --git a/src/modules/user/usersInfo/usersInfo.css b/src/modules/user/usersInfo/usersInfo.css index 4755c6c7a..dbe344298 100644 --- a/src/modules/user/usersInfo/usersInfo.css +++ b/src/modules/user/usersInfo/usersInfo.css @@ -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;