Commit 6fccff3b by zhanghaozhe

直播底部修改

parent fb665f8d
......@@ -25,8 +25,8 @@ class FreeCourse extends PureComponent {
componentDidMount() {
this.getFreeCourses()
.then(res => {
if (res.data.code == 200) {
const data = res.data
let data = res.data
if (data.code == 200) {
this.setState({
courses: data.data,
})
......@@ -36,12 +36,13 @@ class FreeCourse extends PureComponent {
})
this.getFreeLive()
.then(res => {
if (res.data.code == 200) {
let data = res.data
if (data.code == 200) {
this.setState({
live: res.data.data
live: data.data
})
} else {
Toast.info(res.data.msg)
Toast.info(data.msg, 2, null, false)
}
})
}
......@@ -58,19 +59,6 @@ class FreeCourse extends PureComponent {
return (
<ul className='free-courses'>
{
this.state.courses.map((item, index) => (
<Course
img={item.logo}
title={item['video_course_name']}
bottom={
<Bottom audience={item['play_times']} className={'tag-category'} text={item.category}/>
}
id={item['v_course_id']}
key={index}
/>
))
}
{
this.state.live.map((item, index) => {
const Bottom = (
<div className="bottom">
......@@ -79,12 +67,12 @@ class FreeCourse extends PureComponent {
return <i key={index} className={classnames('column', `column-${index + 1}`)}/>
})}
</div>
<div className="time">{`直播:${item['live_start_time']}`}</div>
<div className="time">{`${item['live_start_time']}`}</div>
</div>
)
return (
<Course
img={item['live_img']}
img={item['live_cover']}
title={item['live_title']}
top={
<Tag className={'tag-starting top'}>即将开始</Tag>
......@@ -96,6 +84,19 @@ class FreeCourse extends PureComponent {
)
})
}
{
this.state.courses.map((item, index) => (
<Course
img={item.logo}
title={item['video_course_name']}
bottom={
<Bottom audience={item['play_times']} className={'tag-category'} text={item.category}/>
}
id={item['v_course_id']}
key={index}
/>
))
}
</ul>
)
}
......
......@@ -7,6 +7,7 @@ import FreeCourses from './freeCourses'
import WithTab from '@/HOCs/WithTab'
import WithFullSize from '@/HOCs/WithFullSize'
import { compose } from 'redux'
import PrivateRoute from '@/router/privateRoute'
class Study extends Component {
......@@ -45,11 +46,11 @@ class Study extends Component {
<Switch>
<Redirect exact from='/study' to='study/my-course'/>
<Route path={`${this.props.match.path}/my-course`} component={MyCourses}/>
{/*<PrivateRoute path={`${this.props.match.path}/my-course`} component={MyCourses}/>*/}
<Route path={`${this.props.match.path}/free-course`} component={FreeCourses}/>
{/*<Route path={`${this.props.match.path}/my-course`} render={props => {
<MyCourses storeScrollPosition={this.storeScrollPosition}/>
}}/>*/}
<Route path={`${this.props.match.path}/free-course`} component={FreeCourses}/>
</Switch>
</div>
</section>
......
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