details.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view v-if="formData">
  3. <navInfo title="重要提醒详情"></navInfo>
  4. <view class="bgTopImg">
  5. <image slot="right" :src="`${urls}/navBg@2x.png`"></image>
  6. </view>
  7. <view class="container uni-container">
  8. <uni-title type="h2" v-if="formData.remindInfoRespVO" :title="formData.remindInfoRespVO.remindTitle"
  9. align="center"></uni-title>
  10. <text class="fabu-time">发布时间:{{formData.pubDate}}</text>
  11. <text class="fabu-time">完成时间:{{formData.doneDate}}</text>
  12. <u-line></u-line>
  13. <view class="main-content">
  14. <!-- <text>{{formData.comContent}}</text> -->
  15. <view class="titles">
  16. 提醒内容描述:
  17. </view>
  18. <rich-text v-if="formData.remindInfoRespVO" :nodes="formData.remindInfoRespVO.remindContent"
  19. class="nodes"></rich-text>
  20. <rich-text v-else :nodes="'暂无内容'" class="nodes"></rich-text>
  21. <view class="titles"style="color: #000;">
  22. 完成情况描述:
  23. </view>
  24. <rich-text v-if="formData.donetext" :nodes="formData.donetext"
  25. class="nodes"></rich-text>
  26. <rich-text v-else :nodes="'暂无内容'" class="nodes"></rich-text>
  27. <view style="color: blue;font-size: 16px;">
  28. <!-- #ifdef MP-WEIXIN -->
  29. <!-- 任务接收的文件 -->
  30. <view class="titles" v-if="formData.sendFileUrls"style="color: #000;">
  31. 提醒内容附件:
  32. </view>
  33. <view v-if="formData.sendFileUrls">
  34. <view class="" v-for="(item,index) in formData.sendFileUrls" :key="index">
  35. <text style="color:#00a3f4;cursor: pointer;"
  36. @click.native="down(item)">点击预览附件{{index+1}}</text>
  37. </view>
  38. </view>
  39. <view class="titles" v-if="formData.doneFileUrls" style="color: #000;">
  40. 完成情况附件:
  41. </view>
  42. <!-- 完成文件 -->
  43. <view v-if="formData.doneFileUrls">
  44. <view class="" v-for="(item,index) in formData.doneFileUrls" :key="index">
  45. <text style="color:#00a3f4;cursor: pointer;"
  46. @click.native="down(item)">点击预览附件{{index+1}}</text>
  47. </view>
  48. </view>
  49. <!-- #endif -->
  50. <!-- #ifdef H5 -->
  51. <!-- 任务接收的文件 -->
  52. <view class="titles" v-if="formData.sendFileUrls" style="color: #000;">
  53. 提醒内容附件:
  54. </view>
  55. <view v-if="formData.sendFileUrls">
  56. <view class="" v-for="(item,index) in formData.sendFileUrls" :key="index">
  57. <a style="color:#00a3f4;cursor: pointer;" @click="down(item)">点击预览文件{{index+1}}</a>
  58. </view>
  59. </view>
  60. <view class="titles" v-if="formData.doneFileUrls" style="color: #000;">
  61. 完成情况附件:
  62. </view>
  63. <!-- 完成文件 -->
  64. <view v-if="formData.doneFileUrls">
  65. <view class="" v-for="(item,index) in formData.doneFileUrls" :key="index">
  66. <a style="color:#00a3f4;cursor: pointer;" @click="down(item)">点击预览文件{{index+1}}</a>
  67. </view>
  68. </view>
  69. <!-- #endif -->
  70. </view>
  71. <!-- <text class="uni-body flex justify-center padding-tb-sm"> 发布时间:{{formData.time}}</text> -->
  72. <!-- <text class="flex flex-direction-row text-indent">
  73. {{item}} </text> -->
  74. <!-- <text class="uni-body flex justify-end padding-tb-sm"> xx省消防救援总队 </text> -->
  75. <!-- <a class="uni-body flex justify-center padding-tb-sm" style='color: #007AFF;'> 附件1:历史遗留消防设施操作员名册.pdf</a> -->
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. let that = null
  82. import {
  83. getRemindBroadDetail
  84. } from "@/api/remind";
  85. import config from '@/config'
  86. import {
  87. downSee
  88. } from '@/utils/common.js'
  89. const baseUrlImg = config.baseUrlImg
  90. import navInfo from '@/pagesA/components/my-nav/nav'
  91. export default {
  92. components: {
  93. navInfo
  94. },
  95. data() {
  96. return {
  97. urls: baseUrlImg,
  98. // 数据
  99. formData: [],
  100. // 每页数据量
  101. pageSize: 20,
  102. // 当前页
  103. pageNo: 1,
  104. // 数据总量
  105. total: 0,
  106. // formData数据加载中
  107. loading: false,
  108. true: true,
  109. times: '',
  110. broadId: null
  111. }
  112. },
  113. //目的页面接收
  114. //这里用onshow()也可以
  115. onLoad: function(option) {
  116. that = this;
  117. this.broadId = option.id
  118. // this.$nextTick(() => {
  119. // const eventChannel = this.getOpenerEventChannel();
  120. // // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  121. // eventChannel.on('acceptDataFromOpenerPage', function(val) {
  122. // that.formData = val
  123. // that.times = val.createTime?uni.$u.timeFormat(parseInt(val.createTime.toString().slice(0,-3))):'';
  124. // })
  125. // })
  126. },
  127. onShow() {
  128. this.getDatas(this.broadId)
  129. },
  130. methods: {
  131. // 下载附件
  132. down(appendix) {
  133. downSee(appendix)
  134. },
  135. // 获取数据
  136. getDatas(id) {
  137. this.loading = true
  138. getRemindBroadDetail(this.broadId).then(response => {
  139. console.log(response);
  140. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  141. this.formData = response.data
  142. });
  143. },
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .album {
  149. @include flex;
  150. align-items: flex-start;
  151. &__avatar {
  152. background-color: $u-bg-color;
  153. padding: 5px;
  154. border-radius: 3px;
  155. }
  156. &__content {
  157. margin-left: 10px;
  158. flex: 1;
  159. }
  160. }
  161. .container {
  162. border-radius: 30px 30px 0px 0px;
  163. background: #fff;
  164. /*#ifdef H5*/
  165. margin-top: 50rpx;
  166. /* #endif */
  167. /* #ifdef MP-WEIXIN*/
  168. margin-top: 50rpx;
  169. /* #endif */
  170. z-index: 99;
  171. position: relative;
  172. min-height: 400rpx;
  173. ;
  174. }
  175. .text-indent {
  176. text-indent: 2rem;
  177. display: block;
  178. }
  179. .main-content {
  180. margin-top: 30rpx;
  181. }
  182. /deep/.uni-title__base {
  183. color: #274647 !important
  184. }
  185. .fabu-time {
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. margin-bottom: 20rpx;
  190. }
  191. //列表样式
  192. .titles {
  193. font-weight: 600;
  194. margin: 20rpx 0;
  195. font-size: 14px;
  196. }
  197. </style>