mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 05:16:43 +08:00
发送消息的统一调整
This commit is contained in:
@@ -174,11 +174,20 @@ export default {
|
||||
unicom:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
pageType:{
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
pageParams:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
formatNum:formatUserNumber,
|
||||
msgPageType:0,
|
||||
loading:false,
|
||||
isPraise:false,
|
||||
isFavorite:false,
|
||||
@@ -222,6 +231,14 @@ export default {
|
||||
if(this.data && this.data.id && !this.readonly){
|
||||
this.checkHas();
|
||||
}
|
||||
|
||||
if(this.pageType==0){
|
||||
this.msgPageType=this.type;
|
||||
}else{
|
||||
this.msgPageType=this.pageType;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods:{
|
||||
addAnswers() {
|
||||
@@ -254,7 +271,7 @@ export default {
|
||||
content='提问'
|
||||
}
|
||||
if(this.type==5){
|
||||
content='回答'
|
||||
content='回答';
|
||||
}
|
||||
if(this.type==6){
|
||||
content='课程笔记'
|
||||
@@ -273,19 +290,27 @@ export default {
|
||||
content='案例评论'
|
||||
}
|
||||
// 评论点赞通知没有关联id,评论通知暂时关闭
|
||||
// 设置了主信息的关联,再把这个判断去掉
|
||||
if(this.type==60 || this.type==10 || this.type==20 || this.type==30 || this.type == 6) {
|
||||
return;
|
||||
// content=sendName+typeText+content
|
||||
} else {
|
||||
content=sendName+typeText+content+'-'+title
|
||||
//return;
|
||||
}
|
||||
|
||||
|
||||
if(title){
|
||||
content=sendName+typeText+content+'-'+title
|
||||
}else{
|
||||
content=sendName+typeText+content
|
||||
}
|
||||
let msgPageParams=this.pageParams;
|
||||
if(!msgPageParams){
|
||||
msgPageParams=this.data.id;
|
||||
}
|
||||
let message={
|
||||
content,
|
||||
refId,
|
||||
refType:this.type,
|
||||
source:1,
|
||||
pageType:this.msgPageType,
|
||||
pageParams:msgPageParams,
|
||||
pageUrl:location.href,
|
||||
sendAid:this.userInfo.aid,
|
||||
sendName,
|
||||
@@ -400,9 +425,10 @@ export default {
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomPraises",true)
|
||||
}
|
||||
if(this.type!=1&&this.type!=5){
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
||||
}
|
||||
//console.log('点选了我的 pageType='+this.msgPageType+','+this.pageParams)
|
||||
//if(this.type!=1&&this.type!=5){
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
||||
//}
|
||||
// if(this.type==5){
|
||||
// this.messageSave(this.data.id,this.data.content,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'评论了我的');
|
||||
// }
|
||||
@@ -520,9 +546,9 @@ export default {
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomFavorites",true)
|
||||
}
|
||||
if(this.type===2||this.type===4){
|
||||
//if(this.type===2||this.type===4){
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'收藏了我发布的');
|
||||
}
|
||||
//}
|
||||
this.$message({message:'已加入收藏',type:'success'});
|
||||
//this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功,false代表已存在
|
||||
}else{
|
||||
@@ -632,13 +658,13 @@ export default {
|
||||
if(rs.result){
|
||||
$this.data.shares++;
|
||||
this.$message.success("分享成功")
|
||||
if(this.type!=3){
|
||||
//if(this.type!=3){
|
||||
if(this.type==1){
|
||||
this.messageSave(this.data.id,this.data.name,this.userInfo.name,curUser.name,curUser.aid,'分享给我的');
|
||||
}else{
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,curUser.name,curUser.aid,'分享给我的');
|
||||
}
|
||||
}
|
||||
//}
|
||||
let event = {
|
||||
key: "Share",//分享
|
||||
title: "分享",//分享
|
||||
|
||||
Reference in New Issue
Block a user