|
@@ -112,6 +112,7 @@ export default defineComponent({
|
|
|
detail: null as any,
|
|
|
knowledgePointList: [] as any,
|
|
|
itemList: [] as any,
|
|
|
+ lookVideoDataList: [] as any, // 观看视频统计数据
|
|
|
showHead: true,
|
|
|
isCourse: false,
|
|
|
isRecordPlay: false,
|
|
@@ -179,11 +180,13 @@ export default defineComponent({
|
|
|
material.content = localData.content.localPath
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ const videoData = data.lookVideoDataList.find(
|
|
|
+ (i: any) => i.materialId === material.materialId
|
|
|
+ )
|
|
|
list.push({
|
|
|
...material,
|
|
|
- moreTime: [],
|
|
|
- videoTime: 0, // 视频时长
|
|
|
+ moreTime: videoData?.videoBrowseData ? JSON.parse(videoData.videoBrowseData) : [],
|
|
|
+ videoTime: videoData?.videoTime || 0, // 视频时长
|
|
|
iframeRef: null,
|
|
|
videoEle: null,
|
|
|
tabName: name,
|
|
@@ -322,7 +325,7 @@ export default defineComponent({
|
|
|
// 获取学生观看数据
|
|
|
const getLookVideoData = async () => {
|
|
|
try {
|
|
|
- const { data } = await request.get(
|
|
|
+ const res = await request.get(
|
|
|
state.platformApi + `/studentCoursewareMaterialRelation/findByDetailId`,
|
|
|
{
|
|
|
hideLoading: true,
|
|
@@ -331,7 +334,7 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
- console.log(data)
|
|
|
+ data.lookVideoDataList = res.data || [] // 视频播放数据
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -769,16 +772,12 @@ export default defineComponent({
|
|
|
params.push(temp)
|
|
|
}
|
|
|
})
|
|
|
- // const videoBrowseData = moreTime.value.length > 0 ? formatEffectiveTime(moreTime.value) : []
|
|
|
- // console.log(moreTime.value, videoBrowseData, 'video')
|
|
|
- // const time = videoBrowseData.length > 0 ? formatTimer(videoBrowseData) : 0
|
|
|
- // const videoCountTime = videoIntervalRef?.counter.value
|
|
|
- // 判断如何视屏播放时间大于视屏播放有效时间则说明数据有问题,进行重置数据
|
|
|
- // const rate = Math.floor((time / Math.floor(forms.pointVideoTime)) * 100)
|
|
|
- // console.log('videoIntervalRef?.counter.value', videoIntervalRef?.counter.value)
|
|
|
- await request.post('/api-student/studentCoursewareMaterialRelation/save', {
|
|
|
- data: params
|
|
|
- })
|
|
|
+
|
|
|
+ if (params.length > 0) {
|
|
|
+ await request.post('/api-student/studentCoursewareMaterialRelation/save', {
|
|
|
+ data: params
|
|
|
+ })
|
|
|
+ }
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -790,7 +789,7 @@ export default defineComponent({
|
|
|
// 同步数据时先进行有效时间进行保存
|
|
|
initVideoCount(false, true)
|
|
|
|
|
|
- // await updateStat()
|
|
|
+ await updateStat()
|
|
|
videoIntervalRef.counter.value = 0
|
|
|
}, 10000)
|
|
|
})
|