jyjxDasaifengcaiInfo.vue 2.3 KB

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