hookehuyr

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

修正showPdf和downloadFile函数中startAction调用的参数传递,确保meta_id正确传入
......@@ -413,7 +413,7 @@ const showPdf = ({ title, url, meta_id }) => {
schedule_id: courseId.value,
meta_id
}
addRecord(paramsObj);
startAction({meta_id});
};
const courseId = computed(() => {
......@@ -466,7 +466,7 @@ onMounted(async () => {
}
// 图片附件或者附件不存在
// 进入后直接执行学习时长埋点
if(course.value.course_type === 'image' || !course.course_type) {
if(course.value.course_type === 'image' || !course.value.course_type) {
startAction();
}
}
......@@ -642,7 +642,7 @@ watch(showCommentPopup, async (newVal) => {
});
// 下载文件
const downloadFile = ({ title, url }) => {
const downloadFile = ({ title, url, meta_id }) => {
// 获取文件URL和文件名
const fileUrl = url;
const fileName = title;
......@@ -689,12 +689,12 @@ const downloadFile = ({ title, url }) => {
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
// 学习时长埋点开始
startAction({meta_id});
}).catch((error) => {
console.error('下载文件出错:', error);
});
// 学习时长埋点开始
startAction();
}
/**
......@@ -756,6 +756,7 @@ const startAction = (item) => {
let paramsObj = {
schedule_id: courseId.value,
meta_id: item?.meta_id,
}
// 更新当前播放位置(如果是视频播放)
......