Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
68405175
提交
68405175
authored
1月 18, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
f295842d
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
54 行增加
和
41 行删除
+54
-41
ChapterApi.js
learnOnline/apiService/ChapterApi.js
+16
-17
config.js
learnOnline/config.js
+2
-2
contentAudio.wxml
learnOnline/pages/videoPlayer/contentAudio/contentAudio.wxml
+3
-1
contentVideo.wxml
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
+8
-6
show.js
learnOnline/pages/videoPlayer/show.js
+15
-12
project.config.json
learnOnline/project.config.json
+8
-1
util.js
learnOnline/utils/util.js
+2
-2
没有找到文件。
learnOnline/apiService/ChapterApi.js
浏览文件 @
68405175
...
@@ -83,21 +83,20 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback)
...
@@ -83,21 +83,20 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback)
})
})
}
}
/* 获取对应某个章节的详细信息 */
/* 获取对应某个章节的详细信息 */
const
getCurrentChapterDetail
=
(
sid
,
vid
,
videoType
,
callback
)
=>
{
const
getCurrentChapterDetail
=
(
sid
,
vid
,
cid
,
callback
)
=>
{
// CC视频请求数据接口
// CC视频请求数据接口
let
_url
=
null
;
const
uid
=
wx
.
getStorageSync
(
'uid'
)
if
(
videoType
==
3
){
_url
=
util
.
config
.
URL_PATH1
+
'/v2/education/aliyun-video-streaming'
}
else
{
_url
=
util
.
config
.
URL_PATH1
+
'/v2/education/video-streaming'
}
util
.
requestApi
({
util
.
requestApi
({
url
:
_url
,
url
:
util
.
config
.
URL_PATH1
+
'/v2/education/aliyun-video-streaming'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
{
data
:
{
semester_id
:
sid
,
semester_id
:
sid
,
vid
:
vid
vid
:
vid
,
uid
:
wx
.
getStorageSync
(
'uid'
),
sid
:
wx
.
getStorageSync
(
'sid'
),
c
:
cid
,
s
:
sid
,
v
:
vid
},
},
callback
:
function
(
res
)
{
callback
:
function
(
res
)
{
// 进入视频,开始读取视频时,存储 vid、log_key
// 进入视频,开始读取视频时,存储 vid、log_key
...
@@ -126,14 +125,14 @@ const getCurrentChapterDetail = (sid, vid, videoType,callback) => {
...
@@ -126,14 +125,14 @@ const getCurrentChapterDetail = (sid, vid, videoType,callback) => {
/* 结束时,调用接口 */
/* 结束时,调用接口 */
const
endVideo
=
(
obj
)
=>
{
const
endVideo
=
(
obj
)
=>
{
let
json
=
wx
.
getStorageSync
(
'video_001'
)
||
{
semester_id
:
''
,
vid
:
''
,
log_key
:
''
}
let
json
=
wx
.
getStorageSync
(
'video_001'
)
||
{
semester_id
:
''
,
vid
:
''
,
log_key
:
''
}
json
.
uid
=
wx
.
getStorageSync
(
'uid'
)
json
.
sid
=
wx
.
getStorageSync
(
'sid'
)
json
.
d
=
obj
.
did
json
.
i
=
obj
.
did
json
.
c
=
obj
.
cid
json
.
s
=
json
.
semester_id
json
.
v
=
json
.
vid
if
(
json
.
vid
!==
''
)
{
if
(
json
.
vid
!==
''
)
{
json
.
uid
=
wx
.
getStorageSync
(
'uid'
)
json
.
sid
=
wx
.
getStorageSync
(
'sid'
)
json
.
d
=
obj
.
did
json
.
i
=
obj
.
did
json
.
c
=
obj
.
cid
json
.
s
=
json
.
semester_id
json
.
v
=
json
.
vid
util
.
requestApi
({
util
.
requestApi
({
url
:
util
.
config
.
URL_PATH1
+
'/v2/education/end-aliyun-video-streaming'
,
url
:
util
.
config
.
URL_PATH1
+
'/v2/education/end-aliyun-video-streaming'
,
method
:
'POST'
,
method
:
'POST'
,
...
...
learnOnline/config.js
浏览文件 @
68405175
...
@@ -3,13 +3,13 @@ const env = 'production'
...
@@ -3,13 +3,13 @@ const env = 'production'
if
(
env
===
'production'
)
{
if
(
env
===
'production'
)
{
module
.
exports
=
{
module
.
exports
=
{
appVersion
:
'sofia_v3.2.
3
'
,
appVersion
:
'sofia_v3.2.
4
'
,
apiBaseURL
:
'https://wechat-api.ezijing.com'
,
// 接口请求地址
apiBaseURL
:
'https://wechat-api.ezijing.com'
,
// 接口请求地址
tenant
:
'sofia'
tenant
:
'sofia'
}
}
}
else
{
}
else
{
module
.
exports
=
{
module
.
exports
=
{
appVersion
:
'sofia_v3.2.
3
'
,
appVersion
:
'sofia_v3.2.
4
'
,
apiBaseURL
:
'https://wechat-api2.ezijing.com'
,
// 接口请求地址
apiBaseURL
:
'https://wechat-api2.ezijing.com'
,
// 接口请求地址
tenant
:
'sofia'
tenant
:
'sofia'
}
}
...
...
learnOnline/pages/videoPlayer/contentAudio/contentAudio.wxml
浏览文件 @
68405175
<template name='contentAudio'>
<template name='contentAudio'>
<view class='content-audio' wx:if="{{status.isAudio}}">
<view class='content-audio'
style='{{status.isSet && status.isAudio ? "display: none;" : "" }} {{status.isImages && status.isAudio ? "display: none;" : "" }} {{status.isVideo ? "display: none;" : "" }}'
>
<image src='./contentAudio/icons/loading_small.gif' class='loading-image {{status.imagesLoaded && "none"}}' mode='aspectFit'/>
<image src='./contentAudio/icons/loading_small.gif' class='loading-image {{status.imagesLoaded && "none"}}' mode='aspectFit'/>
<image wx:if='{{image.imgUrls[image.current]}}' src='{{image.imgUrls[image.current]}}' class='slide-image' mode='aspectFill' bindload='imagesLoaded'/>
<image wx:if='{{image.imgUrls[image.current]}}' src='{{image.imgUrls[image.current]}}' class='slide-image' mode='aspectFill' bindload='imagesLoaded'/>
<view wx:if='{{!image.imgUrls[image.current]}}' class='slide-image'>本课程暂无PPT</view>
<view wx:if='{{!image.imgUrls[image.current]}}' class='slide-image'>本课程暂无PPT</view>
...
...
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
浏览文件 @
68405175
<template name='contentVideo'>
<template name='contentVideo'>
<!-- 这里加 这么多判断原因,video组件在真机上测试,一定在最上层,其他任何元素都挡不住,只能先隐藏,需要时再显示 -->
<!-- 这里加 这么多判断原因,video组件在真机上测试,一定在最上层,其他任何元素都挡不住,只能先隐藏,需要时再显示 -->
<view class='content-video' wx:if="{{status.isVideo}}">
<view class='content-video'
<video id='my-video' class='my-video' src='{{video.src}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindfullscreenchange='beginAndOutFullScreen' bindpause='beginPauseVA' bindplay='beginPlayVA' binderror='playError' bindended='playEnded' autoplay='{{true}}'></video>
style='{{status.isSet && status.isVideo ? "display: none;" : "" }} {{status.isImages && status.isVideo ? "display: none;" : "" }} {{status.isAudio ? "display: none;" : "" }} {{chapterList.isShow && status.isVideo ? "display: none;" : "" }} {{ status.isLoading ? "display: none": "" }}'
</view>
>
</template>
<video id='my-video' class='my-video' src='{{video.src}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindfullscreenchange='beginAndOutFullScreen' bindpause='beginPauseVA' bindplay='beginPlayVA' binderror='playError' bindended='playEnded' autoplay='{{true}}'></video>
\ No newline at end of file
</view>
</template>
\ No newline at end of file
learnOnline/pages/videoPlayer/show.js
浏览文件 @
68405175
...
@@ -131,6 +131,7 @@ Page({
...
@@ -131,6 +131,7 @@ Page({
this
.
setData
({
ctrlBar
:
this
.
_cache
})
this
.
setData
({
ctrlBar
:
this
.
_cache
})
/* 一定会 存在值 */
/* 一定会 存在值 */
if
(
res
)
{
if
(
res
)
{
console
.
log
(
'set res'
,
res
)
let
tempVid
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
).
vid
let
tempVid
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
).
vid
if
(
vid
==
tempVid
)
{
if
(
vid
==
tempVid
)
{
this
.
_cache
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
)
||
{}
this
.
_cache
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
)
||
{}
...
@@ -169,16 +170,20 @@ Page({
...
@@ -169,16 +170,20 @@ Page({
let
cid
=
this
.
data
.
options
.
cid
,
let
cid
=
this
.
data
.
options
.
cid
,
sid
=
this
.
data
.
options
.
sid
,
sid
=
this
.
data
.
options
.
sid
,
did
=
'jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8'
did
=
'jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8'
ChapterApi
.
getChapterList
(
cid
,
sid
,
vid
,
(
json
)
=>
{
ChapterApi
.
getChapterList
(
cid
,
sid
,
vid
,
json
=>
{
this
.
setData
({
chapterList
:
json
})
this
.
setData
({
chapterList
:
json
})
})
})
// CC视频走这个接口
// CC视频走这个接口
ChapterApi
.
getCurrentChapterDetail
(
sid
,
vid
,
videoType
,
(
json
)
=>
{
ChapterApi
.
getCurrentChapterDetail
(
sid
,
vid
,
videoType
,
json
=>
{
// 播放的视频数据
// 播放的视频数据
this
.
setData
({
video
:
json
.
video
})
this
.
setData
({
video
:
json
.
video
})
this
.
setData
({
audio
:
json
.
audio
})
this
.
setData
({
audio
:
json
.
audio
})
this
.
setData
({
image
:
json
.
image
})
this
.
setData
({
image
:
json
.
image
})
ChapterApi
.
getProgress
(
vid
,
did
,
sid
,
(
res
)
=>
{
ChapterApi
.
getProgress
(
vid
,
did
,
sid
,
res
=>
{
console
.
log
(
'get'
,
res
)
if
(
!
res
)
{
wx
.
showToast
({
title
:
'获取视频进度失败'
,
icon
:
'none'
})
}
res
.
did
=
did
res
.
did
=
did
res
.
vid
=
vid
res
.
vid
=
vid
res
.
cid
=
cid
res
.
cid
=
cid
...
@@ -266,7 +271,7 @@ Page({
...
@@ -266,7 +271,7 @@ Page({
wx
.
showModal
({
wx
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
obj
.
content
,
content
:
obj
.
content
,
success
:
(
res
)
=>
{
success
:
res
=>
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
// wx.setStorageSync(obj.setStorage, obj.getStorage)
// wx.setStorageSync(obj.setStorage, obj.getStorage)
let
cache
=
wx
.
getStorageSync
(
obj
.
getStorage
)
let
cache
=
wx
.
getStorageSync
(
obj
.
getStorage
)
...
@@ -434,8 +439,7 @@ Page({
...
@@ -434,8 +439,7 @@ Page({
},
},
/* controlBar页面 - 点击进度条跳到某个位置播放 - bindtouchstart事件 */
/* controlBar页面 - 点击进度条跳到某个位置播放 - bindtouchstart事件 */
tapToSeek
:
function
(
e
)
{
tapToSeek
:
function
(
e
)
{
let
pLine
=
let
pLine
=
wx
.
getSystemInfoSync
().
windowWidth
-
e
.
currentTarget
.
offsetLeft
*
2
,
wx
.
getSystemInfoSync
().
windowWidth
-
e
.
currentTarget
.
offsetLeft
*
2
,
pos
=
e
.
touches
[
0
].
pageX
,
pos
=
e
.
touches
[
0
].
pageX
,
_data
=
this
.
data
,
_data
=
this
.
data
,
_status
=
_data
.
status
,
_status
=
_data
.
status
,
...
@@ -489,8 +493,7 @@ Page({
...
@@ -489,8 +493,7 @@ Page({
}
}
/* iphone6 8.4.1 首次初始化时,不能直接 设置进度并播放 */
/* iphone6 8.4.1 首次初始化时,不能直接 设置进度并播放 */
if
(
this
.
isFirstInitAndSwitchVideo
)
{
if
(
this
.
isFirstInitAndSwitchVideo
)
{
if
(
!
this
.
_cache
)
if
(
!
this
.
_cache
)
this
.
_cache
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
)
||
{}
this
.
_cache
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
)
||
{}
this
.
seekVA
(
this
.
_cache
.
initial_time
)
this
.
seekVA
(
this
.
_cache
.
initial_time
)
this
.
isFirstInitAndSwitchVideo
=
false
this
.
isFirstInitAndSwitchVideo
=
false
}
}
...
@@ -506,6 +509,7 @@ Page({
...
@@ -506,6 +509,7 @@ Page({
playError
:
function
(
e
)
{},
playError
:
function
(
e
)
{},
/* VideoOrAudio标签 - 视频播放发生变化时 - bindtimeupdate事件 */
/* VideoOrAudio标签 - 视频播放发生变化时 - bindtimeupdate事件 */
timeUpdate
:
function
(
e
)
{
timeUpdate
:
function
(
e
)
{
console
.
log
(
'timeupdate'
,
e
)
let
_data
=
this
.
data
,
let
_data
=
this
.
data
,
_status
=
_data
.
status
,
_status
=
_data
.
status
,
_detail
=
e
.
detail
,
_detail
=
e
.
detail
,
...
@@ -521,13 +525,11 @@ Page({
...
@@ -521,13 +525,11 @@ Page({
this
.
setData
({
this
.
setData
({
'ctrlBar.totalTime'
:
util
.
durationToTimeString
(
_obj
.
totalTime
)
'ctrlBar.totalTime'
:
util
.
durationToTimeString
(
_obj
.
totalTime
)
})
})
console
.
log
(
_obj
.
currentTime
,
_obj
.
totalTime
)
/* 实时改变 当前的PPT当前页 */
/* 实时改变 当前的PPT当前页 */
let
arr
=
this
.
data
.
image
.
timeArr
let
arr
=
this
.
data
.
image
.
timeArr
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
if
(
_obj
.
currentTime
>=
arr
[
i
]
&&
(
i
+
1
<
arr
.
length
?
_obj
.
currentTime
<
arr
[
i
+
1
]
:
1
))
{
_obj
.
currentTime
>=
arr
[
i
]
&&
(
i
+
1
<
arr
.
length
?
_obj
.
currentTime
<
arr
[
i
+
1
]
:
1
)
)
{
this
.
setData
({
'image.current'
:
i
})
this
.
setData
({
'image.current'
:
i
})
break
break
}
}
...
@@ -550,6 +552,7 @@ Page({
...
@@ -550,6 +552,7 @@ Page({
clearInterval
(
this
.
heartbeat
)
clearInterval
(
this
.
heartbeat
)
this
.
heartbeat
=
setInterval
(()
=>
{
this
.
heartbeat
=
setInterval
(()
=>
{
console
.
log
(
this
.
data
.
initVAFlag
)
/* 如果是初始加载状态,就不计算时间状态 和 提交进度了 */
/* 如果是初始加载状态,就不计算时间状态 和 提交进度了 */
if
(
this
.
data
.
initVAFlag
)
return
if
(
this
.
data
.
initVAFlag
)
return
let
arr
=
_data
.
ctrlBar
.
currentTime
.
split
(
':'
),
let
arr
=
_data
.
ctrlBar
.
currentTime
.
split
(
':'
),
...
...
learnOnline/project.config.json
浏览文件 @
68405175
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
"autoAudits"
:
false
,
"autoAudits"
:
false
,
"showShadowRootInWxmlPanel"
:
true
,
"showShadowRootInWxmlPanel"
:
true
,
"scopeDataCheck"
:
false
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
fals
e
,
"uglifyFileName"
:
tru
e
,
"checkInvalidKey"
:
true
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"uploadWithSourceMap"
:
true
,
...
@@ -87,6 +87,13 @@
...
@@ -87,6 +87,13 @@
{
{
"name"
:
"pages/learnSystem/my/my"
,
"name"
:
"pages/learnSystem/my/my"
,
"pathName"
:
"pages/learnSystem/my/my"
,
"pathName"
:
"pages/learnSystem/my/my"
,
"query"
:
""
,
"scene"
:
null
},
{
"name"
:
"pages/videoPlayer/show"
,
"pathName"
:
"pages/videoPlayer/show"
,
"query"
:
"cid=6549489626027917312&sid=6552021107166150656&vid=6414742983802880000&type=3"
,
"scene"
:
null
"scene"
:
null
}
}
]
]
...
...
learnOnline/utils/util.js
浏览文件 @
68405175
...
@@ -6,14 +6,14 @@ const url_test = {
...
@@ -6,14 +6,14 @@ const url_test = {
URL_PATH2
:
'https://wechat-api2.ezijing.com/api'
,
// 正式域名 - 由于项目变动域名
URL_PATH2
:
'https://wechat-api2.ezijing.com/api'
,
// 正式域名 - 由于项目变动域名
outSiteLink
:
'https://e-learning.ezijing.com'
,
// 正式外链
outSiteLink
:
'https://e-learning.ezijing.com'
,
// 正式外链
tenant
:
'sofia'
,
tenant
:
'sofia'
,
version
:
'3.2.
3
'
version
:
'3.2.
4
'
}
}
const
url_online
=
{
const
url_online
=
{
URL_PATH1
:
'https://wechat-api.ezijing.com/api/lms'
,
// 正式域名 - 由于项目变动域名
URL_PATH1
:
'https://wechat-api.ezijing.com/api/lms'
,
// 正式域名 - 由于项目变动域名
URL_PATH2
:
'https://wechat-api.ezijing.com/api'
,
// 正式域名 - 由于项目变动域名
URL_PATH2
:
'https://wechat-api.ezijing.com/api'
,
// 正式域名 - 由于项目变动域名
outSiteLink
:
'https://e-learning.ezijing.com'
,
// 正式外链
outSiteLink
:
'https://e-learning.ezijing.com'
,
// 正式外链
tenant
:
'sofia'
,
tenant
:
'sofia'
,
version
:
'3.2.
3
'
version
:
'3.2.
4
'
}
}
let
config
=
url_online
let
config
=
url_online
/* 请求接口统一 重定义 */
/* 请求接口统一 重定义 */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论