index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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">
  10. <view class="more-dots">
  11. <view class="dot"></view>
  12. <view class="dot"></view>
  13. <view class="dot"></view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="nav-placeholder"></view>
  18. <!-- 消息分类列表 -->
  19. <view class="message-list">
  20. <!-- 订单消息 -->
  21. <view class="message-item" @click="navToOrderMsg">
  22. <view class="icon-wrapper">
  23. <image class="msg-icon" src="/static/icons/icon_order_msg.svg"></image>
  24. <view class="red-dot-badge"></view>
  25. </view>
  26. <view class="content-wrapper">
  27. <view class="top-row">
  28. <text class="msg-title">订单消息</text>
  29. <text class="msg-time">5分钟前</text>
  30. </view>
  31. <text class="msg-preview">你收到一个站长手动派单的新订单</text>
  32. </view>
  33. </view>
  34. <!-- 系统消息 -->
  35. <view class="message-item" @click="navToSystemMsg">
  36. <view class="icon-wrapper">
  37. <image class="msg-icon" src="/static/icons/icon_system_msg.svg"></image>
  38. </view>
  39. <view class="content-wrapper">
  40. <view class="top-row">
  41. <text class="msg-title">系统消息</text>
  42. <text class="msg-time">7天前</text>
  43. </view>
  44. <text class="msg-preview">你的健康证明认证审核已通过。</text>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {}
  54. },
  55. methods: {
  56. navBack() {
  57. uni.navigateBack();
  58. },
  59. navToOrderMsg() {
  60. uni.navigateTo({
  61. url: '/pages/mine/message/order'
  62. });
  63. },
  64. navToSystemMsg() {
  65. uni.navigateTo({
  66. url: '/pages/mine/message/system'
  67. });
  68. }
  69. }
  70. }
  71. </script>
  72. <style>
  73. page {
  74. background-color: #fff;
  75. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  76. }
  77. .nav-bar {
  78. position: fixed;
  79. top: 0;
  80. left: 0;
  81. width: 100%;
  82. height: 88rpx;
  83. padding-top: var(--status-bar-height);
  84. background-color: #fff;
  85. display: flex;
  86. align-items: center;
  87. justify-content: space-between;
  88. padding: 0 30rpx;
  89. padding-top: var(--status-bar-height); /* Ensure padding top includes status bar */
  90. box-sizing: border-box;
  91. z-index: 100;
  92. border-bottom: 1rpx solid #f5f5f5;
  93. }
  94. .nav-placeholder {
  95. height: calc(88rpx + var(--status-bar-height));
  96. }
  97. .back-icon {
  98. width: 40rpx;
  99. height: 40rpx;
  100. }
  101. .nav-title {
  102. font-size: 34rpx;
  103. font-weight: bold;
  104. color: #333;
  105. }
  106. .nav-right {
  107. width: 40rpx;
  108. display: flex;
  109. justify-content: flex-end;
  110. }
  111. .more-dots {
  112. display: flex;
  113. gap: 4rpx;
  114. }
  115. .dot {
  116. width: 6rpx;
  117. height: 6rpx;
  118. background-color: #333;
  119. border-radius: 50%;
  120. }
  121. .message-list {
  122. padding: 0 30rpx;
  123. }
  124. .message-item {
  125. display: flex;
  126. align-items: center;
  127. padding: 30rpx 0;
  128. border-bottom: 1rpx solid #f5f5f5;
  129. }
  130. .icon-wrapper {
  131. position: relative;
  132. margin-right: 30rpx;
  133. }
  134. .msg-icon {
  135. width: 96rpx;
  136. height: 96rpx;
  137. border-radius: 50%;
  138. }
  139. .red-dot-badge {
  140. position: absolute;
  141. top: 0;
  142. right: 0;
  143. width: 16rpx;
  144. height: 16rpx;
  145. background-color: #FF3B30;
  146. border-radius: 50%;
  147. border: 2rpx solid #fff;
  148. }
  149. .content-wrapper {
  150. flex: 1;
  151. display: flex;
  152. flex-direction: column;
  153. }
  154. .top-row {
  155. display: flex;
  156. justify-content: space-between;
  157. align-items: center;
  158. margin-bottom: 10rpx;
  159. }
  160. .msg-title {
  161. font-size: 28rpx;
  162. font-weight: bold;
  163. color: #333;
  164. }
  165. .msg-time {
  166. font-size: 24rpx;
  167. color: #999;
  168. }
  169. .msg-preview {
  170. font-size: 26rpx;
  171. color: #666;
  172. overflow: hidden;
  173. white-space: nowrap;
  174. text-overflow: ellipsis;
  175. width: 500rpx;
  176. }
  177. </style>