noticeDetails.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!-- 消息详情 -->
  2. <template>
  3. <view class="news-details">
  4. <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
  5. <view class="news-details-header">
  6. <view class="news-details-header-title">{{ info.name }}</view>
  7. <view class="news-details-header-subtitle">
  8. <view v-if="info.createBy">来源:{{ info.createBy }}</view>
  9. <view>{{ info.releasTime }}</view>
  10. </view>
  11. </view>
  12. <view class="news-details-content">
  13. <u-parse :html="info.content"></u-parse>
  14. </view>
  15. <u-toast ref="uToast" />
  16. </view>
  17. </template>
  18. <script>
  19. export default{
  20. data(){
  21. return{
  22. info: ''
  23. }
  24. },
  25. onLoad(page){
  26. if (page.id) {
  27. this.getDetails(page.id)
  28. }
  29. },
  30. onShow(){
  31. },
  32. methods:{
  33. // 获取详情
  34. getDetails(id) {
  35. this.$u.api.noticeApi.getNoticeDetailsApi({ id }).then(res=>{
  36. if (res.code === 200) {
  37. this.info = res.data
  38. } else {
  39. this.$refs.uToast.show({
  40. title: res.msg,
  41. type: 'error'
  42. })
  43. }
  44. })
  45. .catch(err => {
  46. this.$refs.uToast.show({
  47. title: '操作失败!',
  48. type: 'error'
  49. })
  50. })
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .news-details {
  57. padding: 30rpx 44rpx;
  58. font-family: 'PingFangSC-Regular, PingFang SC';
  59. &-header {
  60. border-bottom: solid 1px #DBDBDB;
  61. padding-bottom: 22rpx;
  62. &-title {
  63. color: #000;
  64. font-size: 36rpx;
  65. }
  66. &-subtitle {
  67. margin-top: 20rpx;
  68. display: flex;
  69. justify-content: space-between;
  70. color: #6F6F6F;
  71. font-size: 24rpx;
  72. }
  73. }
  74. &-content {
  75. padding: 18rpx 0;
  76. line-height: 50rpx;
  77. }
  78. }
  79. </style>