消息调整

This commit is contained in:
daihh
2022-12-02 15:17:34 +08:00
parent 14d65ad9c4
commit bdb04524cd
4 changed files with 64 additions and 20 deletions

View File

@@ -76,26 +76,40 @@
type:Number,
default:0
},
pageType:{
type:Number,
default:0
},
pageParams:{
type:String,
default:''
}
},
data() {
return {
urlId:'',
loading:false,
isPraise:false,
isPraise:false,
msgPageType:0,
}
},
watch:{
watch:{
data(newVal,oldVal){
if(newVal && newVal.id!=''){
this.checkHas();
}
}
},
mounted() {
},
mounted() {
this.checkHas();
this.urlId = location.href.split('=')[1]
// this.loadUser();
},
if(this.pageType==0){
this.msgPageType=this.type;
}else{
this.msgPageType=this.pageType;
}
},
computed:{
...mapGetters(['userInfo']),
},
@@ -161,21 +175,24 @@
// return;
// content=sendName+typeText+content
// } else {
if(title) {
// }
if(title){
content=sendName+typeText+content+'-'+title
} else {
content=sendName+typeText+content
}
// }
let msgPageParams=this.pageParams;
if(!msgPageParams){
//msgPageParams=this.data.id;
msgPageParams=this.urlId;
}
let message={
content,
refId,
refType:this.type,
source:1,
// pageUrl:location.href,
sendAid:this.userInfo.aid,
sendName,
acceptName,
@@ -184,10 +201,9 @@
sendType:1,
conType,
source:1,
pageType:this.type,
pageParams:this.urlId,
// pageUrl:location.href,
pageUrl:'',
pageType:this.msgPageType,
pageParams:msgPageParams,
pageUrl:'',
sendAid:this.userInfo.aid,
}
apiMessage.save(message).then(res=>{
@@ -208,14 +224,18 @@
}
if(this.type==1){
postData.title=this.data.name;
postData.title=this.data.name;
}else if(this.type == 5){
postData.title=this.data.content;
postData.title=this.data.content;
} else if(this.type == 10 || this.type == 20 || this.type == 30){
postData.title=this.data.content;
postData.title=this.data.content;
} else {
postData.title=this.data.title;
}
//截断处理
if(postData.title.length>50){
postData.title=postData.title.substring(0,50);
}
if(this.loading) {
return;
}
@@ -225,7 +245,10 @@
this.loading = false;
if(res.status==200){
if(res.result){
this.data.praises--;
if(this.data.praises>0){
this.data.praises--;
}
}
this.isPraise=false;
if(this.unicom) {