xydtTongzhigonggaoInfo.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. <!-- table -->
  26. <view class="dljt-table-box" v-if="isHasLink(data.info.ziliao)">
  27. <view class="table-th-row">
  28. <view style="width: 15%">序号</view>
  29. <view style="width: 60%">资料名称</view>
  30. <view style="width: 25%">下载</view>
  31. </view>
  32. <view class="table-td-row" v-for="(ccIte,index) in data.info.ziliao">
  33. <view style="width: 15%" class="item-center"><view>{{index+1}}</view></view>
  34. <view style="width: 60%"><view>{{ccIte.name}}</view></view>
  35. <view style="width: 25%">
  36. <a class="table-btn" @click="handleDownFile(ccIte)" >文件下载</a>
  37. </view>
  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. const data = reactive({
  65. info: null,
  66. id: null
  67. })
  68. const formatDate = computed(() => {
  69. if (data.info && data.info.createTime) {
  70. return formatDateToYearMonthDay(data.info.createTime)
  71. }
  72. return []
  73. })
  74. onLoad(({
  75. id
  76. }) => {
  77. data.id = id;
  78. pageInit();
  79. })
  80. function handleDownFile(ccite) {
  81. window.location.href = ccite.url;
  82. }
  83. function isHasLink(list) {
  84. if (!list) {
  85. return false;
  86. }
  87. if (list.length>1) {
  88. return true
  89. }
  90. if (list.length == 0 ) {
  91. return false
  92. }
  93. if (list.length == 1 && list[0].name && list[0].url) {
  94. return true
  95. }
  96. return false
  97. }
  98. function handleGo(code) {
  99. if (code == 'shouye') {
  100. uni.navigateTo({
  101. url: '/pages/index/index'
  102. })
  103. }
  104. if (code == 'tzgg') {
  105. uni.navigateTo({
  106. url: '/pages/xydtTongzhigonggao/xydtTongzhigonggao'
  107. })
  108. }
  109. }
  110. function pageInit() {
  111. httpApi.getDongtaiTongzhiGonggaoInfo({
  112. id: data.id
  113. }).then(res => {
  114. data.info = res.data;
  115. })
  116. }
  117. </script>
  118. <style>
  119. </style>