OperatingInstructions.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="container" v-if="isShow">
  3. <view class="contentBox">
  4. <view class="headerBox">
  5. <view class="title">{{NoticeTitle}}</view>
  6. <view class="timecenter">{{NoticeDate}}</view>
  7. </view>
  8. <view class="article">
  9. <bctos-rich-text :nodes="NoticeContent"></bctos-rich-text>
  10. </view>
  11. <view class="bottomBox" style="display:none;">
  12. <view class="author">{{NoticeBMName}}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. var that;
  19. export default {
  20. data() {
  21. return {
  22. isShow: false,
  23. helpID: '',
  24. NoticeTitle: "",
  25. NoticeDate: "",
  26. NoticeContent: '',
  27. NoticeBMName: '',
  28. }
  29. },
  30. onLoad(option) {
  31. that = this;
  32. that.helpID = decodeURIComponent(option.helpID)
  33. that.getData();
  34. },
  35. methods: {
  36. getData() {
  37. that.$admin.reqDirect({
  38. method: 'GET',
  39. url: '/api/v1/Snapshot/bulletions/' + that.helpID
  40. }).then(res => {
  41. if (res) {
  42. that.NoticeTitle = res.title;
  43. that.NoticeDate = res.creationTime ? that.$util.formatTime(new Date(res.creationTime)) : '';
  44. that.NoticeContent = res.content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, reSrc) {
  45. var strImg = '<img src="' + reSrc + '" style="width:100%;" />';
  46. return strImg;
  47. });
  48. that.NoticeBMName = '';
  49. }
  50. that.isShow = true;
  51. }, err => {
  52. that.$util.msg(err);
  53. })
  54. },
  55. onBackTo() {
  56. uni.navigateBack();
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="less">
  62. .contentBox {
  63. height: calc(100% - 30rpx);
  64. padding: 0 20rpx 30rpx;
  65. overflow-y: auto;
  66. }
  67. .headerBox {
  68. border-bottom: 1px #d2d2d2 solid;
  69. padding: 40rpx 0 20rpx;
  70. }
  71. .title {
  72. font-size: 36rpx;
  73. font-weight: bold;
  74. margin-bottom: 20rpx;
  75. text-align: center;
  76. }
  77. .time {
  78. font-size: 30rpx;
  79. color: #666666;
  80. text-align: right;
  81. }
  82. .timecenter {
  83. font-size: 30rpx;
  84. color: #666666;
  85. text-align: center;
  86. }
  87. .article {
  88. font-size: 32rpx;
  89. background-color: #FFFFFF;
  90. color: #777;
  91. padding: 30rpx 0;
  92. line-height: 2.5;
  93. }
  94. .bottomBox {
  95. padding-bottom: 20rpx;
  96. }
  97. .author {
  98. text-align: right;
  99. }
  100. </style>