2025-11-14 11:39:33 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="msg-detail-page">
|
|
|
|
|
<u-navbar title="消息详情" bg-color="#fff" title-color="#111" :border-bottom="true" @leftClick="goBack">
|
|
|
|
|
<view slot="left">
|
|
|
|
|
<u-icon name="arrow-left" size="44" color="#111"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
</u-navbar>
|
|
|
|
|
|
|
|
|
|
<view class="msg-detail u-p-40">
|
|
|
|
|
<view class="msg-title u-font-20 u-m-b-20">{{ title }}</view>
|
|
|
|
|
<view class="msg-desc u-font-14 u-tips-color">{{ desc }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2026-01-15 17:18:24 +08:00
|
|
|
id:null,
|
2025-11-14 11:39:33 +08:00
|
|
|
title: '',
|
|
|
|
|
desc: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-01-15 17:18:24 +08:00
|
|
|
onShow() {
|
|
|
|
|
this.$checkToken(this.$getToken())
|
|
|
|
|
},
|
2025-11-14 11:39:33 +08:00
|
|
|
onLoad(e) {
|
2026-01-15 17:18:24 +08:00
|
|
|
this.id = e.id
|
|
|
|
|
this.getDetail()
|
2025-11-14 11:39:33 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2026-01-15 17:18:24 +08:00
|
|
|
getDetail(){
|
|
|
|
|
this.$u.get(`/message/detail?id=${this.id}`,{},{
|
|
|
|
|
WT: this.$getToken()
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
if(res.flag) {
|
|
|
|
|
this.title = res.data.title;
|
|
|
|
|
this.desc = res.data.messageContent;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
read(){
|
|
|
|
|
this.$u.get(`/message/read?id=${this.id}`,{},{
|
|
|
|
|
WT: this.$getToken()
|
|
|
|
|
})
|
|
|
|
|
},
|
2025-11-14 11:39:33 +08:00
|
|
|
goBack() {
|
2026-01-15 17:18:24 +08:00
|
|
|
const pages = getCurrentPages();
|
|
|
|
|
if (pages.length > 1) {
|
|
|
|
|
uni.navigateBack();
|
|
|
|
|
} else {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url:'/pages/index/index'
|
|
|
|
|
})
|
|
|
|
|
}
|
2025-11-14 11:39:33 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.msg-detail-page {
|
|
|
|
|
background: #fff;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
}
|
|
|
|
|
.msg-detail {
|
|
|
|
|
line-height: 1.8;
|
|
|
|
|
}
|
|
|
|
|
.msg-title {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
</style>
|