xydtXueyuanxinwenInfo.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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('xyxw')">学院新闻</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 {formatDateToYearMonthDay } from "@/utils/common.js"
  60. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  61. import MtaFooter from "@/components/MtaFooter.vue"
  62. const data = reactive({
  63. info: null,
  64. id: null
  65. })
  66. const formatDate = computed(() => {
  67. if (data.info && data.info.createTime) {
  68. return formatDateToYearMonthDay(data.info.createTime)
  69. }
  70. return []
  71. })
  72. onLoad(({
  73. id
  74. }) => {
  75. data.id = id;
  76. pageInit();
  77. })
  78. function handleDownFile(ccite) {
  79. window.location.href = ccite.url;
  80. }
  81. function isHasLink(list) {
  82. if (!list) {
  83. return false;
  84. }
  85. if (list.length>1) {
  86. return true
  87. }
  88. if (list.length == 0 ) {
  89. return false
  90. }
  91. if (list.length == 1 && list[0].name && list[0].url) {
  92. return true
  93. }
  94. return false
  95. }
  96. function handleGo(code) {
  97. if (code == 'shouye') {
  98. uni.navigateTo({
  99. url: '/pages/index/index'
  100. })
  101. }
  102. if (code == 'xyxw') {
  103. uni.navigateTo({
  104. url: '/pages/xydtXueyuanxingwen/xydtXueyuanxingwen'
  105. })
  106. }
  107. }
  108. function pageInit() {
  109. httpApi.getDongtaiYuanxiaoXinwenInfo({
  110. id: data.id
  111. }).then(res => {
  112. data.info = res.data;
  113. })
  114. }
  115. </script>
  116. <style>
  117. </style>