12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <view class="container">
- <view class="title" :style="{ height: height + 'px', lineHeight: height + 'px', paddingTop: top + 'px' }">
- <uni-icons @click="back" class="back" color="#fff" type="back" size="25"></uni-icons>
- <text>{{ info.title }}</text>
- </view>
- <!-- <text class="time">创建时间:{{ info.createTime }}</text> -->
- <rich-text image-menu-prevent="true" :nodes="info.content || info.noticeContent" class="content" :style="{ marginTop: height + top + 'px' }"></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;
- },
- data() {
- return {
- id: '',
- info: null,
- height: 60,
- top: 25,
- }
- },
- async mounted() {
- const res = await request.getArticleDetail({ id: this.id });
- this.info = res.data;
- await request.addBlogViews({ id: this.id });
- const client = wx.getMenuButtonBoundingClientRect();
- this.height = client.height;
- this.top = client.top;
- },
- methods: {
- back() {
- uni.navigateBack();
- }
- }
- }
- </script>
- <style>
- .title {
- position: fixed;
- color: #fff;
- background-color: #fd6b18;
- top: 0;
- width: 100%;
- }
- .back {
- margin: 0 15px 0 5px;
- }
- .time {
- width: 100%;
- text-align: center;
- display: block;
- font-size: 12px;
- }
- .content {
- display: block;
- width: 90%;
- margin: 10px auto;
- }
- </style>
|