<template>
	<view class="top">
		<text class="iconfont icon-youjiantou" @click="goBack()"></text>
		<text>消息详情</text>
	</view>
	<view class="announcement_detail_wrapper container">
		<view class="content">
			<view class="title">
				{{systemMsgInfo.title}}
			</view>
			<view class="date">
				发布时间：{{systemMsgInfo.createdAt}}
			</view>
			<view 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(){
			this.getSystemMsgDetail();
		},
		methods:{
			getSystemMsgDetail(){
				this.id = common.getQueryString('id');
				api.querySystemMessageDetail({systemMessageId:this.id}).then((res)=>{
					if(res['success']){
						this.systemMsgInfo = res['data']['systemMessageInfo']
						console.log(this.systemMsgInfo)
					}
				})
			},
			goBack(){
				uni.navigateTo({
					url:'../systemMsg/system_msg'
				})
			}
		}
	}
</script>

<style lang="scss">
	.top{
		display: flex;
		height: 80rpx;
		justify-content: space-between;
		align-items: center;
		position: relative;
		width: 95%;
		margin: 0 auto;
		.icon-youjiantou{
			display: inline-block;
			transform: rotate(180deg);
			font-size: 30rpx;
			z-index: 1;
		}
		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;
		}
		.content{
			margin-top: 20rpx;
			padding: 20rpx;
			background: #fff;
		}
	}
</style>