cmsinfo.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="container">
  3. <view class="title" :style="{ height: height + 'px', lineHeight: height + 'px', paddingTop: top + 'px' }">
  4. <uni-icons @click="back" class="back" color="#fff" type="back" size="25"></uni-icons>
  5. <text>{{ info.title }}</text>
  6. </view>
  7. <!-- <text class="time">创建时间:{{ info.createTime }}</text> -->
  8. <rich-text image-menu-prevent="true" :nodes="info.content || info.noticeContent" class="content"></rich-text>
  9. <!-- <view class="content" v-html="info.content || info.noticeContent"> -->
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import request from '../../api/cms.js';
  15. import requestNotice from '../../api/system.js';
  16. export default {
  17. onLoad: function (option) {
  18. this.id = option.id;
  19. },
  20. data() {
  21. return {
  22. id: '',
  23. info: null,
  24. height: 60,
  25. top: 25,
  26. }
  27. },
  28. async mounted() {
  29. const res = await request.getArticleDetail({ id: this.id });
  30. this.info = res.data;
  31. await request.addBlogViews({ id: this.id });
  32. const client = wx.getMenuButtonBoundingClientRect();
  33. this.height = client.height;
  34. this.top = client.top;
  35. },
  36. methods: {
  37. back() {
  38. uni.navigateBack();
  39. }
  40. }
  41. }
  42. </script>
  43. <style>
  44. .title {
  45. display: flex;
  46. color: #fff;
  47. background-color: #fd6b18;
  48. }
  49. .back {
  50. margin: 0 15px 0 5px;
  51. }
  52. .time {
  53. width: 100%;
  54. text-align: center;
  55. display: block;
  56. font-size: 12px;
  57. }
  58. .content {
  59. display: block;
  60. width: 90%;
  61. margin: 10px auto;
  62. }
  63. </style>