Commit a66e5df4 by zhanghaozhe

直播状态

parent a5373bf5
......@@ -10,10 +10,14 @@
left: 0;
}
.tag-starting {
.tag-soon {
background: $red;
color: $white;
}
.tag-soon {
background: $active;
color: $white;
}
.tag-category {
background: #E0B97B;
......
......@@ -4,7 +4,7 @@ import Course from '@/common/course-base'
import { http, api } from '@/utils'
import { Toast } from "antd-mobile";
import classnames from 'classnames'
import {isEmpty} from 'lodash'
import { isEmpty } from 'lodash'
import './free-courses.scss'
......@@ -61,6 +61,15 @@ class FreeCourse extends PureComponent {
return http.get(`${api.home}/m/live/free_list`)
}
toLive = live => {
const {room_id, live_status} = live
if (live_status) {
window.location.assign(`http://www-test.julyedu.com/live/m_room/${room_id}`)
} else {
Toast.info('直播即将开始,敬请期待', 2, null, false)
}
}
render() {
return (
<ul className='free-courses'>
......@@ -76,17 +85,20 @@ class FreeCourse extends PureComponent {
<div className="time">{`${item['live_start_time']}`}</div>
</div>
)
const LiveStatus = (
item['live_status'] ? <Tag className={'tag-soon top'}>即将开始</Tag> :
<Tag className={'tag-playing top'}>正在直播</Tag>
)
return (
<Course
img={item['live_cover']}
title={item['live_title']}
top={
<Tag className={'tag-starting top'}>即将开始</Tag>
}
top={LiveStatus}
bottom={Bottom}
key={item['live_id']}
className={'live'}
handleClick={this.handleClick}
handleClick={this.toLive.bind(this, item)}
id={index}
/>
)
......
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