message.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  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 home" @click="navigateToWorkbench">
  69. <view class="tabbar-icon"></view>
  70. <text class="tabbar-text">工作台</text>
  71. </view>
  72. <view class="tabbar-item resources" @click="navigateToMyResources">
  73. <view class="tabbar-icon"></view>
  74. <text class="tabbar-text">我的资源</text>
  75. </view>
  76. <view class="tabbar-item trophy" @click="navigateToRanking">
  77. <view class="tabbar-icon"></view>
  78. <text class="tabbar-text">排行榜</text>
  79. </view>
  80. <view class="tabbar-item message active" @click="navigateToMessage">
  81. <view class="tabbar-icon">
  82. <view class="badge">3</view>
  83. </view>
  84. <text class="tabbar-text">消息</text>
  85. </view>
  86. <view class="tabbar-item mine" @click="navigateToMine">
  87. <view class="tabbar-icon"></view>
  88. <text class="tabbar-text">我的</text>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. export default {
  95. data() {
  96. return {
  97. messages: [
  98. {
  99. id: 1,
  100. type: 'system',
  101. title: '系统通知',
  102. content: '您的线索审核已通过,获得20积分奖励,当前积分可兑换【资源查看权限】x1',
  103. footer: '完成线索采集,积分+20 (距黄金级还差72分)',
  104. time: '刚刚',
  105. isNew: true
  106. },
  107. {
  108. id: 2,
  109. type: 'matchSuccess',
  110. title: '撮合成功通知',
  111. content: '您推荐的王先生和刘女士已成功匹配,获得50积分+100元现金奖励',
  112. time: '10分钟前',
  113. isNew: false
  114. },
  115. {
  116. id: 3,
  117. type: 'user',
  118. title: '魏先生',
  119. content: '您好,想了解一下李女士的详细情况,方便沟通吗?',
  120. time: '1小时前',
  121. isNew: false
  122. },
  123. {
  124. id: 4,
  125. type: 'user',
  126. title: '张先生',
  127. content: '您好,想了解一下王女士的详细情况,方便沟通吗?',
  128. time: '1小时前',
  129. isNew: false
  130. },
  131. {
  132. id: 5,
  133. type: 'user',
  134. title: '高先生',
  135. content: '您好,想了解一下陈女士的详细情况,方便沟通吗?',
  136. time: '1小时前',
  137. isNew: false
  138. }
  139. ]
  140. }
  141. },
  142. methods: {
  143. // 返回上一页
  144. goBack() {
  145. uni.navigateBack()
  146. },
  147. // 导航到工作台
  148. navigateToWorkbench() {
  149. uni.redirectTo({
  150. url: '/pages/matchmaker-workbench/index'
  151. })
  152. },
  153. // 导航到我的资源
  154. navigateToMyResources() {
  155. uni.redirectTo({
  156. url: '/pages/matchmaker-workbench/my-resources'
  157. })
  158. },
  159. // 导航到排行榜
  160. navigateToRanking() {
  161. uni.redirectTo({
  162. url: '/pages/matchmaker-workbench/ranking'
  163. })
  164. },
  165. // 导航到消息
  166. navigateToMessage() {
  167. // 已在消息页面,无需跳转
  168. },
  169. // 导航到我的
  170. navigateToMine() {
  171. uni.redirectTo({
  172. url: '/pages/matchmaker-workbench/mine'
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .matchmaker-message {
  180. min-height: 100vh;
  181. background: #FFF9F9;
  182. display: flex;
  183. flex-direction: column;
  184. }
  185. /* 顶部导航栏 */
  186. .header {
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. padding: 25rpx 30rpx;
  191. padding-top: calc(25rpx + env(safe-area-inset-top));
  192. background: #FFF9F9;
  193. border-bottom: 1rpx solid #F0F0F0;
  194. .back-btn {
  195. width: 70rpx;
  196. height: 70rpx;
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. background: rgba(240, 240, 240, 0.5);
  201. border-radius: 50%;
  202. 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>');
  203. background-size: 40rpx 40rpx;
  204. background-repeat: no-repeat;
  205. background-position: center;
  206. }
  207. .header-title {
  208. font-size: 38rpx;
  209. font-weight: bold;
  210. color: #333;
  211. }
  212. .placeholder {
  213. width: 70rpx;
  214. }
  215. }
  216. .content {
  217. flex: 1;
  218. padding: 20rpx 20rpx 120rpx;
  219. }
  220. /* 消息项 */
  221. .message-item {
  222. background: #FFFFFF;
  223. border-radius: 20rpx;
  224. padding: 25rpx;
  225. margin-bottom: 20rpx;
  226. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  227. position: relative;
  228. &.system-notification {
  229. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  230. border: 2rpx solid #F8BBD0;
  231. &.active {
  232. border-color: #E91E63;
  233. }
  234. .message-type {
  235. display: block;
  236. font-size: 32rpx;
  237. font-weight: bold;
  238. color: #333;
  239. margin-bottom: 15rpx;
  240. }
  241. .message-time {
  242. display: block;
  243. font-size: 24rpx;
  244. color: #999;
  245. margin-bottom: 15rpx;
  246. text-align: right;
  247. }
  248. .message-content {
  249. display: block;
  250. font-size: 28rpx;
  251. color: #333;
  252. line-height: 1.5;
  253. margin-bottom: 15rpx;
  254. }
  255. .message-footer {
  256. display: block;
  257. font-size: 24rpx;
  258. color: #666;
  259. line-height: 1.4;
  260. }
  261. }
  262. &.match-success {
  263. display: flex;
  264. background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  265. border: 2rpx solid #D1C4E9;
  266. .message-icon {
  267. width: 60rpx;
  268. height: 60rpx;
  269. border-radius: 50%;
  270. margin-right: 20rpx;
  271. background-size: 40rpx 40rpx;
  272. background-repeat: no-repeat;
  273. background-position: center;
  274. }
  275. .message-icon.heart {
  276. background-color: #F8BBD0;
  277. 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>');
  278. }
  279. .message-body {
  280. flex: 1;
  281. }
  282. .message-type {
  283. display: block;
  284. font-size: 30rpx;
  285. font-weight: bold;
  286. color: #333;
  287. margin-bottom: 10rpx;
  288. }
  289. .message-content {
  290. display: block;
  291. font-size: 26rpx;
  292. color: #666;
  293. line-height: 1.4;
  294. }
  295. .message-time {
  296. font-size: 24rpx;
  297. color: #999;
  298. margin-top: auto;
  299. }
  300. }
  301. &.user-message {
  302. display: flex;
  303. background: #FFFFFF;
  304. border: 2rpx solid #E0E0E0;
  305. .message-avatar {
  306. width: 60rpx;
  307. height: 60rpx;
  308. border-radius: 50%;
  309. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  310. color: #FFFFFF;
  311. font-size: 28rpx;
  312. font-weight: bold;
  313. display: flex;
  314. align-items: center;
  315. justify-content: center;
  316. margin-right: 20rpx;
  317. }
  318. .message-body {
  319. flex: 1;
  320. }
  321. .message-type {
  322. display: block;
  323. font-size: 30rpx;
  324. font-weight: bold;
  325. color: #333;
  326. margin-bottom: 10rpx;
  327. }
  328. .message-content {
  329. display: block;
  330. font-size: 26rpx;
  331. color: #666;
  332. line-height: 1.4;
  333. }
  334. .message-time {
  335. font-size: 24rpx;
  336. color: #999;
  337. margin-top: auto;
  338. }
  339. }
  340. }
  341. /* 时间分组 */
  342. .time-group {
  343. display: flex;
  344. justify-content: center;
  345. margin: 20rpx 0;
  346. .time-label {
  347. display: inline-block;
  348. background: #FFF3E0;
  349. color: #FF9800;
  350. font-size: 24rpx;
  351. padding: 8rpx 20rpx;
  352. border-radius: 20rpx;
  353. font-weight: bold;
  354. }
  355. }
  356. /* 底部导航 */
  357. .tabbar {
  358. position: fixed;
  359. bottom: 0;
  360. left: 0;
  361. right: 0;
  362. height: 100rpx;
  363. background: #FFFFFF;
  364. border-top: 1rpx solid #F0F0F0;
  365. display: flex;
  366. justify-content: space-around;
  367. align-items: center;
  368. padding-bottom: env(safe-area-inset-bottom);
  369. .tabbar-item {
  370. display: flex;
  371. flex-direction: column;
  372. align-items: center;
  373. gap: 8rpx;
  374. padding: 10rpx 0;
  375. .tabbar-icon {
  376. width: 44rpx;
  377. height: 44rpx;
  378. background-size: contain;
  379. background-repeat: no-repeat;
  380. background-position: center;
  381. position: relative;
  382. .badge {
  383. position: absolute;
  384. top: -8rpx;
  385. right: -8rpx;
  386. background: #FF4444;
  387. color: #FFFFFF;
  388. font-size: 20rpx;
  389. font-weight: bold;
  390. width: 32rpx;
  391. height: 32rpx;
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. border-radius: 16rpx;
  396. }
  397. }
  398. .tabbar-text {
  399. font-size: 20rpx;
  400. color: #999;
  401. }
  402. &.active .tabbar-text {
  403. color: #9C27B0;
  404. font-weight: bold;
  405. }
  406. &.home .tabbar-icon {
  407. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  408. }
  409. &.home.active .tabbar-icon {
  410. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  411. }
  412. &.resources .tabbar-icon {
  413. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  414. }
  415. &.resources.active .tabbar-icon {
  416. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  417. }
  418. &.trophy .tabbar-icon {
  419. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
  420. }
  421. &.trophy.active .tabbar-icon {
  422. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
  423. }
  424. &.message .tabbar-icon {
  425. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  426. }
  427. &.message.active .tabbar-icon {
  428. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  429. }
  430. &.mine .tabbar-icon {
  431. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  432. }
  433. &.mine.active .tabbar-icon {
  434. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  435. }
  436. }
  437. }
  438. </style>