index.vue 4.5 KB

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