From 50de4fcb99176b73801604da499e9be304a21149 Mon Sep 17 00:00:00 2001 From: nisen Date: Mon, 20 Nov 2023 16:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BE=8B=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/case/Detail.vue | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/views/portal/case/Detail.vue b/src/views/portal/case/Detail.vue index 180157ce..be0d17ce 100644 --- a/src/views/portal/case/Detail.vue +++ b/src/views/portal/case/Detail.vue @@ -548,18 +548,8 @@ export default { let totalTime = Math.round((endTime - startTime) / 1000); this.cumulativeDuration += totalTime if(this.cumulativeDuration <= this.defaultMaxTime){ - this.$store.dispatch("userTrigger", { - key: "ReadCase",//后台的事件key 发布文章且审核通过 - title: '阅读案例',//事件的标题 - parameters: "second:" + totalTime,//用户自定义参数 name:value,name:value - content: '阅读了案例',//事件的内容 - objId: this.resolveId,//关联的id - objType: "3",//关联的类型 - objInfo: this.caseDetail.title, - aid: this.userInfo.aid, //当前登录人的id - aname: this.userInfo.name,//当前人的姓名 - status: 1 //状态,直接写1 - }); + console.log(totalTime,'时长'); + this.sendStudyTime(totalTime) this.secondTime = 60 this.sendEventData() }else{ @@ -569,6 +559,20 @@ export default { } }, this.secondTime * 1000);//15秒记录一次之后1分钟之后发送阅读案例事件 }, + sendStudyTime(totalTime){ + this.$store.dispatch("userTrigger", { + key: "ReadCase",//后台的事件key 发布文章且审核通过 + title: '阅读案例',//事件的标题 + parameters: "second:" + totalTime,//用户自定义参数 name:value,name:value + content: '阅读了案例',//事件的内容 + objId: this.resolveId,//关联的id + objType: "3",//关联的类型 + objInfo: this.caseDetail.title, + aid: this.userInfo.aid, //当前登录人的id + aname: this.userInfo.name,//当前人的姓名 + status: 1 //状态,直接写1 + }); + }, getCaseData() { let $this = this; apiCase.details(this.resolveId, true).then(res => {