messageDetail.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="msg-det">
  3. <view class="title">
  4. {{$t(msgData.title)}}
  5. </view>
  6. <view class="content">
  7. {{msgData.content}}
  8. </view>
  9. <view class="add-time">
  10. {{$t(`通知于`)}}{{msgData.add_time}}
  11. </view>
  12. <!-- #ifndef MP -->
  13. <home></home>
  14. <!-- #endif -->
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. getMsgDetails
  20. } from '@/api/user.js'
  21. import home from '@/components/home';
  22. export default {
  23. components: {
  24. home
  25. },
  26. data() {
  27. return {
  28. msgData: {}
  29. }
  30. },
  31. onLoad(option) {
  32. this.getMsgDetails(option.id)
  33. },
  34. methods: {
  35. getMsgDetails(id) {
  36. uni.showLoading({
  37. title: this.$t(`加载中`)
  38. });
  39. getMsgDetails(id).then(res => {
  40. uni.hideLoading();
  41. this.msgData = res.data
  42. }).catch(err => {
  43. uni.hideLoading();
  44. return this.$util.Tips({
  45. title: err
  46. });
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .msg-det {
  54. background-color: #fff;
  55. padding: 20rpx;
  56. .title {
  57. padding: 20rpx;
  58. font-size: 32rpx;
  59. font-weight: bold;
  60. padding-bottom: 20rpx;
  61. border-bottom: 1px solid #f2f2f2;
  62. }
  63. .add-time {
  64. color: #ababab;
  65. text-align: right;
  66. padding-right: 30rpx;
  67. margin-top: 30rpx;
  68. }
  69. .content {
  70. padding: 20rpx;
  71. color: #333;
  72. }
  73. }
  74. </style>