mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-10 03:16:45 +08:00
事件添加
This commit is contained in:
@@ -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()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user