mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 17:36:45 +08:00
事件添加
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
||||
import apiMessage from '@/api/system/message.js'
|
||||
import apiStat from '@/api/phase2/stat.js'
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
props: {
|
||||
@@ -323,6 +324,20 @@ export default {
|
||||
this.toUserDig.chooseUserName='';
|
||||
this.inputShow=false;
|
||||
this.$emit("comment-success", res.result);
|
||||
let event = {
|
||||
key: "PublishComment",//后台的事件key 发布文章且审核通过
|
||||
title: "发表评论",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: "每发表一个评论",//事件的内容
|
||||
objId: res.result.id,//关联的id
|
||||
objType: '80',//关联的类型,这里关联的类型应该是评论,不是课程
|
||||
objInfo: "评论",
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'发布失败',type:'error'});
|
||||
}
|
||||
@@ -359,12 +374,58 @@ export default {
|
||||
this.isPraise=false;
|
||||
this.$refs.interactToast.show({message:'取消点赞',type:'success'});
|
||||
this.$emit("praise-success", res.result);
|
||||
let event = {
|
||||
key: "CancelPraise",//
|
||||
title: "取消点赞",//事件的标题
|
||||
parameters:"author:"+authorId,//用户自定义参数 name:value,name:value
|
||||
content: "取消点赞"+postData.title,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'取消失败',type:'error'});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
let contentText = '';
|
||||
if(this.type==1){
|
||||
contentText='课程';
|
||||
// conType = this.data.type;
|
||||
}
|
||||
if(this.type==2){
|
||||
contentText='文章'
|
||||
}
|
||||
if(this.type==3){
|
||||
contentText='案例'
|
||||
}
|
||||
if(this.type==4){
|
||||
contentText='提问'
|
||||
}
|
||||
if(this.type==5){
|
||||
contentText='回答'
|
||||
}
|
||||
if(this.type==6){
|
||||
contentText='课程笔记'
|
||||
}
|
||||
if(this.type==60){
|
||||
contentText='课程笔记评论'
|
||||
}
|
||||
// 点赞type
|
||||
if(this.type==10){
|
||||
contentText='课程评论'
|
||||
}
|
||||
if(this.type==20){
|
||||
contentText='文章评论'
|
||||
}
|
||||
if(this.type==30){
|
||||
contentText='案例评论'
|
||||
}
|
||||
apiPraises.save(postData).then(res=>{
|
||||
this.loading=false;
|
||||
if(res.status==200){
|
||||
@@ -375,6 +436,20 @@ export default {
|
||||
this.$refs.interactToast.show({message:'点赞成功',type:'success'});
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
||||
this.$emit("praise-success", res.result);
|
||||
let event = {
|
||||
key: "Praise",//后台的事件key 发布文章且审核通过
|
||||
title: "点赞",//事件的标题
|
||||
parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value
|
||||
content: "点赞了"+contentText,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'点赞失败',type:'error'});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user