mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-14 05:16:46 +08:00
学习时长上报接口合并
This commit is contained in:
@@ -94,6 +94,10 @@ const studyVideoTime = function(data) {
|
|||||||
return ajax.post('/xboe/school/study/course/study-video-time',data);
|
return ajax.post('/xboe/school/study/course/study-video-time',data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateStudyVideoTime = function(data) {
|
||||||
|
return ajax.post('/xboe/school/study/course/updateStudyVideoTime',data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取上一次的学习内容
|
* 获取上一次的学习内容
|
||||||
* @returns
|
* @returns
|
||||||
@@ -344,6 +348,7 @@ export default {
|
|||||||
studyIndex,
|
studyIndex,
|
||||||
studyInfo,
|
studyInfo,
|
||||||
studyVideoTime,
|
studyVideoTime,
|
||||||
|
updateStudyVideoTime,
|
||||||
lastStudy,
|
lastStudy,
|
||||||
studyContent,
|
studyContent,
|
||||||
appendStudyTime,
|
appendStudyTime,
|
||||||
|
|||||||
@@ -1629,7 +1629,13 @@
|
|||||||
//console.log('记录播放时间:'+intTime);
|
//console.log('记录播放时间:'+intTime);
|
||||||
let postData={
|
let postData={
|
||||||
itemId:this.curContent.studyItemId,
|
itemId:this.curContent.studyItemId,
|
||||||
videoTime:intTime
|
videoTime:intTime,
|
||||||
|
id: this.appentId,
|
||||||
|
studyId: this.studyId,
|
||||||
|
courseId: this.curContent.courseId,
|
||||||
|
contentId: this.curContent.id,
|
||||||
|
studyInfo: this.courseInfo.name +"-" +this.curContent.contentName,
|
||||||
|
duration: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
//alert(3+'--'+this.curriculumData.isDrag +'---'+this.curContent.progressVideo)
|
//alert(3+'--'+this.curriculumData.isDrag +'---'+this.curContent.progressVideo)
|
||||||
@@ -1639,15 +1645,17 @@
|
|||||||
console.log('this.curContent.progressVideo::',arr[this.blobId],this.curContent.progressVideo,arr[this.blobId])
|
console.log('this.curContent.progressVideo::',arr[this.blobId],this.curContent.progressVideo,arr[this.blobId])
|
||||||
if(arr[this.blobId] && this.curContent.progressVideo<arr[this.blobId]) {
|
if(arr[this.blobId] && this.curContent.progressVideo<arr[this.blobId]) {
|
||||||
postData.progressVideo = arr[this.blobId]
|
postData.progressVideo = arr[this.blobId]
|
||||||
postData.contentId = this.curContent.id
|
// postData.contentId = this.curContent.id
|
||||||
postData.courseId = this.curContent.courseId
|
// postData.courseId = this.curContent.courseId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//alert(intTime+'----'+this.videoPlayingTime)
|
//alert(intTime+'----'+this.videoPlayingTime)
|
||||||
apiCourseStudy.studyVideoTime(postData).then(rs=>{
|
apiCourseStudy.updateStudyVideoTime(postData).then(rs=>{
|
||||||
if(rs.status!=200){
|
if(rs.status!=200){
|
||||||
console.log('记录播放时间错误');
|
console.log('记录播放时间错误');
|
||||||
}
|
}else{
|
||||||
|
studyUtil.clearStudyDuration(); //清除本地存储
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1715,22 +1723,30 @@
|
|||||||
//console.log('记录播放时间:'+intTime);
|
//console.log('记录播放时间:'+intTime);
|
||||||
let postData={
|
let postData={
|
||||||
itemId:this.curContent.studyItemId,
|
itemId:this.curContent.studyItemId,
|
||||||
videoTime:intTime
|
videoTime:intTime,
|
||||||
|
id: this.appentId,
|
||||||
|
studyId: this.studyId,
|
||||||
|
courseId: this.curContent.courseId,
|
||||||
|
contentId: this.curContent.id,
|
||||||
|
studyInfo: this.courseInfo.name +"-" +this.curContent.contentName,
|
||||||
|
duration: 10
|
||||||
}
|
}
|
||||||
if(!this.curriculumData.isDrag && this.curContent.progressVideo !=1){
|
if(!this.curriculumData.isDrag && this.curContent.progressVideo !=1){
|
||||||
var time = localStorage.getItem('videoProgressData')
|
var time = localStorage.getItem('videoProgressData')
|
||||||
var arr = time&&JSON.parse(time) || {}
|
var arr = time&&JSON.parse(time) || {}
|
||||||
if(arr[this.blobId] && this.curContent.progressVideo<arr[this.blobId]) {
|
if(arr[this.blobId] && this.curContent.progressVideo<arr[this.blobId]) {
|
||||||
postData.progressVideo = arr[this.blobId]
|
postData.progressVideo = arr[this.blobId]
|
||||||
postData.contentId = this.curContent.id
|
// postData.contentId = this.curContent.id
|
||||||
postData.courseId = this.curContent.courseId
|
// postData.courseId = this.curContent.courseId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//alert(this.preTime!=intTime +'---'+ saveTime +'---'+ this.curContent.studyItemId)
|
//alert(this.preTime!=intTime +'---'+ saveTime +'---'+ this.curContent.studyItemId)
|
||||||
apiCourseStudy.studyVideoTime(postData).then(rs=>{
|
apiCourseStudy.updateStudyVideoTime(postData).then(rs=>{
|
||||||
if(rs.status!=200){
|
if(rs.status!=200){
|
||||||
console.log('记录播放时间错误');
|
console.log('记录播放时间错误');
|
||||||
}
|
}else{
|
||||||
|
studyUtil.clearStudyDuration(); //清除本地存储
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user