消息调整

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>回复 <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> --> <!-- <u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon> -->
</view> </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>
<!-- <view> <!-- <view>
<u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon> <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>回复 <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> --> <!-- <u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon> -->
</view> </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> <!-- <view>
<u-icon @click="openInput(commidx,replyIdx)" name="chat" color="#979797" size="18" label="回复"></u-icon> <u-icon @click="openInput(commidx,replyIdx)" name="chat" color="#979797" size="18" label="回复"></u-icon>
</view> </view>

View File

@@ -76,12 +76,21 @@
type:Number, type:Number,
default:0 default:0
}, },
pageType:{
type:Number,
default:0
},
pageParams:{
type:String,
default:''
}
}, },
data() { data() {
return { return {
urlId:'', urlId:'',
loading:false, loading:false,
isPraise:false, isPraise:false,
msgPageType:0,
} }
}, },
watch:{ watch:{
@@ -95,6 +104,11 @@
this.checkHas(); this.checkHas();
this.urlId = location.href.split('=')[1] this.urlId = location.href.split('=')[1]
// this.loadUser(); // this.loadUser();
if(this.pageType==0){
this.msgPageType=this.type;
}else{
this.msgPageType=this.pageType;
}
}, },
computed:{ computed:{
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
@@ -161,21 +175,24 @@
// return; // return;
// content=sendName+typeText+content // content=sendName+typeText+content
// } else { // } else {
if(title) { // }
if(title){
content=sendName+typeText+content+'-'+title content=sendName+typeText+content+'-'+title
} else { } else {
content=sendName+typeText+content content=sendName+typeText+content
} }
// } let msgPageParams=this.pageParams;
if(!msgPageParams){
//msgPageParams=this.data.id;
msgPageParams=this.urlId;
}
let message={ let message={
content, content,
refId, refId,
refType:this.type, refType:this.type,
source:1, source:1,
// pageUrl:location.href,
sendAid:this.userInfo.aid, sendAid:this.userInfo.aid,
sendName, sendName,
acceptName, acceptName,
@@ -184,9 +201,8 @@
sendType:1, sendType:1,
conType, conType,
source:1, source:1,
pageType:this.type, pageType:this.msgPageType,
pageParams:this.urlId, pageParams:msgPageParams,
// pageUrl:location.href,
pageUrl:'', pageUrl:'',
sendAid:this.userInfo.aid, sendAid:this.userInfo.aid,
} }
@@ -216,6 +232,10 @@
} else { } else {
postData.title=this.data.title; postData.title=this.data.title;
} }
//截断处理
if(postData.title.length>50){
postData.title=postData.title.substring(0,50);
}
if(this.loading) { if(this.loading) {
return; return;
} }
@@ -225,8 +245,11 @@
this.loading = false; this.loading = false;
if(res.status==200){ if(res.status==200){
if(res.result){ if(res.result){
if(this.data.praises>0){
this.data.praises--; this.data.praises--;
} }
}
this.isPraise=false; this.isPraise=false;
if(this.unicom) { if(this.unicom) {
this.$store.dispatch("unicomPraises",false) this.$store.dispatch("unicomPraises",false)

View File

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

View File

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