Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
354acf13
Commit
354acf13
authored
Jun 20, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频播放页
parent
24890872
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
src/components/study/freeCourses/index.js
+2
-1
src/components/video/index.js
+8
-5
src/components/video/recommendation/index.js
+3
-7
No files found.
src/components/study/freeCourses/index.js
View file @
354acf13
...
...
@@ -4,6 +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
'./free-courses.scss'
...
...
@@ -40,7 +41,7 @@ class FreeCourse extends PureComponent {
let
data
=
res
.
data
if
(
data
.
code
==
200
)
{
this
.
setState
({
live
:
data
.
data
live
:
isEmpty
(
data
.
data
)
?
[]
:
data
.
data
})
}
else
{
Toast
.
info
(
data
.
msg
,
2
,
null
,
false
)
...
...
src/components/video/index.js
View file @
354acf13
...
...
@@ -22,7 +22,7 @@ class Video extends Component {
state
=
{
title
:
'
视频
'
,
title
:
''
,
courseId
:
null
,
video_catalog
:
[],
datum
:
[],
...
...
@@ -30,7 +30,8 @@ class Video extends Component {
activeIndex
:
0
,
isAuth
:
true
,
course
:
null
,
salePrice
:
null
salePrice
:
null
,
vCourseId
:
null
}
...
...
@@ -87,7 +88,9 @@ class Video extends Component {
video_catalog
:
data
.
data
[
'lessons'
],
currentVideoSrc
:
data
.
data
[
'lessons'
][
state
.
activeIndex
][
'play_url'
],
course
:
data
.
data
.
course
,
courseId
:
data
.
data
.
course
[
'course_id'
]
courseId
:
data
.
data
.
course
[
'course_id'
],
vCourseId
:
data
.
data
.
course
[
'v_course_id'
],
title
:
data
.
data
.
course
[
'course_title'
]
}),
()
=>
{
if
(
this
.
lessonAvailable
())
{
...
...
@@ -201,7 +204,7 @@ class Video extends Component {
const
{
video_catalog
,
activeIndex
,
isAuth
,
salePrice
}
=
this
.
state
return
(
<
div
className
=
'play'
>
<
HeaderBar
title
=
{
this
.
state
.
title
}
/
>
<
HeaderBar
title
=
{
this
.
state
.
title
}
arrow
=
{
true
}
/
>
<
div
className
=
"video"
>
<
video
className
=
{
'video-js'
}
ref
=
{
el
=>
this
.
video
=
el
}
>
<
source
src
=
{
'/'
}
type
=
'application/x-mpegURL'
/>
...
...
@@ -251,7 +254,7 @@ class Video extends Component {
}}
/
>
<
/Switch
>
<
Route
render
=
{
props
=>
{
return
this
.
state
.
courseId
?
<
Recommendation
{...
props
}
courseId
=
{
this
.
state
.
c
ourseId
}
/
>
return
this
.
state
.
vCourseId
?
<
Recommendation
{...
props
}
vCourseId
=
{
this
.
state
.
vC
ourseId
}
/
>
:
null
}}
/
>
<
/div
>
...
...
src/components/video/recommendation/index.js
View file @
354acf13
...
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
'./recommendation.scss'
import
{
http
,
api
}
from
'@/utils'
import
{
Toast
}
from
"antd-mobile"
;
import
{
VList
}
from
'@/common
'
;
import
VList
from
'@/common/v-list-base
'
;
...
...
@@ -29,12 +29,8 @@ class Recommendation extends PureComponent {
this
.
getRecommendation
()
}
componentDidUpdate
(
prevProps
,
prevState
)
{
console
.
log
(
prevProps
,
this
.
props
);
}
getRecommendation
=
()
=>
{
http
.
get
(
`
${
api
.
home
}
/m/play/recommend_course/
${
this
.
props
.
c
ourseId
}
?num=
${
this
.
state
.
num
}
`
)
http
.
get
(
`
${
api
.
home
}
/m/play/recommend_course/
${
this
.
props
.
vC
ourseId
}
?num=
${
this
.
state
.
num
}
`
)
.
then
(
res
=>
{
const
data
=
res
.
data
if
(
data
.
code
===
200
){
...
...
@@ -51,7 +47,7 @@ class Recommendation extends PureComponent {
handleClick
=
id
=>
{
console
.
log
(
id
)
this
.
props
.
history
.
push
(
`/detail?id=
${
id
}
`
)
}
render
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment