Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
ef0f1e5a
Commit
ef0f1e5a
authored
Dec 17, 2022
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialTime赋值问题
parent
c69fffff
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
51 deletions
+30
-51
components/courseItem/courseItem.vue
+1
-1
package-lock.json
+4
-23
pages/courseDetail/courseDetail.vue
+22
-24
util/dataHandling.ts
+3
-3
No files found.
components/courseItem/courseItem.vue
View file @
ef0f1e5a
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
type
:
Object
type
:
Object
},
},
fileId
:{
fileId
:{
type
:
String
type
:
Number
}
}
},
},
data
()
{
data
()
{
...
...
package-lock.json
View file @
ef0f1e5a
...
@@ -6,45 +6,26 @@
...
@@ -6,45 +6,26 @@
"dependencies"
:
{
"dependencies"
:
{
"echarts"
:
{
"echarts"
:
{
"version"
:
"5.4.1"
,
"version"
:
"5.4.1"
,
"resolved"
:
"https://registry.npm
mirror.com
/echarts/-/echarts-5.4.1.tgz"
,
"resolved"
:
"https://registry.npm
js.org
/echarts/-/echarts-5.4.1.tgz"
,
"integrity"
:
"sha512-9ltS3M2JB0w2EhcYjCdmtrJ+6haZcW6acBolMGIuf01Hql1yrIV01L1aRj7jsaaIULJslEP9Z3vKlEmnJaWJVQ=="
,
"integrity"
:
"sha512-9ltS3M2JB0w2EhcYjCdmtrJ+6haZcW6acBolMGIuf01Hql1yrIV01L1aRj7jsaaIULJslEP9Z3vKlEmnJaWJVQ=="
,
"requires"
:
{
"requires"
:
{
"tslib"
:
"2.3.0"
,
"tslib"
:
"2.3.0"
,
"zrender"
:
"5.4.1"
"zrender"
:
"5.4.1"
}
}
},
},
"merge-images"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz"
,
"integrity"
:
"sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw=="
},
"nanoid"
:
{
"nanoid"
:
{
"version"
:
"4.0.0"
,
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npm
mirror.com
/nanoid/-/nanoid-4.0.0.tgz"
,
"resolved"
:
"https://registry.npm
js.org
/nanoid/-/nanoid-4.0.0.tgz"
,
"integrity"
:
"sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
"integrity"
:
"sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
},
},
"signature_pad"
:
{
"version"
:
"3.0.0-beta.4"
,
"resolved"
:
"https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz"
,
"integrity"
:
"sha512-cOf2NhVuTiuNqe2X/ycEmizvCDXk0DoemhsEpnkcGnA4kS5iJYTCqZ9As7tFBbsch45Q1EdX61833+6sjJ8rrw=="
},
"tslib"
:
{
"tslib"
:
{
"version"
:
"2.3.0"
,
"version"
:
"2.3.0"
,
"resolved"
:
"https://registry.npm
mirror.com
/tslib/-/tslib-2.3.0.tgz"
,
"resolved"
:
"https://registry.npm
js.org
/tslib/-/tslib-2.3.0.tgz"
,
"integrity"
:
"sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
"integrity"
:
"sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
},
"vue-signature-pad"
:
{
"version"
:
"3.0.2"
,
"resolved"
:
"https://registry.npmmirror.com/vue-signature-pad/-/vue-signature-pad-3.0.2.tgz"
,
"integrity"
:
"sha512-o25o+lROfCmzASS2+fU8ZV801kV+D4/02zkZ+ez3NKeiUmbxW7kwlUf5oKQkvA+l7Ou9xGsGLsirBLch3jyX8A=="
,
"requires"
:
{
"merge-images"
:
"^1.1.0"
,
"signature_pad"
:
"^3.0.0-beta.3"
}
},
"zrender"
:
{
"zrender"
:
{
"version"
:
"5.4.1"
,
"version"
:
"5.4.1"
,
"resolved"
:
"https://registry.npm
mirror.com
/zrender/-/zrender-5.4.1.tgz"
,
"resolved"
:
"https://registry.npm
js.org
/zrender/-/zrender-5.4.1.tgz"
,
"integrity"
:
"sha512-M4Z05BHWtajY2241EmMPHglDQAJ1UyHQcYsxDNzD9XLSkPDqMq4bB28v9Pb4mvHnVQ0GxyTklZ/69xCFP6RXBA=="
,
"integrity"
:
"sha512-M4Z05BHWtajY2241EmMPHglDQAJ1UyHQcYsxDNzD9XLSkPDqMq4bB28v9Pb4mvHnVQ0GxyTklZ/69xCFP6RXBA=="
,
"requires"
:
{
"requires"
:
{
"tslib"
:
"2.3.0"
"tslib"
:
"2.3.0"
...
...
pages/courseDetail/courseDetail.vue
View file @
ef0f1e5a
...
@@ -22,21 +22,17 @@
...
@@ -22,21 +22,17 @@
<!-- 课程banner图 -->
<!-- 课程banner图 -->
<!-- v-show="!sliceshare" -->
<!-- v-show="!sliceshare" -->
<view
class=
"courseBannerBox"
v-if=
"!sliceshare"
>
<view
class=
"courseBannerBox"
v-if=
"!sliceshare"
>
<template
v-if=
"isRenderVideo"
>
<video
v-if=
"isRenderVideo"
id=
"myVideo"
:src=
"courseInfo.filePathOss"
:initial-time=
"initialTimev"
<view
>
<video
id=
"myVideo"
:src=
"courseInfo.filePathOss"
:initial-time=
"videoPlaybackInfo.maxViewTime"
object-fit=
"contain"
class=
"videoBox"
:poster=
"courseInfo.fileFirstImage"
object-fit=
"contain"
class=
"videoBox"
:poster=
"courseInfo.fileFirstImage"
:title=
"courseInfo.fileTitle"
@
loadedmetadata=
"loadedmetadata"
@
play=
"playVideo"
@
pause=
"pause"
:title=
"courseInfo.fileTitle"
@
loadedmetadata=
"loadedmetadata"
@
play=
"playVideo"
@
pause=
"pause"
@
ended=
"ended"
@
timeupdate=
"timeupdate"
></video>
@
ended=
"ended"
@
timeupdate=
"timeupdate"
style=
"width: 100vw;height: 320rpx;"
></video>
</view>
</
template
>
</view>
</view>
<!-- 课程详情图 -->
<!-- 课程详情图 -->
<view
class=
"courseTitleContent"
>
<view
class=
"courseTitleContent"
>
<view
class=
"courseTitle"
>
<view
class=
"courseTitle"
>
<view
class=
""
style=
"width: 70%;"
>
<view
class=
""
style=
"width: 70%;"
>
<h4>
{{courseInfo.fileTitle}}
</h4>
<h4>
{{
courseInfo
.
fileTitle
}}
---
{{
videoPlaybackInfo
.
viewTime
}}
---
{{
initialTimev
}}
</h4>
</view>
</view>
<view
class=
"shareF"
>
<view
class=
"shareF"
>
<view
class=
"awakenApp"
@
click=
"jumpapp()"
v-if=
"coursesharing == 1"
>
<view
class=
"awakenApp"
@
click=
"jumpapp()"
v-if=
"coursesharing == 1"
>
...
@@ -176,6 +172,7 @@
...
@@ -176,6 +172,7 @@
shareCode
:
null
,
shareCode
:
null
,
sharelogin
:
false
,
sharelogin
:
false
,
startTime
:
''
,
startTime
:
''
,
initialTimev
:
0
};
};
},
},
methods
:
{
methods
:
{
...
@@ -340,7 +337,6 @@
...
@@ -340,7 +337,6 @@
'cffp_userId'
),
'cffp_userId'
),
packFileId
:
this
.
courseInfo
.
packFileId
packFileId
:
this
.
courseInfo
.
packFileId
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
,
1551
)
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
this
.
courseInfo
=
res
[
'data'
][
'data'
];
this
.
courseInfo
=
res
[
'data'
][
'data'
];
this
.
lecturerId
=
res
[
'data'
][
'data'
][
'fileLecturerId'
];
this
.
lecturerId
=
res
[
'data'
][
'data'
][
'fileLecturerId'
];
...
@@ -377,7 +373,7 @@
...
@@ -377,7 +373,7 @@
secondsTransferPipe
(
value
)
{
secondsTransferPipe
(
value
)
{
return
dataHandling
.
secondsTransferPipe
(
value
)
return
dataHandling
.
secondsTransferPipe
(
value
)
},
},
play
(
item
)
{
async
play
(
item
)
{
if
(
this
.
courseInfo
.
status
==
1
)
{
if
(
this
.
courseInfo
.
status
==
1
)
{
// 不可播放
// 不可播放
uni
.
showToast
({
uni
.
showToast
({
...
@@ -386,6 +382,7 @@
...
@@ -386,6 +382,7 @@
duration
:
2000
duration
:
2000
});
});
}
else
{
}
else
{
await
this
.
saveVideoPlayback
();
this
.
playbackId
=
null
;
this
.
playbackId
=
null
;
this
.
fileId
=
item
.
fileId
;
this
.
fileId
=
item
.
fileId
;
this
.
courseInfo
.
packFileId
=
item
.
packFileId
;
this
.
courseInfo
.
packFileId
=
item
.
packFileId
;
...
@@ -400,15 +397,19 @@
...
@@ -400,15 +397,19 @@
userId
:
this
.
userId
,
userId
:
this
.
userId
,
fileId
:
this
.
fileId
,
fileId
:
this
.
fileId
,
packFileId
:
this
.
courseInfo
.
packFileId
,
packFileId
:
this
.
courseInfo
.
packFileId
,
totalTime
:
Math
.
floor
(
this
.
totalTime
*
100
)
/
100
,
totalTime
:
Math
.
floor
(
this
.
totalTime
)
,
viewTime
:
Math
.
floor
(
this
.
viewTime
*
100
)
/
100
,
viewTime
:
Math
.
floor
(
this
.
viewTime
)
,
playbackStatus
:
this
.
viewTime
>=
this
.
totalTime
?
'2'
:
'1'
playbackStatus
:
this
.
viewTime
>=
this
.
totalTime
?
'2'
:
'1'
}
}
return
new
Promise
((
resolve
,
reject
)
=>
{
api
.
saveVideoPlayback
(
param
).
then
(
res
=>
{
api
.
saveVideoPlayback
(
param
).
then
(
res
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
this
.
playbackId
=
res
[
'data'
][
'id'
];
this
.
playbackId
=
res
[
'data'
][
'id'
];
resolve
()
console
.
log
(
'执行保存了==========='
,
param
.
viewTime
)
}
}
})
})
})
},
},
findVideoPlayback
()
{
findVideoPlayback
()
{
// 查询视频播放最新记录
// 查询视频播放最新记录
...
@@ -419,9 +420,13 @@
...
@@ -419,9 +420,13 @@
packFileId
:
this
.
courseInfo
.
packFileId
,
packFileId
:
this
.
courseInfo
.
packFileId
,
}
}
api
.
findVideoPlayback
(
param
).
then
(
res
=>
{
api
.
findVideoPlayback
(
param
).
then
(
res
=>
{
this
.
isRenderVideo
=
true
;
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
this
.
videoPlaybackInfo
=
res
[
'data'
]
this
.
videoPlaybackInfo
=
res
[
'data'
];
this
.
initialTimev
=
this
.
videoPlaybackInfo
.
viewTime
;
this
.
isRenderVideo
=
true
;
this
.
$forceUpdate
();
}
else
{
this
.
isRenderVideo
=
true
;
}
}
})
})
},
},
...
@@ -429,12 +434,14 @@
...
@@ -429,12 +434,14 @@
this
.
totalTime
=
e
.
detail
.
duration
;
this
.
totalTime
=
e
.
detail
.
duration
;
},
},
playVideo
(
e
)
{
playVideo
(
e
)
{
if
(
this
.
videoPlaybackInfo
.
viewTime
>=
this
.
videoPlaybackInfo
.
totalTime
){
this
.
videoPlaybackInfo
.
viewTime
=
0
;
}
// 开始/继续播放
// 开始/继续播放
if
(
this
.
courseInfo
.
status
===
2
)
{
if
(
this
.
courseInfo
.
status
===
2
)
{
if
(
this
.
timer
)
{
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
}
}
this
.
saveVideoPlayback
();
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
saveVideoPlayback
()
this
.
saveVideoPlayback
()
},
20
*
1000
)
},
20
*
1000
)
...
@@ -546,6 +553,7 @@
...
@@ -546,6 +553,7 @@
this
.
videoContext
=
uni
.
createVideoContext
(
'myVideo'
);
this
.
videoContext
=
uni
.
createVideoContext
(
'myVideo'
);
},
},
onUnload
()
{
onUnload
()
{
this
.
saveVideoPlayback
();
if
(
this
.
timer
)
{
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
}
}
...
@@ -558,20 +566,10 @@
...
@@ -558,20 +566,10 @@
padding
:
0
;
padding
:
0
;
}
}
.courseBannerBox
{
.courseBannerBox
{
//
min-height
:
300
rpx
;
//
margin-top
:
20
rpx
;
background-color
:
#ebebeb
;
background-color
:
#ebebeb
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
z-index
:
1
;
z-index
:
1
;
.videoBox
{
width
:
100vw
;
//
width
:
100%
;
//
max-width
:
100%
;
min-height
:
320
rpx
;
height
:
100%
;
}
}
}
.courseTitleContent
{
.courseTitleContent
{
height
:
150
rpx
;
height
:
150
rpx
;
...
...
util/dataHandling.ts
View file @
ef0f1e5a
...
@@ -27,9 +27,9 @@ export default{
...
@@ -27,9 +27,9 @@ export default{
},
},
// 秒转换成时分秒
// 秒转换成时分秒
secondsTransferPipe
(
value
:
number
){
secondsTransferPipe
(
value
:
number
){
const
h
=
Math
.
floor
(
value
/
3600
)
>
0
?
Math
.
floor
(
value
/
3600
)
:
'00'
;
const
h
=
Math
.
floor
(
value
/
3600
)
>
0
?
(
Math
.
floor
(
value
/
3600
)
<=
9
?
'0'
+
Math
.
floor
(
value
/
3600
)
:
Math
.
floor
(
value
/
3600
))
:
'00'
;
const
m
=
Math
.
floor
(
value
%
3600
/
60
)
>
0
?
Math
.
floor
(
value
%
3600
/
60
)
:
'00'
;
const
m
=
Math
.
floor
(
value
%
3600
/
60
)
>
0
?
(
Math
.
floor
(
value
%
3600
/
60
)
<=
9
?
'0'
+
Math
.
floor
(
value
%
3600
/
60
):
Math
.
floor
(
value
%
3600
/
60
)
)
:
'00'
;
const
s
=
Math
.
floor
(
value
%
60
)
>
0
?
Math
.
floor
(
value
%
60
)
:
'00'
;
const
s
=
Math
.
floor
(
value
%
60
)
>
0
?
(
Math
.
floor
(
value
%
60
)
<=
9
?
'0'
+
Math
.
floor
(
value
%
60
)
:
Math
.
floor
(
value
%
60
)
)
:
'00'
;
return
h
+
':'
+
m
+
':'
+
s
;
return
h
+
':'
+
m
+
':'
+
s
;
},
},
// 日期格式化
// 日期格式化
...
...
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