index.vue 1.5 KB

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