Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
326519ca
提交
326519ca
authored
5月 20, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into ecollage
上级
726b2f95
bbf95155
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
61 行增加
和
54 行删除
+61
-54
MsgApi.js
learnOnline/apiService/MsgApi.js
+4
-4
app.json
learnOnline/app.json
+0
-1
message.js
learnOnline/pages/learnSystem/message/message.js
+14
-15
audioCtrl.js
learnOnline/pages/videoPlayer/contentAudio/audioCtrl.js
+34
-24
contentAudio.wxml
learnOnline/pages/videoPlayer/contentAudio/contentAudio.wxml
+1
-3
contentVideo.wxml
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
+2
-3
show.js
learnOnline/pages/videoPlayer/show.js
+0
-0
show.wxml
learnOnline/pages/videoPlayer/show.wxml
+6
-4
没有找到文件。
learnOnline/apiService/MsgApi.js
浏览文件 @
326519ca
const
util
=
require
(
'../utils/util.js'
)
const
util
=
require
(
'../utils/util.js'
)
/**
/**
* 本API中全部用于 消息 相关接口
* 本API中全部用于 消息 相关接口
*/
*/
/* 获取我的消息信息 */
/* 获取我的消息信息 */
...
@@ -8,7 +8,8 @@ const getMyMsg = (callback) => {
...
@@ -8,7 +8,8 @@ const getMyMsg = (callback) => {
util
.
requestApi
({
util
.
requestApi
({
url
:
util
.
config
.
URL_PATH1
+
'/v2/education/message/my'
,
url
:
util
.
config
.
URL_PATH1
+
'/v2/education/message/my'
,
callback
:
function
(
res
)
{
callback
:
function
(
res
)
{
let
json
=
res
.
data
.
map
(
function
(
_
,
i
)
{
let
list
=
Array
.
isArray
(
res
.
data
)
?
res
.
data
:
res
.
data
.
list
||
[]
let
json
=
list
.
map
(
function
(
_
,
i
)
{
return
{
return
{
isRead
:
false
,
isRead
:
false
,
id
:
_
.
id
,
id
:
_
.
id
,
...
@@ -23,4 +24,4 @@ const getMyMsg = (callback) => {
...
@@ -23,4 +24,4 @@ const getMyMsg = (callback) => {
}
}
module
.
exports
=
{
module
.
exports
=
{
getMyMsg
:
getMyMsg
getMyMsg
:
getMyMsg
}
}
\ No newline at end of file
learnOnline/app.json
浏览文件 @
326519ca
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
"color"
:
"#313131"
,
"color"
:
"#313131"
,
"backgroundColor"
:
"#ffffff"
,
"backgroundColor"
:
"#ffffff"
,
"selectedColor"
:
"#b49441"
,
"selectedColor"
:
"#b49441"
,
"aniamtion"
:
"true"
,
"list"
:
[
"list"
:
[
{
{
"pagePath"
:
"pages/learnSystem/home/home"
,
"pagePath"
:
"pages/learnSystem/home/home"
,
...
...
learnOnline/pages/learnSystem/message/message.js
浏览文件 @
326519ca
...
@@ -7,13 +7,13 @@ Page({
...
@@ -7,13 +7,13 @@ Page({
*/
*/
data
:
{
data
:
{
msgList
:
[
msgList
:
[
// {
// {
// isRead: false,
// isRead: false,
// id: '1',
// id: '1',
// text: '2017年春季班三期班第三学期课程已经正式开始,作业截止提交时间为2018年1月10日,请三期班同学们合理安排学习时间。2017年春季班三期班第三学期课程已经正式开始,作业截止提交时间为2018年1月10日,请三期班同学们合理安排学习时间。',
// text: '2017年春季班三期班第三学期课程已经正式开始,作业截止提交时间为2018年1月10日,请三期班同学们合理安排学习时间。2017年春季班三期班第三学期课程已经正式开始,作业截止提交时间为2018年1月10日,请三期班同学们合理安排学习时间。',
// time: '2015-05-22 15:51',
// time: '2015-05-22 15:51',
// isShow: false // 该字段用来做 每条信息的打开、关闭
// isShow: false // 该字段用来做 每条信息的打开、关闭
// }
// }
]
]
},
},
/**
/**
...
@@ -22,7 +22,7 @@ Page({
...
@@ -22,7 +22,7 @@ Page({
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
wx
.
showLoading
({
title
:
'页面加载中...'
,
mask
:
true
})
wx
.
showLoading
({
title
:
'页面加载中...'
,
mask
:
true
})
MsgApi
.
getMyMsg
((
json
)
=>
{
MsgApi
.
getMyMsg
((
json
)
=>
{
this
.
setData
({
'msgList'
:
json
})
this
.
setData
({
msgList
:
json
})
wx
.
hideLoading
()
wx
.
hideLoading
()
})
})
},
},
...
@@ -47,15 +47,15 @@ Page({
...
@@ -47,15 +47,15 @@ Page({
*/
*/
onPullDownRefresh
:
function
()
{
onPullDownRefresh
:
function
()
{
// 显示顶部刷新图标
// 显示顶部刷新图标
wx
.
showNavigationBarLoading
()
;
wx
.
showNavigationBarLoading
()
wx
.
showLoading
({
title
:
'更新中...'
,
mask
:
true
})
wx
.
showLoading
({
title
:
'更新中...'
,
mask
:
true
})
MsgApi
.
getMyMsg
((
json
)
=>
{
MsgApi
.
getMyMsg
((
json
)
=>
{
this
.
setData
({
'msgList'
:
json
})
this
.
setData
({
msgList
:
json
.
list
})
wx
.
hideLoading
()
wx
.
hideLoading
()
// 隐藏导航栏加载框
// 隐藏导航栏加载框
wx
.
hideNavigationBarLoading
()
;
wx
.
hideNavigationBarLoading
()
// 停止下拉动作
// 停止下拉动作
wx
.
stopPullDownRefresh
()
;
wx
.
stopPullDownRefresh
()
})
})
},
},
/**
/**
...
@@ -81,11 +81,11 @@ Page({
...
@@ -81,11 +81,11 @@ Page({
* 滚动到底部,加载更多数据
* 滚动到底部,加载更多数据
*/
*/
loadmore
:
function
()
{
loadmore
:
function
()
{
let
_that
=
this
;
let
_that
=
this
wx
.
showLoading
({
title
:
'数据加载中...'
,
mask
:
true
})
wx
.
showLoading
({
title
:
'数据加载中...'
,
mask
:
true
})
setTimeout
(
function
()
{
setTimeout
(
function
()
{
wx
.
showToast
({
title
:
'没有更多了'
,
icon
:
'none'
})
wx
.
showToast
({
title
:
'没有更多了'
,
icon
:
'none'
})
wx
.
hideLoading
()
wx
.
hideLoading
()
},
2000
)
},
2000
)
}
}
})
})
\ No newline at end of file
learnOnline/pages/videoPlayer/contentAudio/audioCtrl.js
浏览文件 @
326519ca
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
*/
*/
var
Audio
=
function
(
src
,
_that
)
{
var
Audio
=
function
(
src
,
_that
)
{
if
(
!
(
this
instanceof
Audio
))
{
if
(
!
(
this
instanceof
Audio
))
{
return
new
Audio
(
src
,
_that
)
;
return
new
Audio
(
src
,
_that
)
}
else
{
}
else
{
this
.
_audio
=
this
.
init
(
src
,
_that
)
;
this
.
_audio
=
this
.
init
(
src
,
_that
)
this
.
currentTime
=
0
;
// 当前时间
this
.
currentTime
=
0
// 当前时间
this
.
totalTime
=
0
;
// 总时间
this
.
totalTime
=
0
// 总时间
this
.
rateIndex
=
2
;
// 取值为 RATE中的 下标 0,1,2,3,4
this
.
rateIndex
=
2
// 取值为 RATE中的 下标 0,1,2,3,4
}
}
}
}
/**
/**
...
@@ -21,44 +21,54 @@ var Audio = function (src, _that) {
...
@@ -21,44 +21,54 @@ var Audio = function (src, _that) {
* stop - 视频停止
* stop - 视频停止
* seek - 视频跳到某个位置再播放
* seek - 视频跳到某个位置再播放
* rate - 视频播放速率调整
* rate - 视频播放速率调整
*
*
*/
*/
Audio
.
prototype
=
{
Audio
.
prototype
=
{
constructor
:
Audio
,
constructor
:
Audio
,
RATE
:
[
'0.5'
,
'0.8'
,
'1.0'
,
'1.25'
,
'1.5'
],
RATE
:
[
'0.5'
,
'0.8'
,
'1.0'
,
'1.25'
,
'1.5'
],
init
:
function
(
src
,
_that
)
{
init
:
function
(
src
,
_that
)
{
let
_auCtx
=
wx
.
createInnerAudioContext
();
let
_auCtx
=
wx
.
createInnerAudioContext
()
_auCtx
.
autoplay
=
false
;
wx
.
setInnerAudioOption
({
obeyMuteSwitch
:
false
})
_auCtx
.
src
=
src
;
_auCtx
.
autoplay
=
false
_auCtx
.
src
=
src
/* 使用绑定事件,代替wxml中的事件绑定 */
/* 使用绑定事件,代替wxml中的事件绑定 */
_auCtx
.
onTimeUpdate
(()
=>
{
let
e
=
{
detail
:
{
currentTime
:
_auCtx
.
currentTime
,
duration
:
_auCtx
.
duration
}
};
_that
.
timeUpdate
(
e
)
})
_auCtx
.
onTimeUpdate
(()
=>
{
_auCtx
.
onPlay
(()
=>
{
_that
.
beginPlayVA
()
})
let
e
=
{
_auCtx
.
onError
((
e
)
=>
{
_that
.
playError
(
e
)
})
detail
:
{
currentTime
:
_auCtx
.
currentTime
,
duration
:
_auCtx
.
duration
}
_auCtx
.
onEnded
(()
=>
{
_that
.
playEnded
})
}
return
_auCtx
;
_that
.
timeUpdate
(
e
)
})
_auCtx
.
onPlay
(()
=>
{
_that
.
beginPlayVA
()
})
_auCtx
.
onError
((
e
)
=>
{
_that
.
playError
(
e
)
})
_auCtx
.
onEnded
(()
=>
{
_that
.
playEnded
})
return
_auCtx
},
},
play
:
function
()
{
play
:
function
()
{
this
.
_audio
.
play
()
;
this
.
_audio
.
play
()
},
},
pause
:
function
()
{
pause
:
function
()
{
this
.
_audio
.
pause
()
;
this
.
_audio
.
pause
()
},
},
stop
:
function
()
{
stop
:
function
()
{
this
.
_audio
.
stop
()
;
this
.
_audio
.
stop
()
},
},
seek
:
function
(
time
)
{
seek
:
function
(
time
)
{
this
.
_audio
.
seek
(
time
)
;
this
.
_audio
.
seek
(
time
)
},
},
fastSlow15
:
function
(
timeStr
)
{
fastSlow15
:
function
(
timeStr
)
{
this
.
_audio
.
seek
(
this
.
currentTime
+
parseInt
(
timeStr
))
;
this
.
_audio
.
seek
(
this
.
currentTime
+
parseInt
(
timeStr
))
},
},
rate
:
function
()
{
rate
:
function
()
{
this
.
rateIndex
++
;
this
.
rateIndex
++
if
(
this
.
rateIndex
>
4
)
this
.
rateIndex
=
0
;
if
(
this
.
rateIndex
>
4
)
this
.
rateIndex
=
0
this
.
_audio
.
playbackRate
(
parseFloat
(
this
.
RATE
[
this
.
rateIndex
]))
;
this
.
_audio
.
playbackRate
(
parseFloat
(
this
.
RATE
[
this
.
rateIndex
]))
}
}
}
}
module
.
exports
=
{
module
.
exports
=
{
Audio
:
Audio
Audio
:
Audio
...
...
learnOnline/pages/videoPlayer/contentAudio/contentAudio.wxml
浏览文件 @
326519ca
<template name='contentAudio'>
<template name='contentAudio'>
<view class='content-audio'
<view class='content-audio' wx:if="{{status.isAudio}}">
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
浏览文件 @
326519ca
<template name='contentVideo'>
<template name='contentVideo'>
<!-- 这里加 这么多判断原因,video组件在真机上测试,一定在最上层,其他任何元素都挡不住,只能先隐藏,需要时再显示 -->
<!-- 这里加 这么多判断原因,video组件在真机上测试,一定在最上层,其他任何元素都挡不住,只能先隐藏,需要时再显示 -->
<view class='content-video'
<view class='content-video' wx:if="{{status.isVideo}}">
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": "" }}'
>
<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>
<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>
</view>
</view>
</template>
</template>
\ No newline at end of file
learnOnline/pages/videoPlayer/show.js
浏览文件 @
326519ca
差异被折叠。
点击展开。
learnOnline/pages/videoPlayer/show.wxml
浏览文件 @
326519ca
...
@@ -13,14 +13,16 @@
...
@@ -13,14 +13,16 @@
<template is='pageLoading'></template>
<template is='pageLoading'></template>
</block>
</block>
<block wx:if='{{status.isSupport}}'>
<block wx:if='{{status.isSupport}}'>
<template is='contentAudio' data='{{status, audio, image, ctrlBar}}'></template>
<template is='contentVideo' data='{{status, video, chapterList, ctrlBar}}'></template>
<block wx:if='{{status.isSet}}'>
<block wx:if='{{status.isSet}}'>
<template is='setContent' data='{{ctrlBar}}'></template>
<template is='setContent' data='{{ctrlBar}}'></template>
</block><block wx:elif='{{status.isImages}}'>
</block>
<block wx:elif='{{status.isImages}}'>
<template is='contentImages' data='{{status, image}}'></template>
<template is='contentImages' data='{{status, image}}'></template>
</block>
</block>
<template is='contentAudio' data='{{status, audio, image, ctrlBar}}'></template>
</block>
<template is='contentVideo' data='{{status, video, chapterList, ctrlBar}}'></template>
<block wx:else>
</block><block wx:else>
<template is='noSupport'></template>
<template is='noSupport'></template>
</block>
</block>
<template is='controlBar' data='{{status, video, ctrlBar, chapterList, initVAFlag}}'></template>
<template is='controlBar' data='{{status, video, ctrlBar, chapterList, initVAFlag}}'></template>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论