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

merge...

...@@ -83,7 +83,7 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback) ...@@ -83,7 +83,7 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback)
}) })
} }
/* 获取对应某个章节的详细信息 */ /* 获取对应某个章节的详细信息 */
const getCurrentChapterDetail = (vid, videoType,callback) => { const getCurrentChapterDetail = (sid, vid, videoType,callback) => {
// CC视频请求数据接口 // CC视频请求数据接口
let _url = null; let _url = null;
if(videoType == 3){ if(videoType == 3){
...@@ -96,11 +96,12 @@ const getCurrentChapterDetail = (vid, videoType,callback) => { ...@@ -96,11 +96,12 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
url: _url, url: _url,
method: 'POST', method: 'POST',
data: { data: {
semester_id: sid,
vid: vid vid: vid
}, },
callback: function (res) { callback: function (res) {
// 进入视频,开始读取视频时,存储 vid、log_key // 进入视频,开始读取视频时,存储 vid、log_key
wx.setStorageSync('video_001', { vid: vid, log_key: res.data.log_key || ''}) wx.setStorageSync('video_001', { semester_id: sid, vid: vid, log_key: res.data.log_key || ''})
let json = { let json = {
video: { video: {
src: res.data.video.SD, src: res.data.video.SD,
...@@ -123,8 +124,15 @@ const getCurrentChapterDetail = (vid, videoType,callback) => { ...@@ -123,8 +124,15 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
} }
/* 结束时,调用接口 */ /* 结束时,调用接口 */
const endVideo = () => { const endVideo = (obj) => {
let json = wx.getStorageSync('video_001') || { 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 !== '') {
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',
......
...@@ -2,7 +2,7 @@ import * as api from './api/base.js' ...@@ -2,7 +2,7 @@ import * as api from './api/base.js'
App({ App({
store: { store: {
pageshow: true, pageshow: false,
user: {} // 用户信息 user: {} // 用户信息
}, },
onLaunch: function () {}, onLaunch: function () {},
......
...@@ -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: 'kelley_v3.2.0', appVersion: 'kelley_v3.2.3',
apiBaseURL: 'https://wechat-api.ezijing.com', // 接口请求地址 apiBaseURL: 'https://wechat-api.ezijing.com', // 接口请求地址
tenant: 'kelley' tenant: 'kelley'
} }
} else { } else {
module.exports = { module.exports = {
appVersion: 'kelley_v3.2.0', appVersion: 'kelley_v3.2.3',
apiBaseURL: 'https://wechat-api2.ezijing.com', // 接口请求地址 apiBaseURL: 'https://wechat-api2.ezijing.com', // 接口请求地址
tenant: 'kelley' tenant: 'kelley'
} }
......
...@@ -173,8 +173,7 @@ Page({ ...@@ -173,8 +173,7 @@ Page({
this.setData({ chapterList: json }) this.setData({ chapterList: json })
}) })
// CC视频走这个接口 // CC视频走这个接口
ChapterApi.getCurrentChapterDetail(vid, videoType, (json) => { ChapterApi.getCurrentChapterDetail(sid, vid, videoType, (json) => {
ChapterApi.endVideo()
// 播放的视频数据 // 播放的视频数据
this.setData({ video: json.video }) this.setData({ video: json.video })
this.setData({ audio: json.audio }) this.setData({ audio: json.audio })
...@@ -185,6 +184,7 @@ Page({ ...@@ -185,6 +184,7 @@ Page({
res.cid = cid res.cid = cid
res.sid = sid res.sid = sid
this.initPage(res, vid) this.initPage(res, vid)
ChapterApi.endVideo(res)
}) })
}) })
}, },
...@@ -209,11 +209,11 @@ Page({ ...@@ -209,11 +209,11 @@ Page({
this.isBackend = true this.isBackend = true
this.pauseVA() this.pauseVA()
clearInterval(this.heartbeat) clearInterval(this.heartbeat)
ChapterApi.endVideo() ChapterApi.endVideo(this.realTimeProgress)
}, },
onUnload: function () { onUnload: function () {
this.pauseVA() this.pauseVA()
ChapterApi.endVideo() ChapterApi.endVideo(this.realTimeProgress)
}, },
onShow: function () { onShow: function () {
/* 兼容 android 这里发现 android 打开预览大图,然后关闭 自动播放视频,而且关不掉, 兼容android强制关闭视频 */ /* 兼容 android 这里发现 android 打开预览大图,然后关闭 自动播放视频,而且关不掉, 兼容android强制关闭视频 */
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": false, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
"useApiHostProcess": false, "useApiHostProcess": false,
"babelSetting": { "babelSetting": {
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
"minifyWXSS": true "minifyWXSS": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.3.0", "libVersion": "2.14.1",
"appid": "wx944151f4ea4203a4", "appid": "wxf77457fef076f8a6",
"projectname": "learnOnline", "projectname": "learnOnline",
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
......
...@@ -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: 'kelley', tenant: 'kelley',
version: '3.2.0' version: '3.2.3'
} }
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: 'kelley', tenant: 'kelley',
version: '3.2.0' version: '3.2.3'
} }
let config = url_online let config = url_online
/* 请求接口统一 重定义 */ /* 请求接口统一 重定义 */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论