<template>
	<view class="box">
		<u-navbar is-back :border-bottom="false" :title="title"></u-navbar>
		<view class="content_msg">
			<text class="text1">{{msg.title}}</text>
			<text class="text2">{{msg.created_at}}</text>
			<view class="content">
				<u-parse :html="msg.content || '' "></u-parse>
			</view>
		</view>
		<view class="mim-view-list"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '',
				msg: {},
				form: {
					id: '',
				}
			};
		},
		onLoad(options) {
			this.form.id = options.id
			switch (options.type) {
				case '2': //罗山新闻
					this.title = "罗山新闻详情"
					break;
				case '3': //罗山县情
					this.title = "罗山县情详情"

					break;
				case '4': //发展动态
					this.title = "发展动态详情"

					break;
				case '5': //营商环境
					this.title = "营商环境详情"

					break;
				case '6': //全域旅游
					this.title = "全域旅游详情"

					break;
				default: //公告版
					this.title = "公告详情"
					break;
			}
			this.infoDetailsFn()
		},
		methods: {
			async infoDetailsFn() {
				const res = await this.$u.api.infoDetails(this.form)
				if (res.status === "success") {
					this.msg = res.data
				}
			},
		}
	}
</script>

<style lang="scss">
	.box {
		background: #F7F7F7;
		min-height: 100vh;

		.content_msg {
			/* 去掉内部滚动条 */
			scrollbar-width: none;
			-ms-overflow-style: none;

			/* 兼容webkit内核浏览器 */
			::-webkit-scrollbar {
				display: none;
			}

			padding: 32rpx;
			box-sizing: border-box;
			margin: 24rpx;
			// width: 91.5%;
			background: white;
			display: flex;
			flex-direction: column;
			border-radius: 12rpx;

			/deep/ .content {
				text-align: justify !important;
				text-justify: distribute-all-lines !important;
				// text-align-last: justify !important;

			}

			.text1 {
				font-size: 32upx;
				font-family: PingFang SC-粗体, PingFang SC;
				font-weight: normal;
				color: #3D3D3D;
				text-align: justify;
				text-justify: distribute-all-lines;
			}

			.text2 {
				padding-top: 16upx;
				padding-bottom: 24upx;
				font-size: 28upx;
				font-family: Arial-Regular, Arial;
				font-weight: 400;
				color: #999999;
			}

			.text3 {
				font-size: 28upx;
				font-family: PingFang SC-中等, PingFang SC;
				font-weight: normal;
				color: #3D3D3D;
				padding-top: 24upx;
			}
		}
	}
</style>