<style lang="scss" scoped>
	.pdbox{ padding:30rpx 20rpx; line-height:40rpx; rich-text{ margin-bottom:15rpx; line-height:1.8em; color:#666;}}
	.nytit{ border-bottom:1px dotted #ddd; padding:20rpx 0; margin:0 20rpx; .tit{ font-size:40rpx; font-weight:bold;} .time{ margin-top:12rpx; text{color:#999; margin-right:15rpx;} } }
</style>
<template>
	<view v-if="show">
		 <view class="nytit">
				 <view class="tit">{{info.title}}</view>
					<view class="time"><text>浏览：{{info.views}}</text><text>时间：{{info.datetime}}</text></view>
			</view>
			<view class="pdbox">
					<rich-text :nodes="info.content"></rich-text>
			</view>		
	</view>
</template>

<script>
	export default {
		data() {
			return {		
				 show:false,
				 id:'',
					info:{},
			}
		},
		onLoad(e) {
			  this.id = e.id;
					this.getOne();
		},
		methods: {	
				async getOne(){
					  const json = await this.api.getOne({q:{id:this.id,field:'content,title,datetime,views'}})
							if(json.data.code==0){						  
									this.info = json.data.data;
									this.show = true;
							}
				},
		}
	}
</script>
