提交 68405175 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 f295842d
...@@ -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,6 +125,7 @@ const getCurrentChapterDetail = (sid, vid, videoType,callback) => { ...@@ -126,6 +125,7 @@ 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: '' }
if (json.vid !== '') {
json.uid = wx.getStorageSync('uid') json.uid = wx.getStorageSync('uid')
json.sid = wx.getStorageSync('sid') json.sid = wx.getStorageSync('sid')
json.d = obj.did json.d = obj.did
...@@ -133,7 +133,6 @@ const endVideo = (obj) => { ...@@ -133,7 +133,6 @@ const endVideo = (obj) => {
json.c = obj.cid json.c = obj.cid
json.s = json.semester_id json.s = json.semester_id
json.v = json.vid json.v = json.vid
if (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',
......
...@@ -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'
} }
......
<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>
......
<template name='contentVideo'> <template name='contentVideo'>
<!-- 这里加 这么多判断原因,video组件在真机上测试,一定在最上层,其他任何元素都挡不住,只能先隐藏,需要时再显示 --> <!-- 这里加 这么多判断原因,video组件在真机上测试,一定在最上层,其他任何元素都挡不住,只能先隐藏,需要时再显示 -->
<view class='content-video' wx:if="{{status.isVideo}}"> <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}}' 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 \ No newline at end of file
...@@ -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(':'),
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false, "uglifyFileName": true,
"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
} }
] ]
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论