jyjxZhuanyejiansheInfo.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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('zyjs')">专业建设</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. <!-- 附件 -->
  26. <view class="return-footer-box" v-if="data.info.pdfUrl">
  27. <view class="dljt-down-btn" @click="handleDownFile"></view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 底部导航 -->
  33. <MtaFooter></MtaFooter>
  34. </view>
  35. </template>
  36. <script setup>
  37. import {
  38. ref,
  39. reactive,
  40. computed,
  41. onMounted,
  42. onUnmounted
  43. } from "vue";
  44. import {
  45. onLoad
  46. } from "@dcloudio/uni-app"
  47. import * as httpApi from "@/api/common.js"
  48. import {formatDateToYearMonthDay } from "@/utils/common.js"
  49. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  50. import MtaFooter from "@/components/MtaFooter.vue"
  51. const data = reactive({
  52. info: null,
  53. id: null
  54. })
  55. const formatDate = computed(() => {
  56. if (data.info && data.info.createTime) {
  57. return formatDateToYearMonthDay(data.info.createTime)
  58. }
  59. return []
  60. })
  61. onLoad(({
  62. id,type
  63. }) => {
  64. data.id = id;
  65. data.type = type;
  66. pageInit();
  67. })
  68. function handleGo(code) {
  69. if (code == 'shouye') {
  70. uni.navigateTo({
  71. url: '/pages/index/index'
  72. })
  73. }
  74. if (code == 'zyjs') {
  75. uni.navigateTo({
  76. url: `/pages/jyjxZhuanyejianshe/jyjxZhuanyejianshe?type=${data.type}`
  77. })
  78. }
  79. }
  80. function handleDownFile() {
  81. window.location.href = data.info.pdfUrl;
  82. }
  83. function pageInit() {
  84. httpApi.getJiaoyuZhuanyejiansheInfo({
  85. id: data.id
  86. }).then(res => {
  87. data.info = res.data;
  88. })
  89. }
  90. </script>
  91. <style>
  92. </style>