mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-14 21:36:45 +08:00
事件发送修改
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import apiShares from '@/api/modules/shares.js'
|
import apiShares from '@/api/modules/shares.js'
|
||||||
import apiUser from '@/api/system/user.js'
|
import apiUser from '@/api/system/user.js'
|
||||||
|
import apiStat from '@/api/phase2/stat.js'
|
||||||
import apiMessage from '@/api/system/message.js'
|
import apiMessage from '@/api/system/message.js'
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
@@ -49,6 +50,10 @@
|
|||||||
type:Number,
|
type:Number,
|
||||||
default:0 //默认是课程
|
default:0 //默认是课程
|
||||||
},
|
},
|
||||||
|
authorId:{
|
||||||
|
type:String,
|
||||||
|
default:'' //如果不存在就使用data的创建人
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
@@ -157,12 +162,30 @@
|
|||||||
//uni.showToast({title: '不能分享给自己', icon: 'none' });
|
//uni.showToast({title: '不能分享给自己', icon: 'none' });
|
||||||
this.$refs.messager.show({message:'不能分享给自己',type:'error',zIndex:100090});
|
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=>{
|
apiShares.save(postData).then(rs=>{
|
||||||
if(rs.status==200){
|
if(rs.status==200){
|
||||||
if(rs.result){
|
if(rs.result){
|
||||||
this.shareInfo.show=false;
|
this.shareInfo.show=false;
|
||||||
this.$refs.messager.show({message:'分享成功',type:'success'});
|
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!=3){
|
||||||
if(this.type==1){
|
if(this.type==1){
|
||||||
//发送消息
|
//发送消息
|
||||||
|
|||||||
Reference in New Issue
Block a user