<template>
	<view class="page">
		<view class="myContainer acceptTitle">标题</view>
		<view class="myContainer myContentBox">
			<view class="resultContent">{{info.title||'-'}}</view>
		</view>
		<!-- <view class="myContainer acceptTitle">创建人</view>
		<view class="myContainer myContentBox">
			<view class="resultContent">{{info.uncomContent||'-'}}</view>
		</view> -->
		<view class="myContainer acceptTitle">创建时间</view>
		<view class="myContainer myContentBox">
			<view class="resultContent">{{info.createTime||'-'}}</view>
		</view>
		<view class="myContainer acceptTitle">内容</view>
		<view class="myContainer myContentBox">
			<view class="resultContent" v-html='info.text'></view>
		</view>
		<view class="goHome" @click='goMain()'>
			<img src="../../static/img/gohome.png">
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				info:{},
				initFileList:[],
				id:''
			}
		},
		onLoad(option) {
			this.id=option.id;
			if(this.id==undefined){
				uni.reLaunch({
				    url: 'news'
				});
				return false;
			}
		    var _this = this;
		    this.$http.request({
				 url: '/apis/news/detail',
				 method:'GET',
				 params: {
				   id:_this.id
				 },
		   }).then(res=>{
			if(res.data.code == 0){
				this.info = res.data.newsHead;
			}else{
				uni.showToast({
					title: '获取信息失败',
					duration: 	1000,
					icon:"none"
				});
			}
		   }).catch(err=>{
			   console.log(err)
		   });
			
		}
	}
</script>
<style scoped>
</style>