courseware
杨树林 5 years ago
parent 12426137d0
commit 8c3bf79c23

@ -258,7 +258,7 @@ class Video extends Component {
console.log(course_identity > 2 && item.user_id === user_id) console.log(course_identity > 2 && item.user_id === user_id)
return ( return (
<VideoInReviewItem <VideoInReviewItem
Setmyktid={(id)=>this.props.Setmyktid(id)} Setmyktid={(id,title)=>this.props.Setmyktid(id,title)}
mykt={this.props.mykt} mykt={this.props.mykt}
{...this.props} {...this.props}
{...this.state} {...this.state}

@ -42,6 +42,7 @@ class VideoIndex extends Component {
liveVisible: false, liveVisible: false,
statistics: false, statistics: false,
myktid:null, myktid:null,
mytitle:''
} }
} }
@ -56,11 +57,24 @@ class VideoIndex extends Component {
this.getLiveList(page); this.getLiveList(page);
} }
} }
Setmyktid=(id)=>{ Setmyktid=(id,title)=>{
const isAdmin = this.props&& this.props.isAdmin();
if(isAdmin===true){
this.setState({ this.setState({
myktid:id myktid:id,
statistics:true,
mytitle:title,
})
}else{
this.setState({
statistics:true,
myktid:null,
mytitle:"",
}) })
} }
}
componentDidMount = () => { componentDidMount = () => {
const {search} = this.props.location; const {search} = this.props.location;
const {page} = this.state; const {page} = this.state;
@ -84,6 +98,8 @@ class VideoIndex extends Component {
if(this.props.homedirectory ===true){ if(this.props.homedirectory ===true){
this.setState({ this.setState({
statistics:false, statistics:false,
myktid:null,
mytitle:"",
}) })
} }
} }
@ -260,12 +276,14 @@ class VideoIndex extends Component {
this.setState({ this.setState({
statistics: bool, statistics: bool,
myktid:null,
mytitle:"",
}) })
} }
render() { render() {
const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state; const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics,myktid} = this.state;
const {coursesId, videoId} = this.props.match.params; const {coursesId, videoId} = this.props.match.params;
let {course_identity} = this.props && this.props.coursedata; let {course_identity} = this.props && this.props.coursedata;
let is_teacher = this.props && this.props.user && this.props.user.is_teacher; let is_teacher = this.props && this.props.user && this.props.user.is_teacher;
@ -382,8 +400,16 @@ class VideoIndex extends Component {
</div> </div>
</div> </div>
: :
(
myktid===null||myktid===undefined?
<Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics> <Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics>
:
<Videostatisticscomtwo {...this.state} {...this.props} tisid={myktid} mytitle={mytitle} tisticsbools={(b,id,t)=>this.tisticsbools(b,id,t)}></Videostatisticscomtwo>
)
} }
@ -394,7 +420,7 @@ class VideoIndex extends Component {
type === "video" ? type === "video" ?
<Videos <Videos
mykt={"mykt"} mykt={"mykt"}
Setmyktid={(id)=>this.Setmyktid(id)} Setmyktid={(id,title)=>this.Setmyktid(id,title)}
upload={upload} upload={upload}
videos={videos} videos={videos}
page={page} page={page}

Loading…
Cancel
Save