xydtXueyuanfengcaiInfo.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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('xyfc')">学院风采</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. <!-- 其他 -->
  26. <view class="dljt-video-title" v-if="data.info.otherList && data.info.otherList.length">
  27. <view class="video-text">相关视频</view>
  28. </view>
  29. <view v-if="data.info.otherList && data.info.otherList.length">
  30. <view class="video-item-box" v-for="item in data.info.otherList" :key="item.id"
  31. @click="handleClick(item)">
  32. <!-- 图 -->
  33. <image :src="item.cover"></image>
  34. <!-- 内容 -->
  35. <view class="video-mask-box">
  36. <view class="video-data">[{{formatDateToYearMonthDay(item.createTime).join('-')}}]
  37. </view>
  38. <view class="video-title">{{item.title}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 底部导航 -->
  46. <MtaFooter></MtaFooter>
  47. </view>
  48. </template>
  49. <script setup>
  50. import {
  51. ref,
  52. reactive,
  53. computed,
  54. onMounted,
  55. onUnmounted
  56. } from "vue";
  57. import {
  58. onLoad
  59. } from "@dcloudio/uni-app"
  60. import * as httpApi from "@/api/common.js"
  61. import {
  62. formatDateToYearMonthDay
  63. } from "@/utils/common.js"
  64. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  65. import MtaFooter from "@/components/MtaFooter.vue"
  66. const data = reactive({
  67. info: null,
  68. id: null
  69. })
  70. const formatDate = computed(() => {
  71. if (data.info && data.info.createTime) {
  72. return formatDateToYearMonthDay(data.info.createTime)
  73. }
  74. return []
  75. })
  76. onLoad(({
  77. id
  78. }) => {
  79. data.id = id;
  80. pageInit();
  81. })
  82. function handleClick(item) {
  83. uni.navigateTo({
  84. url: `/pages/xydtXueyuanfengcaiInfo/xydtXueyuanfengcaiInfo?id=${item.id}`
  85. })
  86. }
  87. function handleGo(code) {
  88. if (code == 'shouye') {
  89. uni.navigateTo({
  90. url: '/pages/index/index'
  91. })
  92. }
  93. if (code == 'xyfc') {
  94. uni.navigateTo({
  95. url: '/pages/xydtXueyuanfengcai/xydtXueyuanfengcai'
  96. })
  97. }
  98. }
  99. function pageInit() {
  100. httpApi.getDongtaiXueyuanFengcaiInfo({
  101. id: data.id
  102. }).then(res => {
  103. data.info = res.data;
  104. })
  105. }
  106. </script>
  107. <style>
  108. </style>