details.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="container">
  3. <uni-title type="h1" class="title" align="center" :title="info.title || info.noticeTitle"></uni-title>
  4. <text class="time">创建时间:{{ info.createTime }}</text>
  5. <u-parse :content="info.content" @navigate="navigate" />
  6. </view>
  7. </template>
  8. <script>
  9. import request from '../../api/cms.js';
  10. import uParse from '@/components/gaoyia-parse/parse.vue'
  11. export default {
  12. components: {
  13. uParse
  14. },
  15. onLoad: function (option) {
  16. this.id = option.id;
  17. },
  18. data() {
  19. return {
  20. id: '',
  21. info: null,
  22. }
  23. },
  24. async mounted() {
  25. const res = await request.getArticleDetail({ id: this.id });
  26. this.info = res.data;
  27. },
  28. methods: {
  29. preview(src, e) {
  30. console.log(src, e)
  31. },
  32. navigate(href, e) {
  33. uni.navigateTo({ url: `/pages/questionnaire/web?url=${href}` })
  34. }
  35. }
  36. }
  37. </script>
  38. <style>
  39. .time {
  40. width: 100%;
  41. text-align: center;
  42. display: block;
  43. font-size: 12px;
  44. }
  45. .content {
  46. display: block;
  47. width: 90%;
  48. margin: 10px auto;
  49. }
  50. .title {
  51. width: 90%;
  52. margin: 0 auto;
  53. display: block;
  54. }
  55. .uni-title__base {
  56. line-height: 1.2em !important;
  57. }
  58. </style>