<template>
	<view class="pad-x120">
		<!-- 头部 -->
		<status-nav :navBarTitle="pageTitle"></status-nav>
		<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
			<view class="single-page font26">
				<rich-text :nodes="content"></rich-text>
			</view>
		</view>
		<!-- 尾部 -->
		<tabbar :userType="userType" current="2"></tabbar>
	</view>
</template>
<script>
	import tabbar from '@/components/tabbar/tabbar';
	export default {
		components:{
			tabbar
		},
		data() {
			return {
				statusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度
				userType:'worker', //账户类型 工人：worker 负责人：director
				pageTitle:'', //页面标题
				content:'', //内容
			}
		},
		onLoad(op) {
			if(op.type == 'manual'){
				this.pageTitle = '员工手册';
				// 获取内容
				this.getSinglePageEv('/api/v1/index/handbook')
			}
			if(op.type == 'security'){
				this.pageTitle = '安全告知';
				// 获取内容
				this.getSinglePageEv('/api/v1/index/safe-notice')
			}
			if(op.type == 'notice'){
				this.pageTitle = '公告';
				// 获取内容
				this.getSinglePageEv('/api/v1/index/notice')
			}
		},
		methods: {
			// 获取内容
			getSinglePageEv(url){
				this.$requst.get(url).then(res=>{
					if(res.code==0){
						console.log(res,'单页内容');
						this.content = res.data.content;
					}
				})
			}
		}
	}
</script>
<style scoped>
	
</style>