index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="container">
  3. <!-- 导航栏 -->
  4. <view class="nav-bar">
  5. <view class="nav-left" @click="navBack">
  6. <image class="back-icon" src="/static/icons/chevron_right_dark.svg" style="transform: rotate(180deg);"></image>
  7. </view>
  8. <text class="nav-title">消息详情</text>
  9. <view class="nav-right"></view>
  10. </view>
  11. <view class="nav-placeholder"></view>
  12. <view class="detail-content">
  13. <text class="detail-title">{{ notice.title }}</text>
  14. <text class="detail-time">{{ formatTime(notice.time) }}</text>
  15. <view class="detail-body">
  16. <text>{{ notice.content }}</text>
  17. </view>
  18. <view class="detail-footer">
  19. <view class="divider"></view>
  20. <text class="footer-text">如有疑问,请咨询在线客服。</text>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import { formatTime } from '@/utils/index'
  27. export default {
  28. data() {
  29. return {
  30. notice: {
  31. title: '消息详情',
  32. content: '',
  33. time: ''
  34. }
  35. }
  36. },
  37. onLoad(options) {
  38. if (options.title) this.notice.title = options.title;
  39. if (options.content) this.notice.content = options.content;
  40. if (options.time) this.notice.time = options.time;
  41. },
  42. methods: {
  43. formatTime,
  44. navBack() {
  45. uni.navigateBack();
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. page {
  52. background-color: #fff;
  53. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  54. }
  55. .nav-bar {
  56. position: fixed;
  57. top: 0;
  58. left: 0;
  59. width: 100%;
  60. height: 88rpx;
  61. padding-top: var(--status-bar-height);
  62. background-color: #fff;
  63. display: flex;
  64. align-items: center;
  65. justify-content: space-between;
  66. padding: 0 30rpx;
  67. box-sizing: border-box;
  68. z-index: 100;
  69. border-bottom: 1rpx solid #f5f5f5;
  70. }
  71. .nav-placeholder {
  72. height: calc(88rpx + var(--status-bar-height));
  73. }
  74. .back-icon {
  75. width: 40rpx;
  76. height: 40rpx;
  77. }
  78. .nav-title {
  79. font-size: 34rpx;
  80. font-weight: bold;
  81. color: #333;
  82. }
  83. .nav-right { width: 40rpx; }
  84. .detail-content {
  85. padding: 40rpx 30rpx;
  86. }
  87. .detail-title {
  88. font-size: 40rpx;
  89. font-weight: bold;
  90. color: #333;
  91. display: block;
  92. margin-bottom: 20rpx;
  93. }
  94. .detail-time {
  95. font-size: 24rpx;
  96. color: #999;
  97. display: block;
  98. margin-bottom: 40rpx;
  99. }
  100. .detail-body {
  101. font-size: 30rpx;
  102. color: #333;
  103. line-height: 1.8;
  104. }
  105. .detail-footer {
  106. margin-top: 60rpx;
  107. text-align: center;
  108. }
  109. .divider {
  110. height: 1rpx;
  111. background-color: #eee;
  112. margin-bottom: 30rpx;
  113. }
  114. .footer-text {
  115. font-size: 26rpx;
  116. color: #ccc;
  117. }
  118. </style>