学习时长上报接口合并

This commit is contained in:
sunhonglai
2025-04-18 08:51:48 +08:00
parent 213e5abce3
commit 8746904cb9

View File

@@ -1185,7 +1185,12 @@
let postData = {
itemId: this.contentData.studyItemId,
videoTime: intTime,
type: 0
id: this.appentId,
studyId: this.studyId,
courseId: this.contentData.courseId,
contentId: this.contentData.id,
studyInfo: this.courseInfo.name +"-" +this.contentData.contentName,
duration: 10
};
//console.log('this.courseInfo:',this.contentData)
if(!this.curriculumData.isDrag && this.contentData.progressVideo !=1){
@@ -1193,14 +1198,16 @@
var arr = time&&JSON.parse(time) || {}
if(arr[this.blobId] && this.contentData.progressVideo<arr[this.blobId]) {
postData.progressVideo = arr[this.blobId]
postData.contentId = this.contentData.id
postData.courseId = this.contentData.courseId
// postData.contentId = this.contentData.id
// postData.courseId = this.contentData.courseId
}
}
//console.log('记录播放时间')
apiStudy.updateStudyVideoTime(postData).then(rs => {
if (rs.status != 200) {
console.log('记录播放时间错误');
}else{
studyUtil.clearStudyDuration(); //清除本地存储
}
});
}
@@ -1237,7 +1244,13 @@
this.contentData.lastStudyTime = intTime;
let postData = {
itemId: this.contentData.studyItemId,
videoTime: intTime
videoTime: intTime,
id: this.appentId,
studyId: this.studyId,
courseId: this.contentData.courseId,
contentId: this.contentData.id,
studyInfo: this.courseInfo.name +"-" +this.contentData.contentName,
duration: 10
};
//console.log('this.courseInfo:',this.contentData)
if(!this.curriculumData.isDrag && this.contentData.progressVideo !=1){
@@ -1245,14 +1258,16 @@
var arr = time&&JSON.parse(time) || {}
if(arr[this.blobId] && this.contentData.progressVideo<arr[this.blobId]) {
postData.progressVideo = arr[this.blobId]
postData.contentId = this.contentData.id
postData.courseId = this.contentData.courseId
// postData.contentId = this.contentData.id
// postData.courseId = this.contentData.courseId
}
}
//console.log('记录播放时间')
apiStudy.studyVideoTime(postData).then(rs => {
apiStudy.updateStudyVideoTime(postData).then(rs => {
if (rs.status != 200) {
console.log('记录播放时间错误');
}else{
studyUtil.clearStudyDuration(); //清除本地存储
}
});
}
@@ -1527,23 +1542,23 @@
console.log(rs.message);
}
});
let postAppendData = {
id: this.appentId,
studyId: this.studyId,
courseId: this.courseInfo.id,
contentId: this.contentData.id,
studyInfo: this.courseInfo.name +"-" +this.contentData.contentName,
duration: duration,
type: 1
};
apiStudy.updateStudyVideoTime(postAppendData).then(rs => {
if (rs.status == 200) {
this.appentId = rs.result;
studyUtil.clearStudyDuration(); //清除本地存储
} else {
console.log(rs.message);
}
});
// let postAppendData = {
// id: this.appentId,
// studyId: this.studyId,
// courseId: this.courseInfo.id,
// contentId: this.contentData.id,
// studyInfo: this.courseInfo.name +"-" +this.contentData.contentName,
// duration: duration,
// type: 1
// };
// apiStudy.updateStudyVideoTime(postAppendData).then(rs => {
// if (rs.status == 200) {
// this.appentId = rs.result;
// studyUtil.clearStudyDuration(); //清除本地存储
// } else {
// console.log(rs.message);
// }
// });
}
},
//结束追加学习时长