1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <view class="container">
- <uni-title type="h1" align="center" :title="info.title || info.noticeTitle"></uni-title>
- <text class="time">创建时间:{{ info.createTime }}</text>
- <rich-text image-menu-prevent="true" :nodes="info.content || info.noticeContent" class="content"></rich-text>
- <!-- <view class="content" v-html="info.content || info.noticeContent"> -->
- </view>
- </view>
- </template>
- <script>
- import request from '../../api/cms.js';
- import requestNotice from '../../api/system.js';
- export default {
- onLoad: function (option) {
- this.id = option.id;
- this.noticeId = option.noticeId;
- },
- data() {
- return {
- id: '',
- info: null,
- noticeId: ''
- }
- },
- async mounted() {
- let res = {};
- if (this.id && this.id !== '') {
- res = await request.getArticleDetail({ id: this.id });
- }
- if (this.noticeId && this.noticeId !== '') {
- res = await requestNotice.getSystemNoticeDetails({ id: this.noticeId });
- }
- this.info = res.data;
- if (this.id && this.id !== '') await request.addBlogViews({ id: this.id });
- },
- methods: {}
- }
- </script>
- <style>
- .time {
- width: 100%;
- text-align: center;
- display: block;
- font-size: 12px;
- }
- .content {
- display: block;
- width: 90%;
- margin: 10px auto;
- }
- </style>
|