messageDetail.vue 1.1 KB

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