hookehuyr

fix(StudyDetailPage): 修复学习时长埋点参数传递问题

修正showPdf和downloadFile函数中startAction调用的参数传递,确保meta_id正确传入
...@@ -413,7 +413,7 @@ const showPdf = ({ title, url, meta_id }) => { ...@@ -413,7 +413,7 @@ const showPdf = ({ title, url, meta_id }) => {
413 schedule_id: courseId.value, 413 schedule_id: courseId.value,
414 meta_id 414 meta_id
415 } 415 }
416 - addRecord(paramsObj); 416 + startAction({meta_id});
417 }; 417 };
418 418
419 const courseId = computed(() => { 419 const courseId = computed(() => {
...@@ -466,7 +466,7 @@ onMounted(async () => { ...@@ -466,7 +466,7 @@ onMounted(async () => {
466 } 466 }
467 // 图片附件或者附件不存在 467 // 图片附件或者附件不存在
468 // 进入后直接执行学习时长埋点 468 // 进入后直接执行学习时长埋点
469 - if(course.value.course_type === 'image' || !course.course_type) { 469 + if(course.value.course_type === 'image' || !course.value.course_type) {
470 startAction(); 470 startAction();
471 } 471 }
472 } 472 }
...@@ -642,7 +642,7 @@ watch(showCommentPopup, async (newVal) => { ...@@ -642,7 +642,7 @@ watch(showCommentPopup, async (newVal) => {
642 }); 642 });
643 643
644 // 下载文件 644 // 下载文件
645 -const downloadFile = ({ title, url }) => { 645 +const downloadFile = ({ title, url, meta_id }) => {
646 // 获取文件URL和文件名 646 // 获取文件URL和文件名
647 const fileUrl = url; 647 const fileUrl = url;
648 const fileName = title; 648 const fileName = title;
...@@ -689,12 +689,12 @@ const downloadFile = ({ title, url }) => { ...@@ -689,12 +689,12 @@ const downloadFile = ({ title, url }) => {
689 document.body.removeChild(a); 689 document.body.removeChild(a);
690 690
691 window.URL.revokeObjectURL(url); 691 window.URL.revokeObjectURL(url);
692 + // 学习时长埋点开始
693 + startAction({meta_id});
692 }).catch((error) => { 694 }).catch((error) => {
693 console.error('下载文件出错:', error); 695 console.error('下载文件出错:', error);
694 }); 696 });
695 697
696 - // 学习时长埋点开始
697 - startAction();
698 } 698 }
699 699
700 /** 700 /**
...@@ -756,6 +756,7 @@ const startAction = (item) => { ...@@ -756,6 +756,7 @@ const startAction = (item) => {
756 756
757 let paramsObj = { 757 let paramsObj = {
758 schedule_id: courseId.value, 758 schedule_id: courseId.value,
759 + meta_id: item?.meta_id,
759 } 760 }
760 761
761 // 更新当前播放位置(如果是视频播放) 762 // 更新当前播放位置(如果是视频播放)
......