<template>
	<view class="detail_con">
		<view class="title">{{info.title}}</view>
		<view class="infobox">
			<view class="staff" v-if="info.staff">
				<image :src="info.staff.img" class="staffimg" mode=""></image>
				<view class="staffname">{{info.staff.name}}</view>
			</view>
			<view class="time">{{info.createtime}}</view>
		</view>
		<view class="content" v-html="info.content"></view>
	</view>
</template>

<script>
	import { netArticleDetail, netArticleNumber } from '@/api/api.js'
	
	export default{
		data() {
			return{
				id:'',
				info:{},
				comList:[],
				content:''
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getDetail()
			//文章点击次数
			this.getAddNumber()
		},
		methods:{
			getAddNumber() {
				netArticleNumber({id:this.id}).then(res=>{})
			},
			getDetail() {
				netArticleDetail({id:this.id}).then(res=>{
					this.info = res.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.detail_con{
		padding:24rpx;
		.title{
			font-size:34rpx;
			color:#333333;
			margin-bottom:35rpx;
		}
		.infobox{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			margin-bottom:24rpx;
			.staff{
				display: flex;
				justify-content: flex-start;
				align-items: center;
				.staffimg{
					width:50rpx;
					height:50rpx;
					border-radius: 50%;
					margin-right:24rpx;
				}
				.staffname{
					font-size:26rpx;
					color:#999999;
				}
			}
			.time{
				font-size:26rpx;
				color:#999999;
			}
		}
		.content{
			font-size:30rpx;
		}
	}
</style>
