dev_cs_new
hjm 6 years ago
parent 8afa209ea8
commit 5b28c51d76

@ -65,3 +65,5 @@ export { default as ImageLayerHook } from './hooks/ImageLayerHook'
export { default as CBreadcrumb } from '../modules/courses/common/CBreadcrumb'
export { CNotificationHOC as CNotificationHOC } from '../modules/courses/common/CNotificationHOC'
export { default as ModalWrapper } from '../modules/courses/common/ModalWrapper'
export { default as NoneData } from '../modules/courses/coursesPublic/NoneData'

@ -6,8 +6,9 @@ class NoneData extends Component{
super(props)
}
render(){
const { style } = this.props;
return(
<div className="edu-tab-con-box clearfix edu-txt-center">
<div className="edu-tab-con-box clearfix edu-txt-center" style={style}>
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div>

@ -104,11 +104,11 @@ class InfosBanner extends Component{
onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link>
</li>
<li className={`${moduleName == 'videoes' ? 'active' : '' }`}>
{/* <li className={`${moduleName == 'videoes' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'videoes'})}
to={`/users/${username}/videoes`}>视频</Link>
</li>
</li> */}
</div>
</div>
</div>

@ -1,7 +1,7 @@
import React, { useState, useEffect, useContext, useRef, memo } from 'react';
import {Link} from 'react-router-dom';
import { Pagination, Input, Button } from 'antd'
import { getUrl2, isDev, ThemeContext, ActionBtn } from 'educoder'
import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder'
import axios from 'axios'
import VideoInReviewItem from './VideoInReviewItem'
import EditVideoModal from './EditVideoModal'
@ -50,9 +50,10 @@ const _items=[
{key: 'published_at-asc', name: '最早上传'},
]
function InfoVideo (props) {
const [videoes, setVideoes] = useState([])
const [reviewVideoes, setReviewVideoes] = useState([])
const [videoes, setVideoes] = useState(undefined)
const [reviewVideoes, setReviewVideoes] = useState(undefined)
const [count, setCount] = useState(0)
const [loading, setLoading] = useState(true)
const [sortKey, setSortKey] = useState(_items[0].key)
const editModalObj = useModal(false)
@ -73,6 +74,7 @@ function InfoVideo (props) {
function fetchVideoes() {
const fetchUrl = `/users/${username}/videos.json`
const sorts = sortKey.split('-')
setLoading(true)
axios.get(fetchUrl, {
params: {
page: pageObj.current,
@ -83,6 +85,7 @@ function InfoVideo (props) {
}
})
.then((response) => {
setLoading(false)
if (response.data.videos) {
setVideoes(response.data.videos)
setCount(response.data.count)
@ -93,12 +96,14 @@ function InfoVideo (props) {
}
function fetchReviewVideoes() {
const fetchUrl = `/users/${username}/videos/review.json`
setLoading(true)
axios.get(fetchUrl, {
params: {
per_page: 200
}
})
.then((response) => {
setLoading(false)
if (response.data.videos) {
setReviewVideoes(response.data.videos)
setCount(response.data.count)
@ -271,9 +276,13 @@ function InfoVideo (props) {
></CRoundSelect>}
</div>
{categoryObj.category == 'all' ?
<div className="itemWrap">
{videoes.map((item, index) => {
{
videoes == undefined ? '' :
videoes.length ?
videoes.map((item, index) => {
return (<VideoInReviewItem
{...props}
@ -285,11 +294,16 @@ function InfoVideo (props) {
>
</VideoInReviewItem>)
})}
})
: <NoneData style={{width: '100%'}}></NoneData>
}
</div>
:
<div className="itemWrap">
{reviewVideoes.map((item, index) => {
{
videoes == undefined ? '' :
videoes.length ?
reviewVideoes.map((item, index) => {
return (<VideoInReviewItem
{...props}
@ -298,7 +312,9 @@ function InfoVideo (props) {
isReview={true}
>
</VideoInReviewItem>)
})}
})
: <NoneData style={{width: '100%'}}></NoneData>
}
</div>
}

Loading…
Cancel
Save