Commit e0291119 by zhanghaozhe

视频目录课后练习

parent ebb03714
...@@ -96,6 +96,10 @@ class Video extends Component { ...@@ -96,6 +96,10 @@ class Video extends Component {
componentDidMount() { componentDidMount() {
this.courseID = getParam('id') this.courseID = getParam('id')
if(!this.courseID){
this.props.history.replace('/')
return
}
this.setState({ this.setState({
courseId: this.courseID courseId: this.courseID
}) })
...@@ -117,7 +121,6 @@ class Video extends Component { ...@@ -117,7 +121,6 @@ class Video extends Component {
} }
// 购买单集 // 购买单集
toSingleset = (item) => { toSingleset = (item) => {
console.log(item)
this.setState({ this.setState({
singleBox: true, singleBox: true,
singMess: item singMess: item
...@@ -132,8 +135,10 @@ class Video extends Component { ...@@ -132,8 +135,10 @@ class Video extends Component {
setupRecord = () => { setupRecord = () => {
this.recordSocket = io(API.record, { this.recordSocket = io(API.record, {
transports: ['websocket'] transports: ['websocket'],
forceNew: true
}) })
// this.recordSocket = io(API.record)
this.recordSocket.on('seek', time => { this.recordSocket.on('seek', time => {
this.player.currentTime(time) this.player.currentTime(time)
}) })
...@@ -220,7 +225,7 @@ class Video extends Component { ...@@ -220,7 +225,7 @@ class Video extends Component {
v_course_id: vCourseId, v_course_id: vCourseId,
uid: this.props.user.data.uid, uid: this.props.user.data.uid,
token: this.token, token: this.token,
platform: 5 platform: 0
}) })
} }
...@@ -300,6 +305,7 @@ class Video extends Component { ...@@ -300,6 +305,7 @@ class Video extends Component {
return return
} }
this.countSchedule()
this.setState({ this.setState({
activeIndex: index activeIndex: index
...@@ -512,7 +518,7 @@ class Video extends Component { ...@@ -512,7 +518,7 @@ class Video extends Component {
return <VideoCatalog return <VideoCatalog
activeIndex={this.state.activeIndex} activeIndex={this.state.activeIndex}
selectVideo={this.selectVideo} selectVideo={this.selectVideo}
videoCatalog={this.state.videoList} videoCatalog={videoList}
{...props}/> {...props}/>
}}/> }}/>
<Route path={`${match.path}/datum`} render={props => { <Route path={`${match.path}/datum`} render={props => {
......
import React, { Component } from 'react' import React, { Component } from 'react'
import './video-catalog.scss' import './video-catalog.scss'
import { Link } from "react-router-dom";
import classnames from 'classnames' import classnames from 'classnames'
...@@ -29,11 +30,16 @@ class VideoCatalog extends Component { ...@@ -29,11 +30,16 @@ class VideoCatalog extends Component {
)}/> )}/>
</div> </div>
{ {
(item.practice && item.practice.qid) ? <div className="exercise"> (item.practice && item.practice.qid)
? <Link to={{
pathname: '/campTest',
search: `?keshi_id=${item.id}&qid=${item.practice.qid}`
}}>
<div className="exercise">
课后练习:{item.practice.title} 课后练习:{item.practice.title}
<i className={classnames('iconfont', item.practice.is_tested ? 'iconiconfront-3' : 'iconiconfront-74')}/> <i className={classnames('iconfont', item.practice.is_tested ? 'iconiconfront-3' : 'iconiconfront-74')}/>
{/*<i className='iconfont iconiconfront-74'/>*/}
</div> </div>
</Link>
: null : null
} }
</li> </li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment