notcice_details.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. console.log(' val', val)
  79. that.formData = val
  80. that.times = val.createTime?uni.$u.timeFormat(parseInt(val.createTime.toString().slice(0,-3))):'';
  81. })
  82. })
  83. },
  84. methods: {
  85. // 下载附件
  86. down(appendix) {
  87. downSee(appendix)
  88. },
  89. // 获取数据
  90. // getData(id) {
  91. // console.log('id', id);
  92. // this.loading = true
  93. // getNoticeDetail({
  94. // id: id
  95. // }).then(response => {
  96. // console.log(response);
  97. // // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  98. // this.formData = response.data
  99. // });
  100. // },
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .album {
  106. @include flex;
  107. align-items: flex-start;
  108. &__avatar {
  109. background-color: $u-bg-color;
  110. padding: 5px;
  111. border-radius: 3px;
  112. }
  113. &__content {
  114. margin-left: 10px;
  115. flex: 1;
  116. }
  117. }
  118. .container {
  119. border-radius: 30px 30px 0px 0px;
  120. background: #fff;
  121. /*#ifdef H5*/
  122. margin-top: 100rpx;
  123. /* #endif */
  124. /* #ifdef MP-WEIXIN*/
  125. margin-top: 100rpx;
  126. /* #endif */
  127. z-index: 999999;
  128. position: relative;
  129. min-height: 400rpx;
  130. ;
  131. }
  132. .text-indent {
  133. text-indent: 2rem;
  134. display: block;
  135. }
  136. .main-content {
  137. margin-top: 30rpx;
  138. }
  139. /deep/.uni-title__base {
  140. color: #274647 !important
  141. }
  142. .fabu-time {
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. margin-bottom: 20rpx;
  147. }
  148. </style>