<template>
	<view class="app-page">
		<view class="app-page">
			<text class="name">{{mData.name}}</text>
			<text class="create_at">发布时间：{{mData.create_at}}</text>
			<u-line color="#E9E9E9" length="calc(100%)" customStyle="margin-top:20rpx;"></u-line>
			<view class="content">
				<u-parse :content="mData.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getNews
	} from "@/common/api/common.js";

	export default {
		data() {
			return {
				code: null,
				mData: {}
			}
		},
		onLoad(options) {
			uni.hideShareMenu({

			})
			if (options.code) {
				this.code = options.code;
				this.getNews()
			}
		},
		methods: {
			getNews() {
				uni.showLoading({

				})
				const data = {
					code: this.code,
				}
				getNews(data)
					.then((res) => {
						uni.hideLoading();
						console.log("getNews==>", res.data)
						if (res.data) {
							this.mData = res.data.list[0]
						}
					})
					.catch(() => {
						uni.hideLoading();
					});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.app-page {
		width: 100%;
		display: flex;
		min-height: 100vh;
		background: white;
		align-items: center;
		flex-direction: column;
	}

	.name {
		font-size: 32rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #1D161F;
		margin-top: 40rpx;
	}

	.create_at {
		font-size: 26rpx;
		margin-left: 25rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #BDBDBD;
		margin-top: 20rpx;
	}
	.content{
		margin: 20rpx;
	}
</style>
