发送消息的统一调整

This commit is contained in:
daihh
2022-12-02 14:22:00 +08:00
parent b9ab725e63
commit 97c01ace60
7 changed files with 48 additions and 20 deletions

View File

@@ -87,7 +87,7 @@
</div> </div>
<div class="comment-time portal-time"> <div class="comment-time portal-time">
<showTime :time="com.sysCreateTime"></showTime> <showTime :time="com.sysCreateTime"></showTime>
<interactBar :type="praisesType" :shares="false" :data="com" @addAnswers="showReply(com)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar> <interactBar :type="praisesType" :pageType="objType" :pageParams="objId" :shares="false" :data="com" @addAnswers="showReply(com)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar>
</div> </div>
<div class="comment-btns"> <div class="comment-btns">
@@ -135,7 +135,7 @@
</div> </div>
<div class="comment-time portal-time"> <div class="comment-time portal-time">
<showTime :time="reply.sysCreateTime"></showTime> <showTime :time="reply.sysCreateTime"></showTime>
<interactBar :type="praisesType" :shares="false" :data="reply" @addAnswers="showReply(reply)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar> <interactBar :type="praisesType" :pageType="objType" :pageParams="objId" :shares="false" :data="reply" @addAnswers="showReply(reply)" :favorites="false" :views="false" :comments="false" :answers="true"></interactBar>
</div> </div>
<div class="comment-btns"> <div class="comment-btns">
<!-- <a><svg-icon icon-class="like"></svg-icon><span>66</span></a> --> <!-- <a><svg-icon icon-class="like"></svg-icon><span>66</span></a> -->

View File

