<template>
	<view class="top">
		<text class="iconfont icon-youjiantou zuojiantou" @click="goBack()"></text>
		<text  class="commonTitle">消息详情</text>
	</view>
	<view class="announcement_detail_wrapper container">
		<view class="content">
			<view class="title">
				{{systemMsgInfo.title}}
			</view>
			<view class="date">
				发布时间：{{systemMsgInfo.createdAt}}
			</view>
			<view style="font-size: 25rpx;" v-html="systemMsgInfo.context"></view>
		</view>
	</view>
</template>

<script>
	import api from "../../api/api";
	import common from '../../common/common';
	export default{
		data(){
			return{
				systemMsgInfo:{
					announcementAt:null,
					title:null,
					content:null
				},
				id:null
			}
		},
		name:'system_msg_detail',
		components:{},
		onLoad(options){
			this.id = options.id;
			this.getSystemMsgDetail();
		},
		methods:{
			getSystemMsgDetail(){
				api.querySystemMessageDetail({systemMessageId:this.id}).then((res)=>{
					if(res['success']){
						this.systemMsgInfo = res['data']['systemMessageInfo']
					}
				})
			},
			goBack(){
				uni.navigateTo({
					url:'../systemMsg/system_msg'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top{
		display: flex;
		height: 80rpx;
		justify-content: space-between;
		align-items: center;
		position: relative;
		width: 95%;
		margin: 0 auto;
		.zuojiantou{
			left: 0;
		}
		text:nth-child(2){
			width: 100%;
			text-align: center;
			position: absolute;
		}
	}
	.announcement_detail_wrapper{
		padding: 20rpx 16rpx;
		.title{
			font-size: 48rpx;
		}
		.date{
			color: #8d9599;
			margin: 20rpx 0;
			border-bottom: 2rpx #F8F8F8 solid;
			padding-bottom: 20rpx;
			font-size: 24rpx;
		}
		.content{
			margin-top: 20rpx;
			padding: 20rpx;
			background: #fff;
			word-break: break-word;
		}
	}
</style>