zypxTongzhigonggaoInfo.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. </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 {
  45. formatDateToYearMonthDay
  46. } from "@/utils/common.js"
  47. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  48. import MtaFooter from "@/components/MtaFooter.vue"
  49. import {
  50. getCommonZypxTongzhiInfo
  51. } from "../../api/common";
  52. const data = reactive({
  53. info: null,
  54. id: null
  55. })
  56. const formatDate = computed(() => {
  57. if (data.info && data.info.createTime) {
  58. return formatDateToYearMonthDay(data.info.createTime)
  59. }
  60. return []
  61. })
  62. onLoad(({
  63. id
  64. }) => {
  65. data.id = id;
  66. pageInit();
  67. })
  68. function handleGo(code) {
  69. if (code == 'shouye') {
  70. uni.navigateTo({
  71. url: '/pages/index/index'
  72. })
  73. }
  74. if (code == 'tzgg') {
  75. uni.navigateTo({
  76. url: '/pages/zypxTongzhigonggao/zypxTongzhigonggao'
  77. })
  78. }
  79. }
  80. function pageInit() {
  81. httpApi.getCommonZypxTongzhiInfo({
  82. id: data.id
  83. }).then(res => {
  84. data.info = res.data;
  85. })
  86. }
  87. </script>
  88. <style>
  89. </style>