mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 22:06:43 +08:00
添加动态事件
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user