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
aded84d4
Commit
aded84d4
authored
Jun 21, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video
parent
28f7a32d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
33 deletions
+45
-33
src/common/index.js
+1
-0
src/components/video/index.js
+44
-33
No files found.
src/common/index.js
View file @
aded84d4
...
...
@@ -6,5 +6,6 @@ export { default as HeaderBar } from './HeaderBar'
export
{
default
as
CallApp
}
from
'./CallApp'
export
{
default
as
Captcha
}
from
'./Captcha'
export
{
default
as
ClearableInput
}
from
"./ClearableInput"
;
export
{
default
as
Loading
}
from
'./Loading'
src/components/video/index.js
View file @
aded84d4
...
...
@@ -10,6 +10,7 @@ import { Toast } from 'antd-mobile';
import
videojs
from
'video.js'
import
'video.js/dist/video-js.min.css'
import
{
Modal
}
from
"antd-mobile"
;
import
{
Loading
}
from
'@/common'
let
alert
=
Modal
.
alert
...
...
@@ -31,7 +32,8 @@ class Video extends Component {
isAuth
:
true
,
course
:
null
,
salePrice
:
null
,
vCourseId
:
null
vCourseId
:
null
,
isLoading
:
true
}
...
...
@@ -58,6 +60,10 @@ class Video extends Component {
}
componentDidUpdate
(
prevProps
,
prevState
)
{
console
.
log
(
this
.
video
);
}
componentWillUnmount
()
{
if
(
this
.
player
)
{
...
...
@@ -90,13 +96,16 @@ class Video extends Component {
course
:
data
.
data
.
course
,
courseId
:
data
.
data
.
course
[
'course_id'
],
vCourseId
:
data
.
data
.
course
[
'v_course_id'
],
title
:
data
.
data
.
course
[
'course_title'
]
title
:
data
.
data
.
course
[
'course_title'
],
isLoading
:
false
}),
()
=>
{
if
(
this
.
lessonAvailable
())
{
if
(
this
.
hasAuth
(
this
.
state
.
activeIndex
))
{
this
.
initializePlayer
()
this
.
playWithAuth
()
Promise
.
resolve
().
then
(()
=>
{
this
.
initializePlayer
()
this
.
playWithAuth
()
})
}
else
{
this
.
getCoursePrice
();
}
...
...
@@ -205,38 +214,40 @@ class Video extends Component {
return
(
<
div
className
=
'play'
>
<
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'
/>
<
/video
>
{
!
isAuth
&&
(
<
div
className
=
"purchase-box"
>
<
div
className
=
'hint'
>
您尚未购买该课时,请购买后学习。
<
/div
>
<
div
className
=
'btns'
>
<
button
type
=
'button'
className
=
'purchase-class'
>
¥
{
salePrice
}
购买课程
<
/button
>
<
button
type
=
'button'
className
=
'purchase-episode'
>
¥
{
video_catalog
.
length
&&
video_catalog
[
activeIndex
][
'class_price'
]}
购买单集
<
/button
>
<
Loading
isLoading
=
{
this
.
state
.
isLoading
}
>
<
div
className
=
"video"
>
<
video
className
=
{
'video-js'
}
ref
=
{
el
=>
this
.
video
=
el
}
>
<
source
src
=
{
'/'
}
type
=
'application/x-mpegURL'
/>
<
/video
>
{
!
isAuth
&&
(
<
div
className
=
"purchase-box"
>
<
div
className
=
'hint'
>
您尚未购买该课时,请购买后学习。
<
/div
>
<
div
className
=
'btns'
>
<
button
type
=
'button'
className
=
'purchase-class'
>
¥
{
salePrice
}
购买课程
<
/button
>
<
button
type
=
'button'
className
=
'purchase-episode'
>
¥
{
video_catalog
.
length
&&
video_catalog
[
activeIndex
][
'class_price'
]}
购买单集
<
/button
>
<
/div
>
<
/div
>
<
/div
>
)
}
<
/div
>
<
div
className
=
'tab'
>
<
div
>
<
NavLink
to
=
{
`
${
match
.
url
}
/video`
}
replace
activeClassName
=
'active'
>
视频
<
/NavLink
>
)
}
<
/div
>
<
div
>
<
NavLink
to
=
{
`
${
match
.
url
}
/datum`
}
replace
activeClassName
=
'active'
>
资料
<
/NavLink
>
<
div
className
=
'tab'
>
<
div
>
<
NavLink
to
=
{
`
${
match
.
url
}
/video`
}
replace
activeClassName
=
'active'
>
视频
<
/NavLink
>
<
/div
>
<
div
>
<
NavLink
to
=
{
`
${
match
.
url
}
/datum`
}
replace
activeClassName
=
'active'
>
资料
<
/NavLink
>
<
/div
>
<
/div
>
<
/
div
>
<
/
Loading
>
<
Switch
>
<
Redirect
exact
from
=
{
'/play'
}
to
=
{{
pathname
:
'/play/video'
,
...
...
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