notcice_details.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view v-if="formData">
  3. <navInfo :title="current==1?'指令详情':'通知公告详情'"></navInfo>
  4. <view class="bgTopImg">
  5. <image slot="right" :src="`${urls}/navBg@2x.png`" class="bgTopImg"></image>
  6. </view>
  7. <view class="container uni-container">
  8. <uni-title type="h2" v-if="formData.comType" :title="formData.comTitle" align="center"></uni-title>
  9. <uni-title type="h2" v-else :title="formData.title" align="center"></uni-title>
  10. <text class="fabu-time">发布时间:{{times}}</text>
  11. <u-line></u-line>
  12. <view class="main-content">
  13. <!-- <text>{{formData.comContent}}</text> -->
  14. <rich-text v-if="formData.comContent" :nodes="formData.comContent" class="nodes"></rich-text>
  15. <rich-text v-else :nodes="formData.content" class="nodes"></rich-text>
  16. <view style="color: blue;float:right;font-size: 16px;" v-if="formData.attId">
  17. <!-- #ifdef MP-WEIXIN -->
  18. <text style="color:#00a3f4;cursor: pointer;"
  19. @click.native="down(formData.attId)">点击预览附件</text>
  20. <!-- #endif -->
  21. <!-- #ifdef H5 -->
  22. <a style="color:#00a3f4;cursor: pointer;" @click="down(formData.attId)">点击预览文件</a>
  23. <!-- #endif -->
  24. </view>
  25. <!-- <text class="uni-body flex justify-center padding-tb-sm"> 发布时间:{{formData.time}}</text> -->
  26. <!-- <text class="flex flex-direction-row text-indent">
  27. {{item}} </text> -->
  28. <!-- <text class="uni-body flex justify-end padding-tb-sm"> xx省消防救援总队 </text> -->
  29. <!-- <a class="uni-body flex justify-center padding-tb-sm" style='color: #007AFF;'> 附件1:历史遗留消防设施操作员名册.pdf</a> -->
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. let that = null
  36. import {
  37. getNoticeDetail, // 通知公告列详情
  38. } from "@/api/notice";
  39. import config from '@/config'
  40. import {
  41. downSee
  42. } from '@/utils/common.js'
  43. const baseUrlImg = config.baseUrlImg
  44. import navInfo from '@/pagesA/components/my-nav/nav'
  45. export default {
  46. components: {
  47. navInfo
  48. },
  49. data() {
  50. return {
  51. urls: baseUrlImg,
  52. // 数据
  53. formData: [],
  54. // 每页数据量
  55. pageSize: 20,
  56. // 当前页
  57. pageNo: 1,
  58. // 数据总量
  59. total: 0,
  60. // formData数据加载中
  61. loading: false,
  62. true: true,
  63. times: '',
  64. current: ''
  65. }
  66. },
  67. //目的页面接收
  68. //这里用onshow()也可以
  69. onLoad: function(option) {
  70. that = this;
  71. if (option.current) {
  72. this.current = option.current
  73. }
  74. this.$nextTick(() => {
  75. const eventChannel = this.getOpenerEventChannel();
  76. // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  77. eventChannel.on('acceptDataFromOpenerPage', function(val) {
  78. that.formData = val
  79. that.times = val.createTime?uni.$u.timeFormat(parseInt(val.createTime.toString().slice(0,-3))):'';
  80. })
  81. })
  82. },
  83. methods: {
  84. // 下载附件
  85. down(appendix) {
  86. downSee(appendix)
  87. },
  88. // 获取数据
  89. // getData(id) {
  90. // console.log('id', id);
  91. // this.loading = true
  92. // getNoticeDetail({
  93. // id: id
  94. // }).then(response => {
  95. // console.log(response);
  96. // // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  97. // this.formData = response.data
  98. // });
  99. // },
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .album {
  105. @include flex;
  106. align-items: flex-start;
  107. &__avatar {
  108. background-color: $u-bg-color;
  109. padding: 5px;
  110. border-radius: 3px;
  111. }
  112. &__content {
  113. margin-left: 10px;
  114. flex: 1;
  115. }
  116. }
  117. .container {
  118. border-radius: 30px 30px 0px 0px;
  119. background: #fff;
  120. /*#ifdef H5*/
  121. margin-top: 100rpx;
  122. /* #endif */
  123. /* #ifdef MP-WEIXIN*/
  124. margin-top: 100rpx;
  125. /* #endif */
  126. z-index: 999999;
  127. position: relative;
  128. min-height: 400rpx;
  129. ;
  130. }
  131. .text-indent {
  132. text-indent: 2rem;
  133. display: block;
  134. }
  135. .main-content {
  136. margin-top: 30rpx;
  137. }
  138. /deep/.uni-title__base {
  139. color: #274647 !important
  140. }
  141. .fabu-time {
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. margin-bottom: 20rpx;
  146. }
  147. </style>