添加动态事件

This commit is contained in:
zhaofang
2022-09-14 15:15:19 +08:00
parent 4109cab4b4
commit 5146759a08
8 changed files with 127 additions and 4 deletions

View File

@@ -384,6 +384,19 @@ export default {
window.addEventListener("scroll", this.handleScroll);
this.getAnkingData();
this.couresreso();
let event = {
key: "ReadQuestion",//后台的事件key 发布文章且审核通过
title: "阅读问题",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "打开问题页面时触发",//事件的内容
objId: this.qid,//关联的id
objType: "4",//关联的类型
objInfo: "问答",
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
},
beforeDestroy() {
window.removeEventListener("scroll", this.handleScroll);
@@ -639,6 +652,19 @@ export default {
this.getQuestionDetail();
this.loadAnswer();
this.content = "";
let event = {
key: "AnswerQuestion",//后台的事件key
title: "回答问题",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "回答别人提出的问题",//事件的内容
objId: this.qid,//关联的id
objType: "4",//关联的类型
objInfo: "问答",
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
this.$store.dispatch("userTrigger", event);
} else {
this.$message({ message: res.message, type: "error" });
}