detail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view>
  3. <!--#ifdef APP-PLUS-->
  4. <view class="lz-status_bar">
  5. <view class="lz-top_view"></view>
  6. </view>
  7. <!--#endif-->
  8. <!-- #ifndef MP-WEIXIN -->
  9. <view class="kaoshi-head">
  10. <view class="kaoshi-head-top">
  11. <view class="kaoshi-head-left" @tap="$navigateBack">
  12. <view class="iconfont icon-zuojiantou"></view>
  13. </view>
  14. <view class="kaoshi-head-m">{{title}}</view>
  15. <view class="kaoshi-head-right"></view>
  16. </view>
  17. </view>
  18. <!--#endif-->
  19. <view class="index-tiku notice-detail" v-if="info.title != undefined">
  20. <view class="notice-detail-title">{{info.title}}</view>
  21. <view class="notice-detail-time">
  22. <view class="pub-gray">发布时间:{{info.noticetime}}</view>
  23. </view>
  24. <view class="notice-detail-content">
  25. <!-- <uParse :content="info.content + ''" /> -->
  26. <view class="" v-html="info.content">
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. mapState
  35. } from 'vuex';
  36. import uParse from '@/components/uParse/gaoyia-parse/parse.vue';
  37. export default {
  38. data() {
  39. return {
  40. info: {},
  41. id: 0,
  42. title: '',
  43. }
  44. },
  45. components: {
  46. uParse
  47. },
  48. computed: {
  49. ...mapState(['subject', 'userinfo']),
  50. },
  51. onShow() {
  52. this.getJiaocheng()
  53. },
  54. onLoad(opts) {
  55. if (opts && opts.id) {
  56. this.id = opts.id
  57. console.log(opts.type);
  58. if (opts.type == 1) {
  59. this.title = '资讯详情'
  60. uni.setNavigationBarTitle({
  61. title: "资讯详情"
  62. });
  63. } else if (opts.type == 2) {
  64. this.title = '通知详情'
  65. uni.setNavigationBarTitle({
  66. title: "通知详情"
  67. });
  68. }
  69. }
  70. // #ifdef MP-WEIXIN
  71. wx.showShareMenu({
  72. withShareTicket: true,
  73. menus: ["shareAppMessage", "shareTimeline"]
  74. })
  75. // #endif
  76. },
  77. methods: {
  78. async getJiaocheng() {
  79. let res = await this.$myHttp.post({
  80. url: this.$myHttp.urlMap.articleInfo,
  81. data: {
  82. id: this.id,
  83. subject_id: this.subject.id,
  84. },
  85. needLogin: false,
  86. })
  87. if (res.code == 1) {
  88. this.info = res.data
  89. // console.log(typeof(this.info.content))
  90. }
  91. },
  92. }
  93. }
  94. </script>
  95. <style>
  96. page {
  97. background: #fff;
  98. }
  99. /*消息详情*/
  100. .notice-detail {
  101. width: 92%;
  102. margin: 12px auto;
  103. font-size: 16px;
  104. }
  105. .notice-detail-content image {
  106. width: 100% !important;
  107. }
  108. .notice-detail-title {
  109. font-size: 18px;
  110. font-weight: bold;
  111. }
  112. .notice-detail-time {
  113. display: flex;
  114. font-size: 14px;
  115. align-items: center;
  116. margin: 10px 0 9px;
  117. }
  118. .notice-detail-blue {
  119. color: #000;
  120. font-weight: bold;
  121. margin-right: 10px;
  122. font-size: 15px;
  123. }
  124. .notice-detail-content {
  125. line-height: 23px;
  126. }
  127. </style>