mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 18:06:47 +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);
|
||||
}
|
||||
|
||||
const updateStudyVideoTime = function(data) {
|
||||
return ajax.post('/xboe/school/study/course/updateStudyVideoTime',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上一次的学习内容
|
||||
* @returns
|
||||
@@ -344,6 +348,7 @@ export default {
|
||||
studyIndex,
|
||||
studyInfo,
|
||||
studyVideoTime,
|
||||
updateStudyVideoTime,
|
||||
lastStudy,
|
||||
studyContent,
|
||||
appendStudyTime,
|
||||
|
||||
@@ -1629,7 +1629,13 @@
|
||||
//console.log('记录播放时间:'+intTime);
|
||||
let postData={
|
||||
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)
|
||||
@@ -1639,15 +1645,17 @@
|
||||
console.log('this.curContent.progressVideo::',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.contentId = this.curContent.id
|
||||
postData.courseId = this.curContent.courseId
|
||||
// postData.contentId = this.curContent.id
|
||||
// postData.courseId = this.curContent.courseId
|
||||
}
|
||||
}
|
||||
//alert(intTime+'----'+this.videoPlayingTime)
|
||||
apiCourseStudy.studyVideoTime(postData).then(rs=>{
|
||||
apiCourseStudy.updateStudyVideoTime(postData).then(rs=>{
|
||||
if(rs.status!=200){
|
||||
console.log('记录播放时间错误');
|
||||
}
|
||||
}else{
|
||||
studyUtil.clearStudyDuration(); //清除本地存储
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -1715,22 +1723,30 @@
|
||||
//console.log('记录播放时间:'+intTime);
|
||||
let postData={
|
||||
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){
|
||||
var time = localStorage.getItem('videoProgressData')
|
||||
var arr = time&&JSON.parse(time) || {}
|
||||
if(arr[this.blobId] && this.curContent.progressVideo<arr[this.blobId]) {
|
||||
postData.progressVideo = arr[this.blobId]
|
||||
postData.contentId = this.curContent.id
|
||||
postData.courseId = this.curContent.courseId
|
||||
// postData.contentId = this.curContent.id
|
||||
// postData.courseId = this.curContent.courseId
|
||||
}
|
||||
}
|
||||
//alert(this.preTime!=intTime +'---'+ saveTime +'---'+ this.curContent.studyItemId)
|
||||
apiCourseStudy.studyVideoTime(postData).then(rs=>{
|
||||
apiCourseStudy.updateStudyVideoTime(postData).then(rs=>{
|
||||
if(rs.status!=200){
|
||||
console.log('记录播放时间错误');
|
||||
}
|
||||
}else{
|
||||
studyUtil.clearStudyDuration(); //清除本地存储
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user