123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
- <home-base :show="false"><view class="div distributor-article-list">
- <view class="div common-header-wrap">
- <view :style="'height:'+navHeight+'px'"></view>
- <view class="common-header-holder"></view>
- <view class="common-header-fixed">
- <title-header />
- <uni-nav-bar :title="title" class="common-header" left-icon="back" @clickLeft="goBack()">
- </uni-nav-bar>
- </view>
- </view>
- <view class='main-content'>
- <rich-text class="div content" :nodes='content'></rich-text>
- </view>
- </view></home-base>
- </template>
- <script>
- import {getFontSize} from '@/util/common'
- import TitleHeader from '../../TitleHeader'
- import HomeBase from '../HomeBase'
- import { getDocumentInfo } from '../../../api/homeArticle'
- export default {
- name:'HomeDocument',
- mounted(){
- // #ifdef MP-WEIXIN
- this.navHeight = uni.getMenuButtonBoundingClientRect().top
- // #endif
- },
- computed:{
- fontSize(){
- return getFontSize()
- },
- },
- data(){
- return {
- navHeight: 0,
- title: '',
- content: ''
- }
- },
- components:{
- TitleHeader,
- HomeBase,
- },
- onLoad: function (option) {
- let type = option.type
- getDocumentInfo(type).then(res => {
- this.title = res.result.document_title
- this.content = res.result.document_content
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- },
- methods:{
- goBack(){
- uni.navigateBack({delta:1})
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .main-content{padding: 0 $pageSpace;box-sizing: border-box;}
- .content{padding:.5rem;font-size:$subFontSize;}
- </style>
|