事件添加

This commit is contained in:
zhaofang
2022-11-15 17:09:30 +08:00
parent 145b2988f7
commit 0001f411fe
8 changed files with 251 additions and 24 deletions

View File

@@ -32,7 +32,7 @@
<script>
import apiArticle from '@/api/modules/article.js'
import apiUser from '@/api/system/user.js'
import apiStat from '@/api/phase2/stat.js'
import { mapGetters } from 'vuex';
export default {
data() {
@@ -56,6 +56,32 @@
this.id = options.id;
this.getDetail();
},
mounted() {
let event = {
key: "ViewArticle",//后台的事件key 发布文章且审核通过
title: "查看文章",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "查看了文章",//事件的内容
source:'page',
objId: this.id,//关联的id
objType: "2",//关联的类型
objInfo: this.detail.title,
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 ,//状态直接写1
source:2,
}
apiStat.sendEvent(event);
// this.$store.dispatch("userTrigger", event);
this.setTime = setTimeout(()=>{
event.key = 'ReadArticle';
event.title = "阅读文章";
event.parameters='second:60';//增加60秒的学习时长
event.content = "阅读了文章"
apiStat.sendEvent(event);
// $this.$store.dispatch("userTrigger", event);
},61000);//1分钟后记录
},
onReachBottom(){
this.getDetail()
},