xydtXueyuanfengcaiInfo.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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('xyfc')">学院风采</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. </view>
  26. </view>
  27. </view>
  28. <!-- 底部导航 -->
  29. <MtaFooter></MtaFooter>
  30. </view>
  31. </template>
  32. <script setup>
  33. import {
  34. ref,
  35. reactive,
  36. computed,
  37. onMounted,
  38. onUnmounted
  39. } from "vue";
  40. import {
  41. onLoad
  42. } from "@dcloudio/uni-app"
  43. import * as httpApi from "@/api/common.js"
  44. import {formatDateToYearMonthDay } from "@/utils/common.js"
  45. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  46. import MtaPDFVue from "@/components/MtaPDF.vue";
  47. import MtaFooter from "@/components/MtaFooter.vue"
  48. const data = reactive({
  49. info: null,
  50. id: null
  51. })
  52. const formatDate = computed(() => {
  53. if (data.info && data.info.createTime) {
  54. return formatDateToYearMonthDay(data.info.createTime)
  55. }
  56. return []
  57. })
  58. onLoad(({
  59. id
  60. }) => {
  61. data.id = id;
  62. pageInit();
  63. })
  64. function handleGo(code) {
  65. if (code == 'shouye') {
  66. uni.navigateTo({
  67. url: '/pages/index/index'
  68. })
  69. }
  70. if (code == 'xyfc') {
  71. uni.navigateTo({
  72. url: '/pages/xydtXueyuanfengcai/xydtXueyuanfengcai'
  73. })
  74. }
  75. }
  76. function handleDownFile() {
  77. window.location.href = pdfUrl;
  78. }
  79. function pageInit() {
  80. httpApi.getDongtaiXueyuanFengcaiInfo({id:data.id}).then(res => {
  81. data.info = res.data;
  82. })
  83. }
  84. </script>
  85. <style>
  86. </style>