<template>
	<view class="cmain">
		<view class="title">{{ item.title }}</view>
		<view class="desc">
			<text class="source">{{ item.source }}</text>
			<text>{{ item.createTime }}</text>
			<view class="read">
				<text class="icon">&#xe639;</text>
				<text>{{ item.readCount }}</text>
			</view>
		</view>
		<u-divider :dot="true"></u-divider>
		<u-parse :content="item.content"></u-parse>
	</view>
</template>

<script>
export default {
	data() {
		return {
			item: {}
		};
	},
	onLoad(e) {
		if (e.id) {
			this.http.request({
				url: '/level-one-server/app/TbPortNews/getById?id=' + e.id,
				success: res => {
					this.item = res.data.data;
					this.item.content = this.item.content.replace(/\<img/gi, '<img style="border-radius: 5px;"');
				}
			});
		}
	}
};
</script>

<style lang="scss">
	.cmain{
		padding: 20px 16px 15px 16px;
		.title {
			font-weight: bold;
			color: #192b20;
			line-height: 32px;
			font-size: 22px;
		}
		.desc {
			margin-top: 10px;
			overflow: hidden;
			color: #a0a2a6;
			text {
				float: left;
			}
			.source {
				color: #0081ff;
				margin-right: 10px;
			}
			margin-right: 10px;
			.read {
				float: right;
				margin-top: -2px;
				.icon{
					padding-right: 3px;
					float: left;
					margin-top: 2px;
				}
			}
		}
	}
</style>
