message.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <view class="matchmaker-message">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-btn" @click="goBack"></view>
  6. <text class="header-title">消息</text>
  7. <view class="placeholder"></view>
  8. </view>
  9. <scroll-view scroll-y class="content">
  10. <!-- 系统通知 -->
  11. <view class="message-item system-notification active">
  12. <text class="message-type">系统通知</text>
  13. <text class="message-time">刚刚</text>
  14. <text class="message-content">您的线索审核已通过,获得20积分奖励,当前积分可兑换【资源查看权限】x1</text>
  15. <text class="message-footer">完成线索采集,积分+20 (距黄金级还差72分)</text>
  16. </view>
  17. <!-- 撮合成功通知 -->
  18. <view class="message-item match-success">
  19. <view class="message-icon heart"></view>
  20. <view class="message-body">
  21. <text class="message-type">撮合成功通知</text>
  22. <text class="message-content">您推荐的王先生和刘女士已成功匹配,获得50积分+100元现金奖励</text>
  23. </view>
  24. <text class="message-time">10分钟前</text>
  25. </view>
  26. <!-- 今天分组 -->
  27. <view class="time-group">
  28. <text class="time-label">今天</text>
  29. </view>
  30. <!-- 魏先生消息 -->
  31. <view class="message-item user-message">
  32. <view class="message-avatar">魏</view>
  33. <view class="message-body">
  34. <text class="message-type">魏先生</text>
  35. <text class="message-content">您好,想了解一下李女士的详细情况,方便沟通吗?</text>
  36. </view>
  37. <text class="message-time">1小时前</text>
  38. </view>
  39. <!-- 昨日分组 -->
  40. <view class="time-group">
  41. <text class="time-label">昨日</text>
  42. </view>
  43. <!-- 张先生消息 -->
  44. <view class="message-item user-message">
  45. <view class="message-avatar">张</view>
  46. <view class="message-body">
  47. <text class="message-type">张先生</text>
  48. <text class="message-content">您好,想了解一下王女士的详细情况,方便沟通吗?</text>
  49. </view>
  50. <text class="message-time">1小时前</text>
  51. </view>
  52. <!-- 更早分组 -->
  53. <view class="time-group">
  54. <text class="time-label">更早</text>
  55. </view>
  56. <!-- 高先生消息 -->
  57. <view class="message-item user-message">
  58. <view class="message-avatar">高</view>
  59. <view class="message-body">
  60. <text class="message-type">高先生</text>
  61. <text class="message-content">您好,想了解一下陈女士的详细情况,方便沟通吗?</text>
  62. </view>
  63. <text class="message-time">1小时前</text>
  64. </view>
  65. </scroll-view>
  66. <!-- 底部导航 -->
  67. <view class="tabbar">
  68. <view class="tabbar-item" @click="navigateToWorkbench">
  69. <text class="tab-icon">🏠</text>
  70. <text class="tab-text">工作台</text>
  71. </view>
  72. <view class="tabbar-item" @click="navigateToMyResources">
  73. <text class="tab-icon">📋</text>
  74. <text class="tab-text">我的资源</text>
  75. </view>
  76. <view class="tabbar-item" @click="navigateToRanking">
  77. <text class="tab-icon">🏆</text>
  78. <text class="tab-text">排行榜</text>
  79. </view>
  80. <view class="tabbar-item active" @click="navigateToMessage">
  81. <view class="tab-icon-wrapper">
  82. <text class="tab-icon">💬</text>
  83. <view class="badge">3</view>
  84. </view>
  85. <text class="tab-text">消息</text>
  86. </view>
  87. <view class="tabbar-item" @click="navigateToMine">
  88. <text class="tab-icon">👤</text>
  89. <text class="tab-text">我的</text>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. messages: [
  99. {
  100. id: 1,
  101. type: 'system',
  102. title: '系统通知',
  103. content: '您的线索审核已通过,获得20积分奖励,当前积分可兑换【资源查看权限】x1',
  104. footer: '完成线索采集,积分+20 (距黄金级还差72分)',
  105. time: '刚刚',
  106. isNew: true
  107. },
  108. {
  109. id: 2,
  110. type: 'matchSuccess',
  111. title: '撮合成功通知',
  112. content: '您推荐的王先生和刘女士已成功匹配,获得50积分+100元现金奖励',
  113. time: '10分钟前',
  114. isNew: false
  115. },
  116. {
  117. id: 3,
  118. type: 'user',
  119. title: '魏先生',
  120. content: '您好,想了解一下李女士的详细情况,方便沟通吗?',
  121. time: '1小时前',
  122. isNew: false
  123. },
  124. {
  125. id: 4,
  126. type: 'user',
  127. title: '张先生',
  128. content: '您好,想了解一下王女士的详细情况,方便沟通吗?',
  129. time: '1小时前',
  130. isNew: false
  131. },
  132. {
  133. id: 5,
  134. type: 'user',
  135. title: '高先生',
  136. content: '您好,想了解一下陈女士的详细情况,方便沟通吗?',
  137. time: '1小时前',
  138. isNew: false
  139. }
  140. ]
  141. }
  142. },
  143. methods: {
  144. // 返回上一页
  145. goBack() {
  146. uni.navigateBack()
  147. },
  148. // 导航到工作台
  149. navigateToWorkbench() {
  150. uni.redirectTo({
  151. url: '/pages/matchmaker-workbench/index'
  152. })
  153. },
  154. // 导航到我的资源
  155. navigateToMyResources() {
  156. uni.redirectTo({
  157. url: '/pages/matchmaker-workbench/my-resources'
  158. })
  159. },
  160. // 导航到排行榜
  161. navigateToRanking() {
  162. uni.redirectTo({
  163. url: '/pages/matchmaker-workbench/ranking'
  164. })
  165. },
  166. // 导航到消息
  167. navigateToMessage() {
  168. // 已在消息页面,无需跳转
  169. },
  170. // 导航到我的
  171. navigateToMine() {
  172. uni.redirectTo({
  173. url: '/pages/matchmaker-workbench/mine'
  174. })
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. .matchmaker-message {
  181. min-height: 100vh;
  182. background: #FFF9F9;
  183. display: flex;
  184. flex-direction: column;
  185. }
  186. /* 顶部导航栏 */
  187. .header {
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. padding: 25rpx 30rpx;
  192. padding-top: calc(25rpx + env(safe-area-inset-top));
  193. background: #FFF9F9;
  194. border-bottom: 1rpx solid #F0F0F0;
  195. .back-btn {
  196. width: 70rpx;
  197. height: 70rpx;
  198. display: flex;
  199. align-items: center;
  200. justify-content: center;
  201. background: rgba(240, 240, 240, 0.5);
  202. border-radius: 50%;
  203. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  204. background-size: 40rpx 40rpx;
  205. background-repeat: no-repeat;
  206. background-position: center;
  207. }
  208. .header-title {
  209. font-size: 38rpx;
  210. font-weight: bold;
  211. color: #333;
  212. }
  213. .placeholder {
  214. width: 70rpx;
  215. }
  216. }
  217. .content {
  218. flex: 1;
  219. padding: 20rpx 20rpx 120rpx;
  220. }
  221. /* 消息项 */
  222. .message-item {
  223. background: #FFFFFF;
  224. border-radius: 20rpx;
  225. padding: 25rpx;
  226. margin-bottom: 20rpx;
  227. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  228. position: relative;
  229. &.system-notification {
  230. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  231. border: 2rpx solid #F8BBD0;
  232. &.active {
  233. border-color: #E91E63;
  234. }
  235. .message-type {
  236. display: block;
  237. font-size: 32rpx;
  238. font-weight: bold;
  239. color: #333;
  240. margin-bottom: 15rpx;
  241. }
  242. .message-time {
  243. display: block;
  244. font-size: 24rpx;
  245. color: #999;
  246. margin-bottom: 15rpx;
  247. text-align: right;
  248. }
  249. .message-content {
  250. display: block;
  251. font-size: 28rpx;
  252. color: #333;
  253. line-height: 1.5;
  254. margin-bottom: 15rpx;
  255. }
  256. .message-footer {
  257. display: block;
  258. font-size: 24rpx;
  259. color: #666;
  260. line-height: 1.4;
  261. }
  262. }
  263. &.match-success {
  264. display: flex;
  265. background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  266. border: 2rpx solid #D1C4E9;
  267. .message-icon {
  268. width: 60rpx;
  269. height: 60rpx;
  270. border-radius: 50%;
  271. margin-right: 20rpx;
  272. background-size: 40rpx 40rpx;
  273. background-repeat: no-repeat;
  274. background-position: center;
  275. }
  276. .message-icon.heart {
  277. background-color: #F8BBD0;
  278. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23E91E63"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>');
  279. }
  280. .message-body {
  281. flex: 1;
  282. }
  283. .message-type {
  284. display: block;
  285. font-size: 30rpx;
  286. font-weight: bold;
  287. color: #333;
  288. margin-bottom: 10rpx;
  289. }
  290. .message-content {
  291. display: block;
  292. font-size: 26rpx;
  293. color: #666;
  294. line-height: 1.4;
  295. }
  296. .message-time {
  297. font-size: 24rpx;
  298. color: #999;
  299. margin-top: auto;
  300. }
  301. }
  302. &.user-message {
  303. display: flex;
  304. background: #FFFFFF;
  305. border: 2rpx solid #E0E0E0;
  306. .message-avatar {
  307. width: 60rpx;
  308. height: 60rpx;
  309. border-radius: 50%;
  310. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  311. color: #FFFFFF;
  312. font-size: 28rpx;
  313. font-weight: bold;
  314. display: flex;
  315. align-items: center;
  316. justify-content: center;
  317. margin-right: 20rpx;
  318. }
  319. .message-body {
  320. flex: 1;
  321. }
  322. .message-type {
  323. display: block;
  324. font-size: 30rpx;
  325. font-weight: bold;
  326. color: #333;
  327. margin-bottom: 10rpx;
  328. }
  329. .message-content {
  330. display: block;
  331. font-size: 26rpx;
  332. color: #666;
  333. line-height: 1.4;
  334. }
  335. .message-time {
  336. font-size: 24rpx;
  337. color: #999;
  338. margin-top: auto;
  339. }
  340. }
  341. }
  342. /* 时间分组 */
  343. .time-group {
  344. display: flex;
  345. justify-content: center;
  346. margin: 20rpx 0;
  347. .time-label {
  348. display: inline-block;
  349. background: #FFF3E0;
  350. color: #FF9800;
  351. font-size: 24rpx;
  352. padding: 8rpx 20rpx;
  353. border-radius: 20rpx;
  354. font-weight: bold;
  355. }
  356. }
  357. /* 底部导航 */
  358. .tabbar {
  359. position: fixed;
  360. bottom: 0;
  361. left: 0;
  362. right: 0;
  363. height: 110rpx;
  364. background: #FFFFFF;
  365. border-top: 1rpx solid #F0F0F0;
  366. display: flex;
  367. justify-content: space-around;
  368. align-items: center;
  369. padding-bottom: env(safe-area-inset-bottom);
  370. .tabbar-item {
  371. display: flex;
  372. flex-direction: column;
  373. align-items: center;
  374. gap: 6rpx;
  375. padding: 10rpx 0;
  376. .tab-icon-wrapper {
  377. position: relative;
  378. .badge {
  379. position: absolute;
  380. top: -8rpx;
  381. right: -12rpx;
  382. background: #FF4444;
  383. color: #FFFFFF;
  384. font-size: 18rpx;
  385. font-weight: bold;
  386. min-width: 28rpx;
  387. height: 28rpx;
  388. padding: 0 6rpx;
  389. border-radius: 14rpx;
  390. display: flex;
  391. align-items: center;
  392. justify-content: center;
  393. }
  394. }
  395. .tab-icon {
  396. font-size: 36rpx;
  397. }
  398. .tab-text {
  399. font-size: 20rpx;
  400. color: #999;
  401. }
  402. &.active {
  403. .tab-text {
  404. color: #9C27B0;
  405. font-weight: bold;
  406. }
  407. }
  408. }
  409. }
  410. </style>