building-sign/pagesA/singlePage/singlePage.vue

60 lines
1.4 KiB
Vue
Raw Normal View History

2022-11-16 10:20:26 +00:00
<template>
<view class="pad-x120">
<!-- 头部 -->
<status-nav :navBarTitle="pageTitle"></status-nav>
<view class="content" :style="{'padding-top':statusHeight+50+'px'}">
2022-11-17 11:40:25 +00:00
<view class="single-page font26">
<rich-text :nodes="content"></rich-text>
</view>
2022-11-16 10:20:26 +00:00
</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:'', //页面标题
2022-11-17 11:40:25 +00:00
content:'', //内容
2022-11-16 10:20:26 +00:00
}
},
onLoad(op) {
if(op.type == 'manual'){
2022-11-17 11:40:25 +00:00
this.pageTitle = '员工手册';
// 获取内容
this.getSinglePageEv('/api/v1/index/handbook')
2022-11-16 10:20:26 +00:00
}
if(op.type == 'security'){
2022-11-23 08:46:52 +00:00
this.pageTitle = '安全告知';
2022-11-17 11:40:25 +00:00
// 获取内容
this.getSinglePageEv('/api/v1/index/safe-notice')
2022-11-16 10:20:26 +00:00
}
if(op.type == 'notice'){
2022-11-17 11:40:25 +00:00
this.pageTitle = '公告';
// 获取内容
this.getSinglePageEv('/api/v1/index/notice')
}
2022-11-16 10:20:26 +00:00
},
methods: {
2022-11-17 11:40:25 +00:00
// 获取内容
getSinglePageEv(url){
this.$requst.get(url).then(res=>{
if(res.code==0){
console.log(res,'单页内容');
this.content = res.data.content;
}
})
}
2022-11-16 10:20:26 +00:00
}
}
</script>
<style scoped>
</style>