xydtTongzhigonggaoInfo.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="dljt-page-box" v-if="data.info">
  3. <MtaNavbar></MtaNavbar>
  4. <view class="dljt-container-box">
  5. <!-- 详情页面 -->
  6. <view class="dljt-page-title">校园动态</view>
  7. <view class="dljt-page-content-box">
  8. <!-- 导航 -->
  9. <view class="dljt-breadcrumb-box">
  10. <view class="breadcrumb-text" @click="handleGo('shouye')">首页</view>
  11. <icon class="breadcrumb-jt"></icon>
  12. <view class="breadcrumb-text">校园动态</view>
  13. <icon class="breadcrumb-jt"></icon>
  14. <view class="breadcrumb-text" @click="handleGo('tzgg')">通知公告</view>
  15. <icon class="breadcrumb-jt"></icon>
  16. <view class="breadcrumb-active">详情</view>
  17. </view>
  18. <view class="dljt-detail-box">
  19. <!-- 标题 -->
  20. <view class="detail-title">{{data.info.title}}</view>
  21. <!-- 时间 -->
  22. <view class="detail-data">{{formatDate.join('-') }}</view>
  23. <!-- 富文本 -->
  24. <MtaMpHtml class="dljt-editor-box" :content="data.info.content"></MtaMpHtml>
  25. <!-- PDF -->
  26. <!-- <MtaPDFVue class="dljt-pdf-box" :pdfUrl="pdfUrl"></MtaPDFVue> -->
  27. <!-- 文件下载 -->
  28. <!-- <div class="return-footer-box" v-if="">
  29. <view class="dljt-down-btn" @click="handleDownFile"></view>
  30. </div> -->
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 底部导航 -->
  35. <MtaFooter></MtaFooter>
  36. </view>
  37. </template>
  38. <script setup>
  39. import {
  40. ref,
  41. reactive,
  42. computed,
  43. onMounted,
  44. onUnmounted
  45. } from "vue";
  46. import {
  47. onLoad
  48. } from "@dcloudio/uni-app"
  49. import * as httpApi from "@/api/common.js"
  50. import {
  51. formatDateToYearMonthDay
  52. } from "@/utils/common.js"
  53. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  54. import MtaPDFVue from "@/components/MtaPDF.vue";
  55. import MtaFooter from "@/components/MtaFooter.vue"
  56. const data = reactive({
  57. info: null,
  58. id: null
  59. })
  60. const formatDate = computed(() => {
  61. if (data.info && data.info.createTime) {
  62. return formatDateToYearMonthDay(data.info.createTime)
  63. }
  64. return []
  65. })
  66. onLoad(({
  67. id
  68. }) => {
  69. data.id = id;
  70. pageInit();
  71. })
  72. function handleGo(code) {
  73. if (code == 'shouye') {
  74. uni.navigateTo({
  75. url: '/pages/index/index'
  76. })
  77. }
  78. if (code == 'tzgg') {
  79. uni.navigateTo({
  80. url: '/pages/xydtTongzhigonggao/xydtTongzhigonggao'
  81. })
  82. }
  83. }
  84. function pageInit() {
  85. httpApi.getDongtaiTongzhiGonggaoInfo({
  86. id: data.id
  87. }).then(res => {
  88. data.info = res.data;
  89. })
  90. }
  91. </script>
  92. <style>
  93. </style>