zypxTongzhigonggaoInfo.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <!-- table -->
  27. <view class="dljt-table-box" v-if="isHasLink(data.info.ziliao)">
  28. <view class="table-th-row">
  29. <view style="width: 15%">序号</view>
  30. <view style="width: 60%">资料名称</view>
  31. <view style="width: 25%">下载</view>
  32. </view>
  33. <view class="table-td-row" v-for="(ccIte,index) in data.info.ziliao">
  34. <view style="width: 15%" class="item-center"><view>{{index+1}}</view></view>
  35. <view style="width: 60%"><view>{{ccIte.name}}</view></view>
  36. <view style="width: 25%">
  37. <a class="table-btn" @click="handleDownFile(ccIte)" >文件下载</a>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 底部导航 -->
  44. <MtaFooter></MtaFooter>
  45. </view>
  46. </template>
  47. <script setup>
  48. import {
  49. ref,
  50. reactive,
  51. computed,
  52. onMounted,
  53. onUnmounted
  54. } from "vue";
  55. import {
  56. onLoad
  57. } from "@dcloudio/uni-app"
  58. import * as httpApi from "@/api/common.js"
  59. import {
  60. formatDateToYearMonthDay
  61. } from "@/utils/common.js"
  62. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  63. import MtaFooter from "@/components/MtaFooter.vue"
  64. import {
  65. getCommonZypxTongzhiInfo
  66. } from "../../api/common";
  67. const data = reactive({
  68. info: null,
  69. id: null
  70. })
  71. const formatDate = computed(() => {
  72. if (data.info && data.info.createTime) {
  73. return formatDateToYearMonthDay(data.info.createTime)
  74. }
  75. return []
  76. })
  77. onLoad(({
  78. id
  79. }) => {
  80. data.id = id;
  81. pageInit();
  82. })
  83. function handleDownFile(ccite) {
  84. window.location.href = ccite.url;
  85. }
  86. function isHasLink(list) {
  87. if (!list) {
  88. return false;
  89. }
  90. if (list.length>1) {
  91. return true
  92. }
  93. if (list.length == 0 ) {
  94. return false
  95. }
  96. if (list.length == 1 && list[0].name && list[0].url) {
  97. return true
  98. }
  99. return false
  100. }
  101. function handleGo(code) {
  102. if (code == 'shouye') {
  103. uni.navigateTo({
  104. url: '/pages/index/index'
  105. })
  106. }
  107. if (code == 'tzgg') {
  108. uni.navigateTo({
  109. url: '/pages/zypxTongzhigonggao/zypxTongzhigonggao'
  110. })
  111. }
  112. }
  113. function pageInit() {
  114. httpApi.getCommonZypxTongzhiInfo({
  115. id: data.id
  116. }).then(res => {
  117. data.info = res.data;
  118. })
  119. }
  120. </script>
  121. <style>
  122. </style>