You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 line
2.2 KiB

  1. <template>
  2. <view id="notice" class="page">
  3. <l-upload-file
  4. v-if="fileList.length"
  5. :value="fileList"
  6. readonly
  7. title="附件"
  8. />
  9. <view class="padding text-lg">
  10. <u-parse v-if="ready&&contentType == 1" :imageProp="{ domain: apiRoot }" :content="content"></u-parse>
  11. <iframe v-if="ready&&contentType == 2" style="width: 100%;height: calc(100vh - 150px - 158px);" :src="CONFIG('webHost')+'/Utility/ListContentView?keyValue='+keyValue" frameborder="0"></iframe>
  12. </view>
  13. <view class="padding-sm text-grey notice-info">
  14. <view class="text-right">信息来源: {{ f_sourcename }}</view>
  15. <view class="text-right">本页内容发布于 {{ time }}</view>
  16. <view class="text-right">{{ date }}</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import moment from 'moment'
  22. export default {
  23. data() {
  24. return {
  25. ready: false,
  26. content: '',
  27. time: '',
  28. classdata:new Array(),
  29. f_sourcename:'',
  30. date: '',
  31. contentType:'',
  32. keyValue:'',
  33. fileList:[],
  34. }
  35. },
  36. async onLoad() {
  37. await this.init()
  38. },
  39. methods: {
  40. async init() {
  41. this.LOADING('加载中…')
  42. const noticeItem = this.GET_PARAM()
  43. this.keyValue = noticeItem.f_id
  44. if(noticeItem.f_category){
  45. this.contentType = 2
  46. }else{
  47. this.contentType = 1
  48. }
  49. this.content = this.CONVERT_HTML(noticeItem.f_content)
  50. this.time = moment(noticeItem.f_time).format('HH : mm')
  51. this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日')
  52. this.FETCH_DATASOURCE('classdata').then(data => {
  53. this.classdata = data.data.map(t => ({
  54. text: t.name,
  55. value: t.id
  56. }));
  57. const obj=this.classdata.find(t=>t.value==noticeItem.f_sourcename);
  58. this.f_sourcename=obj?obj.text:'';
  59. })
  60. this.SET_TITLE(noticeItem.f_title)
  61. this.ready = true
  62. this.HIDE_LOADING()
  63. let _postData = {
  64. newsId: noticeItem.f_id,
  65. }
  66. this.HTTP_POST('learun/news/newsRead',_postData, '加载数据时出错');
  67. // 加载附件信息
  68. this.initUpload(noticeItem.f_newsimage)
  69. },
  70. async initUpload(foldId){
  71. if(!foldId)return
  72. let res = await this.getFileListById(foldId)
  73. this.fileList = res || []
  74. }
  75. }
  76. }
  77. </script>