<template>
	<view class="container">
		<page-title>公告详情</page-title>

		<view class="cards-list">
			<view class="card only-card">
				<view class="card-item first-card-item">
					<view class="card-item-announcement-detail">{{pageForm.title}}</view>
				</view>

				<view class="card-item">
					<view class="card-item-name">发布时间: {{pageForm.publishDate}}</view>
				</view>
			</view>

			<view class="card">
				<view class="card-item" style="padding-top: 40rpx;">
					<view class="card-item-announcement">详情内容：</view>
				</view>

				<view class="card-parse">
					<u-parse :content="pageForm.content"></u-parse>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue"

	import {
		onLoad
	} from "@dcloudio/uni-app"

	import {
		getannouncemenDetail,
	} from "@/api/home.js"

	let pageForm = ref({
		title: null,
		publishDate: null,
		content: null
	})

	onLoad(options => {
		getannouncemenDetail({
			id: options.id
		}).then(res => {
			pageForm.value.title = res.data.title;
			pageForm.value.publishDate = res.data.publishDate;
			pageForm.value.content = res.data.content;
		})
	})
</script>

<style lang="scss" scoped>
	.card-parse {
		margin-top: 32rpx;
	}
</style>