@@ -174,11 +174,20 @@ export default {
unicom:{ unicom:{
type:Boolean, type:Boolean,
default:false default:false
},
pageType:{
type:Number,
default:0
},
pageParams:{
type:String,
default:''
} }
}, },
data(){ data(){
return { return {
formatNum:formatUserNumber, formatNum:formatUserNumber,
msgPageType:0,
loading:false, loading:false,
isPraise:false, isPraise:false,
isFavorite:false, isFavorite:false,
@@ -222,6 +231,14 @@ export default {
if(this.data && this.data.id && !this.readonly){ if(this.data && this.data.id && !this.readonly){
this.checkHas(); this.checkHas();
} }
if(this.pageType==0){
this.msgPageType=this.type;
}else{
this.msgPageType=this.pageType;
}
}, },
methods:{ methods:{
addAnswers() { addAnswers() {
@@ -254,7 +271,7 @@ export default {
content='提问' content='提问'
} }
if(this.type==5){ if(this.type==5){
content='回答' content='回答';
} }
if(this.type==6){ if(this.type==6){
content='课程笔记' content='课程笔记'
@@ -273,19 +290,27 @@ export default {
content='案例评论' content='案例评论'
} }
// 评论点赞通知没有关联id,评论通知暂时关闭 // 评论点赞通知没有关联id,评论通知暂时关闭
// 设置了主信息的关联,再把这个判断去掉
if(this.type==60 || this.type==10 || this.type==20 || this.type==30 || this.type == 6) { if(this.type==60 || this.type==10 || this.type==20 || this.type==30 || this.type == 6) {
return; //return;
// content=sendName+typeText+content
} else {
content=sendName+typeText+content+'-'+title
} }
if(title){
content=sendName+typeText+content+'-'+title
}else{
content=sendName+typeText+content
}
let msgPageParams=this.pageParams;
if(!msgPageParams){
msgPageParams=this.data.id;
}
let message={ let message={
content, content,
refId, refId,
refType:this.type, refType:this.type,
source:1, source:1,
pageType:this.msgPageType,
pageParams:msgPageParams,
pageUrl:location.href, pageUrl:location.href,
sendAid:this.userInfo.aid, sendAid:this.userInfo.aid,
sendName, sendName,
@@ -400,9 +425,10 @@ export default {
if(this.unicom) { if(this.unicom) {
this.$store.dispatch("unicomPraises",true) this.$store.dispatch("unicomPraises",true)
} }
if(this.type!=1&&this.type!=5){ //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,'点赞了我的'); this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
} //}
// if(this.type==5){ // if(this.type==5){
// this.messageSave(this.data.id,this.data.content,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'评论了我的'); // 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) { if(this.unicom) {
this.$store.dispatch("unicomFavorites",true) 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.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'收藏了我发布的');
} //}
this.$message({message:'已加入收藏',type:'success'}); this.$message({message:'已加入收藏',type:'success'});
//this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功false代表已存在 //this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功false代表已存在
}else{ }else{
@@ -632,13 +658,13 @@ export default {
if(rs.result){ if(rs.result){
$this.data.shares++; $this.data.shares++;
this.$message.success("分享成功") this.$message.success("分享成功")
if(this.type!=3){ //if(this.type!=3){
if(this.type==1){ if(this.type==1){
this.messageSave(this.data.id,this.data.name,this.userInfo.name,curUser.name,curUser.aid,'分享给我的'); this.messageSave(this.data.id,this.data.name,this.userInfo.name,curUser.name,curUser.aid,'分享给我的');
}else{ }else{
this.messageSave(this.data.id,this.data.title,this.userInfo.name,curUser.name,curUser.aid,'分享给我的'); this.messageSave(this.data.id,this.data.title,this.userInfo.name,curUser.name,curUser.aid,'分享给我的');
} }
} //}
let event = { let event = {
key: "Share",//分享 key: "Share",//分享
title: "分享",//分享 title: "分享",//分享

View File

@@ -29,7 +29,7 @@
</div> </div>
<div class="comment-time portal-time"> <div class="comment-time portal-time">
<showTime :time="com.sysCreateTime"></showTime> <showTime :time="com.sysCreateTime"></showTime>
<interactBar :type="6" :shares="false" :data="com" @addAnswers="showReply(com)" :views="false" :comments="false" :answers="true"></interactBar> <interactBar :type="6" :pageType="1" :pageParams="objId" :shares="false" :data="com" @addAnswers="showReply(com)" :views="false" :comments="false" :answers="true"></interactBar>
</div> </div>
<div v-if="replyInfo.parentId==com.id" class="comment-reply" style="padding-bottom: 5px;margin-top: 20px;"> <div v-if="replyInfo.parentId==com.id" class="comment-reply" style="padding-bottom: 5px;margin-top: 20px;">
<div style="width:100%;display:flex;"> <div style="width:100%;display:flex;">
@@ -65,7 +65,7 @@
</div> </div>
<div class="comment-time portal-time"> <div class="comment-time portal-time">
<showTime :time="reply.sysCreateTime"></showTime> <showTime :time="reply.sysCreateTime"></showTime>
<interactBar :type="60" :shares="false" :data="reply" @addAnswers="showReply(reply)" :views="false" :favorites="false" :comments="false" :answers="true"></interactBar> <interactBar :type="60" :pageType="1" :pageParams="objId" :shares="false" :data="reply" @addAnswers="showReply(reply)" :views="false" :favorites="false" :comments="false" :answers="true"></interactBar>
</div> </div>
</div> </div>
<!--发布回复--> <!--发布回复-->

View File

@@ -35,7 +35,7 @@
</div> </div>
<!-- </el-card> --> <!-- </el-card> -->
<div style="margin-top:10px;"> <div style="margin-top:10px;">
<interactBar :type="2" :data="articleDetailData" :theme='1' :shares="true" ></interactBar> <interactBar v-if="articleDetailData.id" :type="2" :data="articleDetailData" :theme='1' :shares="true" ></interactBar>
</div> </div>
</div> </div>
<!--评论, 修改边距调整--> <!--评论, 修改边距调整-->

View File

@@ -78,7 +78,7 @@
</div> </div>
<div> <div>
<div style="display:inline-block;"> <div style="display:inline-block;">
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true" :unicom="true"></interactBar> <interactBar v-if="caseDetail.id" :data="caseDetail" :type="3" :comments="false" :shares="true" :unicom="true"></interactBar>
</div> </div>
<div style="display:inline-block;margin: 0 20px;"> <div style="display:inline-block;margin: 0 20px;">
<i style="font-size: 25px;color:#6E7B84;" @click="goTop()" class="el-icon-arrow-up"></i> <i style="font-size: 25px;color:#6E7B84;" @click="goTop()" class="el-icon-arrow-up"></i>

View File

@@ -81,7 +81,7 @@
<div class="answer-time"> <div class="answer-time">
<div> <!--之前显示时间的位置--> </div> <div> <!--之前显示时间的位置--> </div>
<div style="margin-right: 10px;"> <div style="margin-right: 10px;">
<interactBar :type="5" :data="item" :comments="false" :shares="false" :views="false"></interactBar> <interactBar :type="5" :pageType="4" :pageParams="detailData.id" :data="item" :comments="false" :shares="false" :views="false"></interactBar>
</div> </div>
</div> </div>
<div class="answer-boot"> <div class="answer-boot">

View File

@@ -814,6 +814,8 @@
refId:this.courseInfo.id, refId:this.courseInfo.id,
refType:1, refType:1,
source:1, source:1,
pageType:1,
pageParams:this.courseInfo.id,
pageUrl:location.href, pageUrl:location.href,
sendAid:this.userInfo.aid, sendAid:this.userInfo.aid,
sendName:this.userInfo.name, sendName:this.userInfo.name,