|
|
|
@ -28,6 +28,9 @@ class VideoIndex extends Component{
|
|
|
|
|
lives:undefined,
|
|
|
|
|
liveData:undefined,
|
|
|
|
|
|
|
|
|
|
my_liveId:undefined,
|
|
|
|
|
liveId:undefined,
|
|
|
|
|
|
|
|
|
|
liveVisible:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -50,6 +53,10 @@ class VideoIndex extends Component{
|
|
|
|
|
}
|
|
|
|
|
// 获取直播列表
|
|
|
|
|
getLiveList=(page)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
lives:undefined,
|
|
|
|
|
isSpining:true
|
|
|
|
|
})
|
|
|
|
|
const CourseId=this.props.match.params.coursesId;
|
|
|
|
|
const url = `/courses/${CourseId}/live_links.json`;
|
|
|
|
|
axios.get(url,{
|
|
|
|
@ -62,7 +69,9 @@ class VideoIndex extends Component{
|
|
|
|
|
this.setState({
|
|
|
|
|
liveData:result.data,
|
|
|
|
|
lives:result.data.lives,
|
|
|
|
|
isSpining:false
|
|
|
|
|
isSpining:false,
|
|
|
|
|
my_liveId:result.data.my_live_id,
|
|
|
|
|
liveId:result.data.my_live_id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch(error=>{
|
|
|
|
@ -132,7 +141,8 @@ class VideoIndex extends Component{
|
|
|
|
|
if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) {
|
|
|
|
|
this.setState({
|
|
|
|
|
type:"video",
|
|
|
|
|
upload:true
|
|
|
|
|
upload:true,
|
|
|
|
|
page:1
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.props.showProfessionalCertificationDialog();
|
|
|
|
@ -140,12 +150,20 @@ class VideoIndex extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 直播设置后回调的方法
|
|
|
|
|
successFunc=()=>{
|
|
|
|
|
// successFunc=()=>{
|
|
|
|
|
// this.setState({
|
|
|
|
|
// type:"live",
|
|
|
|
|
// page:1
|
|
|
|
|
// })
|
|
|
|
|
// this.checkType("live",1);
|
|
|
|
|
// }
|
|
|
|
|
// 直播设置
|
|
|
|
|
liveSetting=()=>{
|
|
|
|
|
const { my_liveId } = this.state;
|
|
|
|
|
this.setState({
|
|
|
|
|
type:"live",
|
|
|
|
|
page:1
|
|
|
|
|
liveId:my_liveId
|
|
|
|
|
})
|
|
|
|
|
this.checkType("live",1);
|
|
|
|
|
this.setliveVisibel(true);
|
|
|
|
|
}
|
|
|
|
|
//直播设置弹框
|
|
|
|
|
setliveVisibel=(flag,changetypeFlag)=>{
|
|
|
|
@ -156,13 +174,21 @@ class VideoIndex extends Component{
|
|
|
|
|
this.checkType("live",1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 列表-编辑(修改传到编辑的id)
|
|
|
|
|
setLiveId=(id)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
liveId:id
|
|
|
|
|
})
|
|
|
|
|
this.setliveVisibel(true);
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
const { videos , upload , videoData , type , liveData , lives , liveVisible , isSpining } = this.state;
|
|
|
|
|
const { videos , upload , videoData , type , liveData , lives , page , liveVisible , isSpining , liveId } = this.state;
|
|
|
|
|
const { admin , is_teacher } = this.props.user;
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<LivesNew
|
|
|
|
|
visible={liveVisible}
|
|
|
|
|
liveId={liveId}
|
|
|
|
|
setliveVisibel={this.setliveVisibel}
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
@ -185,7 +211,7 @@ class VideoIndex extends Component{
|
|
|
|
|
:
|
|
|
|
|
<WordsBtn style="blue" className="font-16" onClick={this.toUpload}>上传视频</WordsBtn>
|
|
|
|
|
}
|
|
|
|
|
<WordsBtn style="blue" className="font-16 ml30" onClick={()=>this.setliveVisibel(true)}>直播设置</WordsBtn>
|
|
|
|
|
<WordsBtn style="blue" className="font-16 ml30" onClick={this.liveSetting}>直播设置</WordsBtn>
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
@ -196,6 +222,7 @@ class VideoIndex extends Component{
|
|
|
|
|
<Videos
|
|
|
|
|
upload={upload}
|
|
|
|
|
videos={videos}
|
|
|
|
|
page={page}
|
|
|
|
|
data={videoData}
|
|
|
|
|
pageSize={PAGE_SIZE}
|
|
|
|
|
uploadVideo={this.uploadVideo}
|
|
|
|
@ -208,9 +235,11 @@ class VideoIndex extends Component{
|
|
|
|
|
<Lives
|
|
|
|
|
lives={lives}
|
|
|
|
|
liveData={liveData}
|
|
|
|
|
page={page}
|
|
|
|
|
pageSize={LIVE_PAGE_SIZE}
|
|
|
|
|
successFunc={this.getLiveList}
|
|
|
|
|
changePage={this.changePage}
|
|
|
|
|
setLiveId={this.setLiveId}
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
></Lives>
|
|
|
|
|