dqgzDangjiangongzuoInfo.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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" @click="handleGo('dangqun')">党群工作</view>
  13. <icon class="breadcrumb-jt"></icon>
  14. <view class="breadcrumb-active">党建工作</view>
  15. </view>
  16. <view class="dljt-detail-box">
  17. <!-- 标题 -->
  18. <view class="detail-title">{{data.info.title}}</view>
  19. <!-- 时间 -->
  20. <view class="detail-data">{{formatDate.join('-') }}</view>
  21. <!-- 富文本 -->
  22. <MtaMpHtml class="dljt-editor-box" :content="data.info.content" ></MtaMpHtml>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 底部导航 -->
  27. <MtaFooter></MtaFooter>
  28. </view>
  29. </template>
  30. <script setup>
  31. import {
  32. ref,
  33. reactive,
  34. computed,
  35. onMounted,
  36. onUnmounted
  37. } from "vue";
  38. import {
  39. onLoad
  40. } from "@dcloudio/uni-app"
  41. import * as httpApi from "@/api/common.js"
  42. import {formatDateToYearMonthDay } from "@/utils/common.js"
  43. import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
  44. import MtaFooter from "@/components/MtaFooter.vue"
  45. const data = reactive({
  46. info: null,
  47. id: null
  48. })
  49. const formatDate = computed(() => {
  50. if (data.info && data.info.createTime) {
  51. return formatDateToYearMonthDay(data.info.createTime)
  52. }
  53. return []
  54. })
  55. onLoad(({
  56. id
  57. }) => {
  58. data.id = id;
  59. pageInit();
  60. })
  61. function handleGo(code) {
  62. if (code == 'shouye') {
  63. uni.navigateTo({
  64. url: '/pages/index/index'
  65. })
  66. }
  67. if (code == 'dangqun') {
  68. uni.navigateTo({
  69. url: '/pages/dqgzDangjiangongzuo/dqgzDangjiangongzuo'
  70. })
  71. }
  72. }
  73. function pageInit() {
  74. httpApi.getDangjianGongzuoInfo({
  75. id: data.id
  76. }).then(res => {
  77. data.info = res.data;
  78. console.log('dddd', data.info)
  79. })
  80. }
  81. </script>
  82. <style lang="scss">
  83. </style>