Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
8f33a1dc
提交
8f33a1dc
authored
12月 07, 2018
作者:
GOD_ZYX
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master' into enterprise
上级
404cbcfb
099f149e
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
71 行增加
和
61 行删除
+71
-61
README.md
README.md
+9
-0
ChapterApi.js
learnOnline/apiService/ChapterApi.js
+3
-3
index.js
learnOnline/pages/index/index.js
+1
-0
courseContent.js
learnOnline/pages/learnSystem/courseContent/courseContent.js
+5
-1
courseContent.wxml
...Online/pages/learnSystem/courseContent/courseContent.wxml
+8
-1
my.js
learnOnline/pages/learnSystem/my/my.js
+2
-2
my.wxml
learnOnline/pages/learnSystem/my/my.wxml
+6
-4
contentVideo.wxml
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
+2
-1
show.js
learnOnline/pages/videoPlayer/show.js
+35
-49
没有找到文件。
README.md
浏览文件 @
8f33a1dc
...
...
@@ -14,6 +14,15 @@
-
`微信开发者工具`
:
<a
href=
"https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html"
target=
"_blank"
>
下载地址
</a>
-
`微信开发者工具`
:
<a
href=
"https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html?t=18090718"
target=
"_blank"
>
使用说明地址
</a>
## 小程序 - 对应域名添加
*
https://api.ezijing.com
*
https://p.bokecc.com
*
https://union.bokecc.com
*
https://cd15-c120-1.play.bokecc.com
*
https://ca14-cca1-1.play.bokecc.com
*
https://img1.ezijing.com
*
https://zws-imgs-pub.ezijing.com
## 小程序审核
```
python
本系统是
内部付费人员使用,需要绑定手机号(你们肯定不愿意提供手机号)。但为了
照顾你们
测试人员,所以在
登录下方已经增加
“游客登录”入口,你测试
为啥不试试就给我拒绝了?
...
...
learnOnline/apiService/ChapterApi.js
浏览文件 @
8f33a1dc
...
...
@@ -93,13 +93,13 @@ const getCurrentChapterDetail = (vid, callback) => {
},
audio
:
{
src
:
res
.
data
.
audio
[
0
].
url
,
poster
:
res
.
data
.
ppts
[
0
]
&&
res
.
data
.
ppts
[
0
].
ppt_url
||
''
poster
:
res
.
data
.
ppts
&&
res
.
data
.
ppts
[
0
]
&&
res
.
data
.
ppts
[
0
].
ppt_url
||
''
},
image
:
{
imgUrls
:
res
.
data
.
ppts
.
map
(
function
(
_
,
i
)
{
return
_
.
ppt_url
}),
imgUrls
:
res
.
data
.
ppts
&&
res
.
data
.
ppts
.
map
(
function
(
_
,
i
)
{
return
_
.
ppt_url
}),
current
:
0
,
selectIndex
:
0
,
timeArr
:
res
.
data
.
ppts
.
map
(
function
(
_
,
i
)
{
return
_
.
ppt_point
})
timeArr
:
res
.
data
.
ppts
&&
res
.
data
.
ppts
.
map
(
function
(
_
,
i
)
{
return
_
.
ppt_point
})
}
}
callback
(
json
)
...
...
learnOnline/pages/index/index.js
浏览文件 @
8f33a1dc
...
...
@@ -33,6 +33,7 @@ Page({
url
:
util
.
config
.
URL_PATH
+
'/switch/lock'
,
data
:
{},
method
:
'GET'
,
header
:
{
tenant
:
util
.
config
.
tenant
},
success
:
res
=>
{
this
.
setData
({
'isUseAccountLogin'
:
res
.
data
.
switch
})
wx
.
setStorageSync
(
'isUseAccountLogin'
,
res
.
data
.
switch
)
}
})
wx
.
hideLoading
();
...
...
learnOnline/pages/learnSystem/courseContent/courseContent.js
浏览文件 @
8f33a1dc
...
...
@@ -99,7 +99,8 @@ Page({
score
:
'暂无'
}
}
}]
}],
isUseAccountLogin
:
true
},
cid
:
''
,
sid
:
''
,
...
...
@@ -108,6 +109,9 @@ Page({
*/
onLoad
:
function
(
options
)
{
wx
.
showLoading
({
title
:
'页面加载中...'
,
mask
:
true
})
/* 判别 是否显示 账号登录 */
this
.
setData
({
'isUseAccountLogin'
:
wx
.
getStorageSync
(
'isUseAccountLogin'
)
})
this
.
cid
=
options
.
id
this
.
sid
=
options
.
sid
CourseApi
.
getCourseDetail
(
this
.
cid
,
this
.
sid
,
(
json
)
=>
{
...
...
learnOnline/pages/learnSystem/courseContent/courseContent.wxml
浏览文件 @
8f33a1dc
...
...
@@ -25,7 +25,14 @@
<view class='ct-ctr'>
<view class='tab-select'>
<block wx:for='{{tabs}}' wx:key='{{index}}'>
<view class='item {{item.isShow ? "on" : ""}}' bindtap='tabSelect' data-index='{{index}}' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>{{item.title}}</view>
<block wx:if='{{index == 2}}'>
<block wx:if='{{!isUseAccountLogin}}'>
<view class='item {{item.isShow ? "on" : ""}}' bindtap='tabSelect' data-index='{{index}}' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>{{item.title}}</view>
</block>
</block>
<block wx:else>
<view class='item {{item.isShow ? "on" : ""}}' bindtap='tabSelect' data-index='{{index}}' data-cid='{{headerInfo.id}}' data-sid='{{headerInfo.sid}}'>{{item.title}}</view>
</block>
</block>
</view>
<view class='tab-content'>
...
...
learnOnline/pages/learnSystem/my/my.js
浏览文件 @
8f33a1dc
// pages/learnSystem/my/my.js
Page
({
/* 页面的初始数据 */
data
:
{
userInfo
:
{
nickName
:
'用户名'
,
avatarUrl
:
'../icons/my/default.jpg'
}
},
data
:
{
userInfo
:
{
nickName
:
'用户名'
,
avatarUrl
:
'../icons/my/default.jpg'
}
,
isUseAccountLogin
:
true
},
/* 生命周期函数--监听页面加载 */
onLoad
:
function
(
options
)
{
this
.
setData
({
'userInfo'
:
wx
.
getStorageSync
(
'userInfo'
)
})
},
onLoad
:
function
(
options
)
{
this
.
setData
({
'userInfo'
:
wx
.
getStorageSync
(
'userInfo'
)
})
;
this
.
setData
({
'isUseAccountLogin'
:
wx
.
getStorageSync
(
'isUseAccountLogin'
)
})
},
/* 生命周期函数--监听页面初次渲染完成 */
onReady
:
function
()
{
},
/* 我的讨论 */
...
...
learnOnline/pages/learnSystem/my/my.wxml
浏览文件 @
8f33a1dc
...
...
@@ -5,10 +5,12 @@
<view class='name'>{{userInfo.nickName}}</view>
</view>
<view class='my-select'>
<view class='item' bindtap='goMyDiscuss'>
<image class='img' src='../icons/my/my-discuss.png' mode='aspectFit'></image>
<view class='text'>我的讨论</view>
</view>
<block wx:if="{{!isUseAccountLogin}}">
<view class='item' bindtap='goMyDiscuss'>
<image class='img' src='../icons/my/my-discuss.png' mode='aspectFit'></image>
<view class='text'>我的讨论</view>
</view>
</block>
<view class='item' bindtap='goMyScore'>
<image class='img' src='../icons/my/my-credit.png' mode='aspectFit'></image>
<view class='text'>我的学分</view>
...
...
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
浏览文件 @
8f33a1dc
...
...
@@ -3,6 +3,6 @@
<view class='content-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": "" }}'
>
<video id='my-video' class='my-video' src='{{video.src}}'
initial-time='{{ctrlBar.initial_time}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' autoplay='false' bindfullscreenchange='beginAndOutFullScreen' bindpause='beginPauseVA' bindplay='beginPlayVA' binderror='playError' bindended='playEnded' autoplay='{{fals
e}}'></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='{{tru
e}}'></video>
</view>
</template>
\ No newline at end of file
learnOnline/pages/videoPlayer/show.js
浏览文件 @
8f33a1dc
...
...
@@ -5,6 +5,17 @@ const objA = require('./contentAudio/audioCtrl.js')
const
ChapterApi
=
require
(
'../../apiService/ChapterApi.js'
)
/**
* 目前优化进度:
* 1. 增加 autoplay = true属性,并在加载完成后,再手动出发一次 play。
* 2. 去掉一些 没用的 判断方式,如firstOpen、switchOpen等。合并成一个。
* 测试机型:
* 乐视 Letv X800、honor 7A、华为、小米 note、iphone6、iphone8、iphoneX
* 目前已知的存在问题:
* 1. 关闭,再进入后台时,视频播放不会自动播放,但按钮显示播放状态。
* 2. 打开预览大图,再回来,视频播放不会自动播放,但按钮也显示播放状态。
*/
Page
({
data
:
{
/* 打开页面时,状态 */
...
...
@@ -91,17 +102,12 @@ Page({
isBigPicShow
:
false
,
/* 是否切换到 后台 */
isBackend
:
false
,
/* 第一次进入时 */
firstOpen
:
true
,
/* 切换视频时,切换视频时,可能会导致 上次的记录不会播放,这个问题没有解决。IOS 和 android都没有解决 */
switchOpen
:
false
,
/* 是否首次初始化 视频 */
isFirstInitAndSwitchVideo
:
true
,
/* 存储 第一次进入 或 切换时,控制信息的相关数据 */
_cache
:
null
,
_cacheTotalTime
:
0
,
/* show页面 - 页面内容初始化(首次打开时,data.status本身就是初始状态,则不用再调用statusClear方法进行初始化) - 1. 根据数据初始化音视频对象;2. 根据数据初始化到视频页面;3. 根据进度数据初始化视频进度 */
initPage
:
function
(
res
,
vid
)
{
/* setData、视频设置等 异步,需要时间,所以加个延时,为true时播放按钮不可用 */
this
.
setData
({
'initVAFlag'
:
true
})
/* 默认先 显示视频 */
this
.
setData
({
'status.isVideo'
:
true
})
this
.
_cache
=
{
isPlay
:
false
,
initial_time
:
0
,
currentTime
:
'00:00'
,
totalTime
:
'00:00'
,
progress
:
'0%'
,
curRate
:
'1.0X'
,
jumpFlag
:
false
,
vid
:
vid
}
...
...
@@ -122,11 +128,14 @@ Page({
/* 将旧的对象全部抛弃掉 */
(
!
this
.
_video
&&
(
this
.
_video
=
objV
.
Video
(
'my-video'
)));
this
.
_audio
=
objA
.
Audio
(
this
.
data
.
audio
.
src
,
this
);
/* 切换视频源时 */
if
(
this
.
switchOpen
)
{
this
.
setData
({
'ctrlBar'
:
this
.
_cache
});
this
.
pauseVA
()
}
/* 第一次进入时 */
if
(
this
.
firstOpen
)
{
this
.
playVA
()
}
/* setData、视频设置等 异步,需要时间,所以加个延时,为true时播放按钮不可用 */
this
.
setData
({
'initVAFlag'
:
true
})
this
.
setData
({
'ctrlBar.isPlay'
:
true
})
setTimeout
(()
=>
{
/* android 手机有时候 播放失效,追加 autoPlay 自动播放 */
this
.
playVA
()
this
.
setData
({
'status.isLoading'
:
false
})
/* 这里 设置倍速还有点问题 */
let
_vObj
=
this
.
_video
;
for
(
let
i
=
0
;
i
<
_vObj
.
RATE
.
length
;
i
++
)
{
let
_
=
_vObj
.
RATE
[
i
];
if
(
this
.
data
.
ctrlBar
.
curRate
.
replace
(
/X/
,
''
)
==
_
)
{
_vObj
.
rateIndex
=
i
-
1
;
this
.
setRate
();
};
}
...
...
@@ -157,14 +166,11 @@ Page({
onShow
:
function
()
{
/* 兼容 android 这里发现 android 打开预览大图,然后关闭 自动播放视频,而且关不掉, 兼容android强制关闭视频 */
/* 这里没有 预览大图 关闭监听,所以 isBigPicShow 状态永远为 true */
if
(
this
.
isBigPicShow
)
{
this
.
p
auseVA
()
}
if
(
this
.
isBigPicShow
)
{
this
.
p
layVA
();
this
.
isBigPicShow
=
false
;
this
.
isBackend
=
false
;
return
;
}
if
(
this
.
isBackend
)
{
let
tempTime
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
).
initial_time
;
// this.setData({ 'initVAFlag': true })
;
this
.
playVA
();
/* 兼容 android 突然黑屏关闭,然后一会儿打开,播放时出现跳跃播放问题 */
this
.
seekVA
(
tempTime
);
/* 这里调用,跟初始化调用时保持一致,其主要也是为了解决android从后台进入前台时出现的问题 */
this
.
setData
({
'initVAFlag'
:
true
});
this
.
isBackend
=
false
;
}
},
...
...
@@ -192,10 +198,13 @@ Page({
this
.
setData
({
'ctrlBar'
:
cache
});
this
.
setData
({
'status.isAudio'
:
obj
.
isAudio
});
this
.
setData
({
'status.isVideo'
:
obj
.
isVideo
});
this
.
seekVA
(
cache
.
initial_time
);
this
.
playVA
();
/* 这里调用,解决VA视频初始化 */
this
.
setData
({
'initVAFlag'
:
true
});
setTimeout
(()
=>
{
this
.
seekVA
(
cache
.
initial_time
);
this
.
playVA
();
},
200
)
}
}
});
...
...
@@ -218,7 +227,7 @@ Page({
}
wx
.
showToast
({
title
:
'请在PC上使用该功能'
,
icon
:
'none'
});
return
;
}
this
.
switchOpen
=
true
;
this
.
isFirstInitAndSwitchVideo
=
true
;
this
.
statusClear
(
_data
.
name
,
_data
.
id
);
this
.
ajaxInitGetInfo
(
_data
.
id
);
},
...
...
@@ -247,8 +256,8 @@ Page({
closeContentImages
:
function
()
{
this
.
setData
({
'status.isImages'
:
false
});
/* 兼容 android 发现打开previewImage后,从swiper 切换回 视频播放页,视频会自动暂停 */
this
.
data
.
status
.
isVideo
&&
this
.
pauseVA
();
wx
.
getStorageSync
(
'videoCacheCtrlBar'
).
isPlay
&&
this
.
playVA
();
//
this.data.status.isVideo && this.pauseVA();
//
wx.getStorageSync('videoCacheCtrlBar').isPlay && this.playVA();
},
/* controlBar页面 - 打开设置面板 - bindTap事件 */
openSetContent
:
function
()
{
this
.
setData
({
'status.isSet'
:
true
});
},
...
...
@@ -307,36 +316,13 @@ Page({
beginAndOutFullScreen
:
function
(
e
)
{},
/* VideoOrAudio标签 - 开始/继续播放时触发play事件时,触发 - bindplay事件 */
beginPlayVA
:
function
()
{
if
(
this
.
data
.
initVAFlag
)
{
if
(
this
.
firstOpen
)
{
this
.
seekVA
(
this
.
_cache
.
initial_time
)
/* 由于不能直接获取视频长度,所以 延时暂停,通过 timeUpdate获取视频长度 */
setTimeout
(()
=>
{
this
.
pauseVA
()
this
.
setData
({
'initVAFlag'
:
false
})
},
260
)
}
else
{
this
.
pauseVA
()
this
.
setData
({
'initVAFlag'
:
false
})
return
;
}
}
/* 切换时 iphone 6 系统:8.4.1 会存储上一次视频,所以,再手动点击播放时,进行切换到当前位置 */
if
(
this
.
switchOpen
)
{
this
.
seekVA
(
this
.
_cache
.
initial_time
);
this
.
switchOpen
=
false
}
this
.
setData
({
'initVAFlag'
:
false
})
/* iphone6 8.4.1 首次初始化时,不能直接 设置进度并播放 */
if
(
this
.
isFirstInitAndSwitchVideo
)
{
this
.
seekVA
(
this
.
_cache
.
initial_time
);
this
.
isFirstInitAndSwitchVideo
=
false
;
}
},
/* VideoOrAudio标签 - 暂停播放时触发pause事件时,触发 - bindpause事件 */
beginPauseVA
:
function
()
{
if
(
this
.
firstOpen
)
{
this
.
setData
({
'ctrlBar.progress'
:
this
.
_cache
.
initial_time
/
this
.
_cacheTotalTime
*
100
+
'%'
});
this
.
setData
({
'ctrlBar.currentTime'
:
util
.
durationToTimeString
(
this
.
_cache
.
initial_time
)
});
this
.
firstOpen
=
false
}
if
(
this
.
switchOpen
)
{
this
.
setData
({
'initVAFlag'
:
false
})
}
},
/* VideoOrAudio标签 - 当播放到末尾时,触发 - bindended事件 */
playEnded
:
function
()
{
wx
.
showToast
({
title
:
'当前音/视频播放完毕。'
,
icon
:
'none'
});
this
.
pauseVA
();
},
...
...
@@ -346,7 +332,7 @@ Page({
timeUpdate
:
function
(
e
)
{
let
_data
=
this
.
data
,
_status
=
_data
.
status
,
_detail
=
e
.
detail
,
_obj
=
_status
.
isVideo
?
this
.
_video
:
this
.
_audio
_obj
.
currentTime
=
parseInt
(
_detail
.
currentTime
)
this
.
_cacheTotalTime
=
_obj
.
totalTime
=
parseInt
(
_detail
.
duration
)
_obj
.
totalTime
=
parseInt
(
_detail
.
duration
)
this
.
setData
({
'ctrlBar.progress'
:
_obj
.
currentTime
/
_obj
.
totalTime
*
100
+
'%'
});
this
.
setData
({
'ctrlBar.currentTime'
:
util
.
durationToTimeString
(
_obj
.
currentTime
)
});
this
.
setData
({
'ctrlBar.totalTime'
:
util
.
durationToTimeString
(
_obj
.
totalTime
)
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论