messageDetail.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. onShow() {
  28. uni.removeStorageSync('form_type_cart');
  29. },
  30. methods: {
  31. getMsgDetails(id) {
  32. uni.showLoading({
  33. title: '获取详情中'
  34. });
  35. getMsgDetails(id).then(res => {
  36. uni.hideLoading();
  37. this.msgData = res.data
  38. console.log(res)
  39. }).catch(err => {
  40. uni.hideLoading();
  41. return this.$util.Tips({
  42. title: err
  43. });
  44. })
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. .msg-det {
  51. background-color: #fff;
  52. padding: 20rpx;
  53. .title {
  54. padding: 20rpx;
  55. font-size: 32rpx;
  56. font-weight: bold;
  57. padding-bottom: 20rpx;
  58. border-bottom: 1px solid #f2f2f2;
  59. }
  60. .add-time {
  61. color: #ababab;
  62. text-align: right;
  63. padding-right: 30rpx;
  64. margin-top: 30rpx;
  65. }
  66. .content {
  67. padding: 20rpx;
  68. color: #333;
  69. }
  70. }
  71. </style>