|
|
|
@ -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>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|