<template>
	<view>
		<!--文章标题-->
		<view class="title" >{{dataDetail.title}}</view>
		<view class="flex text-gray" style="padding: 0 0 30rpx 30rpx;">
			<view >
				<text class="cuIcon-time padding-right-10"></text>
				<text style="font-size: 28rpx;color: #999999;text-align: left;">{{dataDetail.createTime}}</text>
			</view>
			<view class="margin-left-30">
				<text class="cuIcon-attention  padding-right-10"></text>
				<text style="font-size: 28rpx;color: #999999;text-align: left;">{{dataDetail.reader}}</text>
			</view>
		</view>
		<view class="content-view-box">
			<view class="font-view">
				<rich-text :nodes="dataDetail.content"></rich-text>
			</view>
		</view>
		<u-divider height="80">到底了</u-divider>
	</view>
</template>

<script>
	var app=getApp()
	export default {
		components: {
		},
		data() {
			return {
				id:'',
				dataDetail:{}
			}
		},
		onShow() {
			
		},
		onLoad(options) {
			this.id=options.id || ''
			this.read()
			this.fetchDataDetail()
		},
		methods: {
			fetchDataDetail(){
				this.$api.CMS.detail({id:this.id}).then(res=>{
					this.dataDetail=res.data
				})
			},
			async read(){
				let params={
					id:this.id,
					addCount:1
				}
				await this.$api.CMS.addReaderCount(params)
			}
			
		}
	}
</script>


<style lang="scss">
	page {
		background: #FFFFFF;
	}
	.title {
		font-weight: 800;
		font-size: 40rpx;
		line-height: 54rpx;
		color: #333333;
		margin: 35rpx;
	}
	.content-view-box {
		font-weight: normal;
		vertical-align: baseline;
		.font-view {
			padding: 27.27rpx;
			line-height: 2;
		}
		image {
			width: 100%;
		}
	}
</style>
