Commit e0291119 by zhanghaozhe

视频目录课后练习

parent ebb03714
......@@ -96,6 +96,10 @@ class Video extends Component {
componentDidMount() {
this.courseID = getParam('id')
if(!this.courseID){
this.props.history.replace('/')
return
}
this.setState({
courseId: this.courseID
})
......@@ -117,7 +121,6 @@ class Video extends Component {
}
// 购买单集
toSingleset = (item) => {
console.log(item)
this.setState({
singleBox: true,
singMess: item
......@@ -132,8 +135,10 @@ class Video extends Component {
setupRecord = () => {
this.recordSocket = io(API.record, {
transports: ['websocket']
transports: ['websocket'],
forceNew: true
})
// this.recordSocket = io(API.record)
this.recordSocket.on('seek', time => {
this.player.currentTime(time)
})
......@@ -220,7 +225,7 @@ class Video extends Component {
v_course_id: vCourseId,
uid: this.props.user.data.uid,
token: this.token,
platform: 5
platform: 0
})
}
......@@ -300,6 +305,7 @@ class Video extends Component {
return
}
this.countSchedule()
this.setState({
activeIndex: index
......@@ -512,7 +518,7 @@ class Video extends Component {
return <VideoCatalog
activeIndex={this.state.activeIndex}
selectVideo={this.selectVideo}
videoCatalog={this.state.videoList}
videoCatalog={videoList}
{...props}/>
}}/>
<Route path={`${match.path}/datum`} render={props => {
......
import React, { Component } from 'react'
import './video-catalog.scss'
import { Link } from "react-router-dom";
import classnames from 'classnames'
......@@ -29,11 +30,16 @@ class VideoCatalog extends Component {
)}/>
</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}
<i className={classnames('iconfont', item.practice.is_tested ? 'iconiconfront-3' : 'iconiconfront-74')}/>
{/*<i className='iconfont iconiconfront-74'/>*/}
</div>
</Link>
: null
}
</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