選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

notice.vue 1.8 KiB

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