消息调整

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

@@ -33,7 +33,7 @@
<image style="width: 36upx;height: 36upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-comment.png" size="24"></image>回复
<!-- <u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon> -->
</view>
<interact-bar :type="praisesType" :data="comm" :comments="false" :favorites="false"></interact-bar>
<interact-bar :pageType="objType" :pageParams="objId" :type="praisesType" :data="comm" :comments="false" :favorites="false"></interact-bar>
</view>
<!-- <view>
<u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon>
@@ -66,7 +66,7 @@
<image style="width: 36upx;height: 36upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-comment.png" size="24"></image>回复
<!-- <u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon> -->
</view>
<interact-bar :data="reply" :type="praisesType" :comments="false" :favorites="false"></interact-bar>
<interact-bar :pageType="objType" :pageParams="objId" :data="reply" :type="praisesType" :comments="false" :favorites="false"></interact-bar>
<!-- <view>
<u-icon @click="openInput(commidx,replyIdx)" name="chat" color="#979797" size="18" label="回复"></u-icon>
</view>

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) {

View File

@@ -129,6 +129,14 @@ export default {
type:Number,
default:0 //默认是课程
},
pageType:{
type:Number,
default:0
},
pageParams:{
type:String,
default:''
},
users:{
// type:Object,
}
@@ -192,7 +200,12 @@ export default {
if(this.type==4){
content='问答'
}
content=sendName+typeText+content+'-'+title
if(title){
content=sendName+typeText+content+'-'+title
}else{
content=sendName+typeText+content
}
let message={
content,
refId,

View File

@@ -58,6 +58,14 @@
type:String,
default:'' //如果不存在就使用data的创建人
},
pageType:{
type:Number,
default:0
},
pageParams:{
type:String,
default:''
}
},
computed:{