Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
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
李俊赕
self-support
Commits
c92090d3
Commit
c92090d3
authored
May 18, 2021
by
林文清
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:视频进度fix
parent
9c495f30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
learn.vue
src/pages/index/learn.vue
+1
-3
section.vue
src/pages/learn/section.vue
+16
-9
No files found.
src/pages/index/learn.vue
View file @
c92090d3
...
...
@@ -409,7 +409,6 @@ export default {
isReflesh
:
true
,
triggered
:
false
,
_freshing
:
false
,
isOnLoad
:
0
};
},
onLoad
(
param
)
{
...
...
@@ -427,14 +426,13 @@ export default {
},
},
onShow
:
function
(
param
)
{
this
.
isOnLoad
=
1
;
try
{
if
(
param
.
tabs
)
{
this
.
current
=
param
.
tabs
;
this
.
swiperCurrent
=
param
.
tabs
;
}
}
catch
(
e
)
{}
if
(
this
.
current
==
1
||
this
.
current
==
2
||
this
.
current
==
3
)
{
if
(
this
.
current
==
2
||
this
.
current
==
3
)
{
this
.
tabsChange
(
this
.
current
);
}
},
...
...
src/pages/learn/section.vue
View file @
c92090d3
...
...
@@ -6,7 +6,7 @@
<view
class=
"uni-padding-wrap uni-common-mt"
>
<view><video
object-fit=
"cover"
class=
"course-video"
id=
"courseVideo"
:src=
"courseSrc"
:options=
"playerOptions"
:playsinline=
"true"
@
play=
"playCourse"
@
error=
"videoErrorCallback"
@
ready=
"playerReadied"
@
timeupdate=
"onPlayerTimeupdate($event)"
autoplay=
"true"
@
ready=
"playerReadied"
@
timeupdate=
"onPlayerTimeupdate($event)"
@
ended=
"setLearned()"
autoplay=
"true"
controls
></video></view>
<view
class=
"title-content"
>
<view
class=
"item-content"
>
...
...
@@ -149,6 +149,16 @@
this
.
scrollValue
=
0
}
},
setLearned
()
{
let
param
=
{
section_id
:
this
.
section_id
,
video_time
:
this
.
videoTotalTime
,
status
:
1
};
this
.
$u
.
api
.
updateLearnCourses
(
param
).
then
((
res
)
=>
{}).
catch
((
err
)
=>
{
console
.
log
(
err
)
});
},
onPlayerTimeupdate
(
player
)
{
let
intCurrentTime
=
parseInt
(
player
.
detail
.
currentTime
);
this
.
updateLearnedStatus
(
intCurrentTime
)
...
...
@@ -247,20 +257,17 @@
video_time
:
nowTime
,
status
:
this
.
status
};
nowTime
=
parseInt
(
nowTime
);
if
(
nowTime
==
this
.
nowTime
){
return
}
this
.
nowTime
=
nowTime
;
if
(
this
.
status
==
1
||
nowTime
<
5
){
if
(
nowTime
%
this
.
howTimeToUpdateLearnedStatus
!=
0
){
//固定时间更新一次
return
}
if
(
nowTime
==
this
.
videoTotalTime
){
param
.
status
=
this
.
status
=
1
}
else
if
(
nowTime
%
this
.
howTimeToUpdateLearnedStatus
!=
0
){
return
}
else
{
param
.
status
=
0
;
if
(
this
.
status
==
1
){
//已学再学时间设置为结束时间
param
.
video_time
=
this
.
videoTotalTime
}
this
.
$u
.
api
.
updateLearnCourses
(
param
).
then
((
res
)
=>
{}).
catch
((
err
)
=>
{
console
.
log
(
err
)
...
...
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