Files
2026-05-12 15:19:37 +08:00

91 lines
1.5 KiB
Vue

<template>
<view>
<view class="message">
<view class="title">{{messageInfo.noticeTitle}}</view>
<view class="date">{{dataFormat(messageInfo.noticeTime/1000,true)}}</view>
<view class="content" v-html="messageInfo.noticeContent"></view>
</view>
</view>
</template>
<script>
import { noticeDetail } from "@/api/user";
import { dataFormat } from "@/utils";
export default {
data() {
return {
id:0,
messageInfo:{}
}
},
methods: {
dataFormat,
getData:function(){
let that = this;
const id = this.id;
if (!id) {
uni.showToast({
title:"消息id不存在",
icon: "none",
duration: 2000
});
return;
}
noticeDetail({
id:this.id
}).then((res)=>{
that.messageInfo = res.data;
}).catch((err)=>{
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
})
}
},
onLoad:function(e){
this.id = e.id;
this.getData();
}
}
</script>
<style lang="less">
page{
background-color: #fff !important;
}
.message{
padding: 0.36*100rpx;
}
.title{
font-size:0.36*100rpx;
font-weight: bold;
color:rgba(8,15,26,1);
}
.date{
font-size:0.24*100rpx;
font-weight: bold;
color:rgba(139,143,153,1);
margin-top: 0.24*100rpx;
margin-bottom: 0.4*100rpx;
}
.content{
padding: 0.1*100rpx;
color: #080F1A;
}
</style>