消息的跳转

This commit is contained in:
zhaofang
2022-11-24 14:43:10 +08:00
parent fc7bd033a0
commit 079517072c
4 changed files with 31 additions and 12 deletions

View File

@@ -27,6 +27,7 @@
<script> <script>
import apiStat from '@/api/phase2/stat.js' import apiStat from '@/api/phase2/stat.js'
import apiPraises from '@/api/modules/praises.js' import apiPraises from '@/api/modules/praises.js'
import apiMessage from '@/api/system/message.js'
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
props: { props: {
@@ -78,6 +79,7 @@
}, },
data() { data() {
return { return {
urlId:'',
loading:false, loading:false,
isPraise:false, isPraise:false,
} }
@@ -91,7 +93,9 @@
} }
}, },
mounted() { mounted() {
console.log(location.href.split('=')[1],'location.href,')
this.checkHas(); this.checkHas();
this.urlId = location.href.split('=')[1]
// this.loadUser(); // this.loadUser();
}, },
computed:{ computed:{
@@ -155,12 +159,17 @@
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 // content=sendName+typeText+content
} else { // } else {
content=sendName+typeText+content+'-'+title if(title) {
} content=sendName+typeText+content+'-'+title
} else {
content=sendName+typeText+content
}
// }
let message={ let message={
@@ -168,7 +177,7 @@
refId, refId,
refType:this.type, refType:this.type,
source:1, source:1,
pageUrl:location.href, // pageUrl:location.href,
sendAid:this.userInfo.aid, sendAid:this.userInfo.aid,
sendName, sendName,
acceptName, acceptName,
@@ -176,6 +185,12 @@
title:'系统消息', title:'系统消息',
sendType:1, sendType:1,
conType, conType,
source:1,
pageType:this.type,
pageParams:this.urlId,
// pageUrl:location.href,
pageUrl:'',
sendAid:this.userInfo.aid,
} }
apiMessage.save(message).then(res=>{ apiMessage.save(message).then(res=>{
if(res.status!=200){ console.log('发送消息失败') } if(res.status!=200){ console.log('发送消息失败') }

View File

@@ -199,6 +199,8 @@ export default {
refType:this.type, refType:this.type,
sendName, sendName,
acceptName, acceptName,
pageType:this.type,
pageParams:refId,
acceptId, acceptId,
title:'系统消息', title:'系统消息',
sendType:1, sendType:1,

View File

@@ -73,17 +73,17 @@
}) })
} }
if (item.refType == 2) { if (item.pageType == 2 || item.pageType == 20) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/resource/articeDetail?id=' + item.refId url: '/pages/resource/articeDetail?id=' + item.pageParams
}); });
} else if (item.refType == 4) { } else if (item.pageType == 4 || item.pageType == 40) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/resource/qaDetail?id=' + item.refId url: '/pages/resource/qaDetail?id=' + item.pageParams
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/study/courseStudy?id=' + item.refId url: '/pages/study/courseStudy?id=' + item.pageParams
}); });
// if (item.conType == '10') { // if (item.conType == '10') {
// uni.navigateTo({ // uni.navigateTo({

View File

@@ -530,7 +530,9 @@ export default {
conType, conType,
content, content,
source:1, source:1,
pageUrl:location.href, pageType:4,
pageParams:this.questionId,
// pageUrl:location.href,
sendAid:this.userInfo.aid, sendAid:this.userInfo.aid,
} }
apiMessage.save(message).then(res=>{ apiMessage.save(message).then(res=>{