index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view class="system">
  3. <view class="content">
  4. <view class="title bold">{{title}}</view>
  5. <view class="time">{{sendTime}}</view>
  6. <u-parse :content="msg"></u-parse>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import { getMsgDetail } from '@/apis/news.js'
  12. export default {
  13. data(){
  14. return{
  15. id:'',
  16. title:'',
  17. sendTime:'',
  18. msg:'',
  19. }
  20. },
  21. onLoad(params){
  22. this.id = params.id
  23. this.getDetail()
  24. },
  25. // onShow(){
  26. // },
  27. methods: {
  28. // 获取信息详情
  29. async getDetail () {
  30. const res = await getMsgDetail({msgId:this.id})
  31. if(res){
  32. const { title,sendTime,msg } = res
  33. this.title = title
  34. this.sendTime = sendTime
  35. this.msg = msg
  36. }
  37. }
  38. },
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .system{
  43. background: #fff;
  44. height: 100%;
  45. .content{
  46. .title{
  47. font-size: 32rpx;
  48. }
  49. padding: 32rpx 48rpx;
  50. .time{
  51. margin: 20rpx 0;
  52. font-weight: 500;
  53. font-size: 26rpx;
  54. color: #989897;
  55. }
  56. .text{
  57. font-size: 28rpx;
  58. }
  59. }
  60. }
  61. </style>