<template>
	<view class="container">
		<view class="title" :style="{ height: height + 'px', lineHeight: height + 'px', paddingTop: top + 'px' }">
			<uni-icons @click="back" class="back" color="#fff" type="back" size="25"></uni-icons>
			<text>{{ info.title }}</text>
		</view>
		<!-- <text class="time">创建时间：{{ info.createTime }}</text> -->
		<rich-text image-menu-prevent="true" :nodes="info.content || info.noticeContent" class="content"></rich-text>
		<!-- <view class="content" v-html="info.content || info.noticeContent"> -->
		</view>
	</view>
</template>

<script>
	import request from '../../api/cms.js';
	import requestNotice from '../../api/system.js';
	export default {
		onLoad: function (option) {
			this.id = option.id;
		},
		data() {
			return {
				id: '',
				info: null,
				height: 60,
				top: 25,
			}
		},
		async mounted() {
			const res = await request.getArticleDetail({ id: this.id });
			this.info = res.data;
			await request.addBlogViews({ id: this.id });
			const client = wx.getMenuButtonBoundingClientRect();
			this.height = client.height;
			this.top = client.top;
		},
		methods: {
			back() {
				uni.navigateBack();
			}
		}
	}
</script>

<style>
	.title {
		display: flex;
		color: #fff;
		background-color: #fd6b18;
	}
	.back {
		margin: 0 15px 0 5px;
	}
	.time {
		width: 100%;
		text-align: center;
		display: block;
		font-size: 12px;
	}
	.content {
		display: block;
		width: 90%;
		margin: 10px auto;
	}
</style>
