Commit 069ac0c5 by FE

del build

parents ee41d3c9 a97be348
...@@ -65,9 +65,10 @@ class Classify extends Component { ...@@ -65,9 +65,10 @@ class Classify extends Component {
// 获取课程接口 // 获取课程接口
getList = () => { getList = () => {
const _this = this
http.get(`${API.home}/m/course/list/${getParam('id')}`).then((res) => { http.get(`${API.home}/m/course/list/${getParam('id')}`).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ _this.setState({
data: res.data.data, data: res.data.data,
isLoading: false isLoading: false
}) })
...@@ -173,10 +174,10 @@ class Classify extends Component { ...@@ -173,10 +174,10 @@ class Classify extends Component {
</div> </div>
) )
return ( return (
<VList <VList
key={index} key={index}
status={status} status={status}
img={item.image_name} img={item.image_name}
id={item.course_id} id={item.course_id}
info={Info} info={Info}
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
......
...@@ -20,9 +20,11 @@ class OutLine extends Component { ...@@ -20,9 +20,11 @@ class OutLine extends Component {
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
} }
componentDidMount() { tabchange = (tab, index) => {
this.getList() if(index === 1) {
} this.getList()
}
};
// 获取大纲数据 // 获取大纲数据
getList = () => { getList = () => {
...@@ -49,7 +51,10 @@ class OutLine extends Component { ...@@ -49,7 +51,10 @@ class OutLine extends Component {
return ( return (
<div className='course-detail'> <div className='course-detail'>
<WhiteSpace/> <WhiteSpace/>
<Tabs tabs={tabs}> <Tabs tabs={tabs}
initialPage={0}
onChange={(tab, index) => { this.tabchange(tab, index) }}
>
{/*介绍*/} {/*介绍*/}
<div className='introduce'> <div className='introduce'>
<p>讲师:{introduce.teachers}</p> <p>讲师:{introduce.teachers}</p>
......
...@@ -77,7 +77,7 @@ class Search extends PureComponent { ...@@ -77,7 +77,7 @@ class Search extends PureComponent {
</Link> </Link>
) )
}) })
: <div style={{textAlign: 'center', padding: '20px',fontSize: '12px'}}>暂无历史</div> : <div className={'no_search_history'} style={{textAlign: 'center', padding: '20px'}}>暂无历史</div>
} }
</div> </div>
</div> </div>
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
.search-tag { .search-tag {
overflow: hidden; overflow: hidden;
} }
.no_search_history {
font-size: 12px;
}
} }
.search-hot { .search-hot {
......
import React, {Component} from 'react' import React, { Component } from 'react'
import HeaderBar from '@/common/HeaderBar' import HeaderBar from '@/common/HeaderBar'
import './video.scss' import './video.scss'
import { NavLink, Route, Redirect, Switch } from 'react-router-dom' import { NavLink, Route, Redirect, Switch, Link } from 'react-router-dom'
import { http, getParam } from '@/utils' import { http, getParam } from '@/utils'
import Recommendation from './recommendation' import Recommendation from './recommendation'
import VideoCatalog from './video-catalog' import VideoCatalog from './video-catalog'
import DatumCatalog from './datum-catalog' import DatumCatalog from './datum-catalog'
import {Toast} from 'antd-mobile' import { Toast } from 'antd-mobile'
import videojs from 'video.js' import videojs from 'video.js'
import 'video.js/dist/video-js.min.css' import 'video.js/dist/video-js.min.css'
import {Modal} from "antd-mobile" import { Modal } from "antd-mobile"
import {Loading} from '@/common' import { Loading } from '@/common'
import {connect} from "react-redux" import { connect } from "react-redux"
import jsCookie from 'js-cookie' import jsCookie from 'js-cookie'
import io from 'socket.io-client' import io from 'socket.io-client'
import Single from "@/components/detail/single"; import Single from "@/components/detail/single";
...@@ -19,6 +19,7 @@ import Single from "@/components/detail/single"; ...@@ -19,6 +19,7 @@ import Single from "@/components/detail/single";
let alert = Modal.alert let alert = Modal.alert
function ProgressShareModal(props) { function ProgressShareModal(props) {
console.log(props.data.url);
return ( return (
props.isShow && props.isShow &&
<div className='progress-share-modal-wrapper'> <div className='progress-share-modal-wrapper'>
...@@ -39,12 +40,16 @@ function ProgressShareModal(props) { ...@@ -39,12 +40,16 @@ function ProgressShareModal(props) {
<div className="title">分享到</div> <div className="title">分享到</div>
<ul> <ul>
<li className='share-icon'> <li className='share-icon'>
<div className="icon"><i className='iconfont iconweixinzhifu'></i></div> <a style={{display: 'block'}} href={props.data.url}>
<div className='text'>微信好友</div> <div className="icon"><i className='iconfont iconweixinzhifu'/></div>
<div className='text'>微信好友</div>
</a>
</li> </li>
<li className='share-icon'> <li className='share-icon'>
<div className="icon"><i className='iconfont iconpengyouquaniconx'></i></div> <a style={{display: 'block'}} href={props.data.url}>
<div className='text'>朋友圈</div> <div className="icon"><i className='iconfont iconpengyouquaniconx'/></div>
<div className='text'>朋友圈</div>
</a>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -96,6 +101,10 @@ class Video extends Component { ...@@ -96,6 +101,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 +126,6 @@ class Video extends Component { ...@@ -117,7 +126,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 +140,10 @@ class Video extends Component { ...@@ -132,8 +140,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 +230,7 @@ class Video extends Component { ...@@ -220,7 +230,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,12 +310,13 @@ class Video extends Component { ...@@ -300,12 +310,13 @@ class Video extends Component {
return return
} }
this.countSchedule()
this.setState({ this.setState({
activeIndex: index activeIndex: index
}, },
() => { () => {
if(this.hasAuth()){ if (this.hasAuth()) {
this.setPlayerSrc(this.state.videoList[index]['play_url']) this.setPlayerSrc(this.state.videoList[index]['play_url'])
this.sendLastRecord() this.sendLastRecord()
this.playVideo() this.playVideo()
...@@ -371,7 +382,7 @@ class Video extends Component { ...@@ -371,7 +382,7 @@ class Video extends Component {
} }
setPlayerSrc = src => { setPlayerSrc = src => {
if(!this.player){ if (!this.player) {
this.initializePlayer() this.initializePlayer()
} }
this.player.src({ this.player.src({
...@@ -512,7 +523,7 @@ class Video extends Component { ...@@ -512,7 +523,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)
课后练习:{item.practice.title} ? <Link to={{
<i className={classnames('iconfont', item.practice.is_tested ? 'iconiconfront-3' : 'iconiconfront-74')}/> pathname: '/campTest',
{/*<i className='iconfont iconiconfront-74'/>*/} search: `?keshi_id=${item.id}&qid=${item.practice.qid}`
</div> }}>
<div className="exercise">
课后练习:{item.practice.title}
<i className={classnames('iconfont', item.practice.is_tested ? 'iconiconfront-3' : 'iconiconfront-74')}/>
</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