事件发送修改

This commit is contained in:
daihh
2022-11-14 15:21:43 +08:00
parent 5da0ebf560
commit fd4f1dbc45

View File

@@ -32,6 +32,7 @@
<script>
import apiShares from '@/api/modules/shares.js'
import apiUser from '@/api/system/user.js'
import apiStat from '@/api/phase2/stat.js'
import apiMessage from '@/api/system/message.js'
import { mapGetters } from 'vuex';
export default {
@@ -49,6 +50,10 @@
type:Number,
default:0 //默认是课程
},
authorId:{
type:String,
default:'' //如果不存在就使用data的创建人
},
},
computed:{
@@ -157,12 +162,30 @@
//uni.showToast({title: '不能分享给自己', icon: 'none' });
this.$refs.messager.show({message:'不能分享给自己',type:'error',zIndex:100090});
}
let $this=this;
let authorUserId=this.data.sysCreateAid;
if(this.authorId){
authorUserId=this.authorId;
}
apiShares.save(postData).then(rs=>{
if(rs.status==200){
if(rs.result){
this.shareInfo.show=false;
this.$refs.messager.show({message:'分享成功',type:'success'});
this.$emit("share-success", rs.result);
let event = {
key: "Share",//分享
title: "分享",//分享
parameters:"author:"+authorUserId,//内容的作者
content: '分享',//事件的内容
objId: this.data.id,//关联的id
objType: this.type,//关联的类型
objInfo: this.data.title? this.data.title:this.data.name,
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 //状态直接写1
}
apiStat.sendEvent(event);
this.$emit("success", rs.result);
if(this.type!=3){
if(this.type==1){
//发送消息