building-sign/pagesA/singlePage/singlePage.vue

69 lines
1.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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')
}
},
onShareAppMessage(res) {
let shareObj = {
title:'工地打卡',
path: '/pages/pagehome/pagehome',
imageUrl:'/static/share-logo.jpg',
}
// 返回shareObj
return shareObj;
},
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>