message.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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. }
  125. },
  126. methods: {
  127. // 返回上一页
  128. goBack() {
  129. uni.navigateBack()
  130. },
  131. // 导航到工作台
  132. navigateToWorkbench() {
  133. uni.redirectTo({
  134. url: '/pages/matchmaker-workbench/index'
  135. })
  136. },
  137. // 导航到我的资源
  138. navigateToMyResources() {
  139. uni.redirectTo({
  140. url: '/pages/matchmaker-workbench/my-resources'
  141. })
  142. },
  143. // 导航到排行榜
  144. navigateToRanking() {
  145. uni.redirectTo({
  146. url: '/pages/matchmaker-workbench/ranking'
  147. })
  148. },
  149. // 导航到消息
  150. navigateToMessage() {
  151. // 已在消息页面,无需跳转
  152. },
  153. // 导航到我的
  154. navigateToMine() {
  155. uni.redirectTo({
  156. url: '/pages/matchmaker-workbench/mine'
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .matchmaker-message {
  164. min-height: 100vh;
  165. background: #FFF9F9;
  166. display: flex;
  167. flex-direction: column;
  168. }
  169. /* 顶部导航栏 */
  170. .header {
  171. display: flex;
  172. align-items: center;
  173. justify-content: space-between;
  174. padding: 25rpx 30rpx;
  175. padding-top: calc(25rpx + env(safe-area-inset-top));
  176. background: #FFF9F9;
  177. border-bottom: 1rpx solid #F0F0F0;
  178. .back-btn {
  179. width: 70rpx;
  180. height: 70rpx;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. background: rgba(240, 240, 240, 0.5);
  185. border-radius: 50%;
  186. 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>');
  187. background-size: 40rpx 40rpx;
  188. background-repeat: no-repeat;
  189. background-position: center;
  190. }
  191. .header-title {
  192. font-size: 38rpx;
  193. font-weight: bold;
  194. color: #333;
  195. }
  196. .placeholder {
  197. width: 70rpx;
  198. }
  199. }
  200. .content {
  201. flex: 1;
  202. padding: 20rpx 20rpx 120rpx;
  203. }
  204. /* 消息项 */
  205. .message-item {
  206. background: #FFFFFF;
  207. border-radius: 20rpx;
  208. padding: 25rpx;
  209. margin-bottom: 20rpx;
  210. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  211. position: relative;
  212. &.system-notification {
  213. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  214. border: 2rpx solid #F8BBD0;
  215. &.active {
  216. border-color: #E91E63;
  217. }
  218. .message-type {
  219. display: block;
  220. font-size: 32rpx;
  221. font-weight: bold;
  222. color: #333;
  223. margin-bottom: 15rpx;
  224. }
  225. .message-time {
  226. display: block;
  227. font-size: 24rpx;
  228. color: #999;
  229. margin-bottom: 15rpx;
  230. text-align: right;
  231. }
  232. .message-content {
  233. display: block;
  234. font-size: 28rpx;
  235. color: #333;
  236. line-height: 1.5;
  237. margin-bottom: 15rpx;
  238. }
  239. .message-footer {
  240. display: block;
  241. font-size: 24rpx;
  242. color: #666;
  243. line-height: 1.4;
  244. }
  245. }
  246. &.match-success {
  247. display: flex;
  248. background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  249. border: 2rpx solid #D1C4E9;
  250. .message-icon {
  251. width: 60rpx;
  252. height: 60rpx;
  253. border-radius: 50%;
  254. margin-right: 20rpx;
  255. background-size: 40rpx 40rpx;
  256. background-repeat: no-repeat;
  257. background-position: center;
  258. }
  259. .message-icon.heart {
  260. background-color: #F8BBD0;
  261. 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>');
  262. }
  263. .message-body {
  264. flex: 1;
  265. }
  266. .message-type {
  267. display: block;
  268. font-size: 30rpx;
  269. font-weight: bold;
  270. color: #333;
  271. margin-bottom: 10rpx;
  272. }
  273. .message-content {
  274. display: block;
  275. font-size: 26rpx;
  276. color: #666;
  277. line-height: 1.4;
  278. }
  279. .message-time {
  280. font-size: 24rpx;
  281. color: #999;
  282. margin-top: auto;
  283. }
  284. }
  285. &.user-message {
  286. display: flex;
  287. background: #FFFFFF;
  288. border: 2rpx solid #E0E0E0;
  289. .message-avatar {
  290. width: 60rpx;
  291. height: 60rpx;
  292. border-radius: 50%;
  293. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  294. color: #FFFFFF;
  295. font-size: 28rpx;
  296. font-weight: bold;
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. margin-right: 20rpx;
  301. }
  302. .message-body {
  303. flex: 1;
  304. }
  305. .message-type {
  306. display: block;
  307. font-size: 30rpx;
  308. font-weight: bold;
  309. color: #333;
  310. margin-bottom: 10rpx;
  311. }
  312. .message-content {
  313. display: block;
  314. font-size: 26rpx;
  315. color: #666;
  316. line-height: 1.4;
  317. }
  318. .message-time {
  319. font-size: 24rpx;
  320. color: #999;
  321. margin-top: auto;
  322. }
  323. }
  324. }
  325. /* 时间分组 */
  326. .time-group {
  327. display: flex;
  328. justify-content: center;
  329. margin: 20rpx 0;
  330. .time-label {
  331. display: inline-block;
  332. background: #FFF3E0;
  333. color: #FF9800;
  334. font-size: 24rpx;
  335. padding: 8rpx 20rpx;
  336. border-radius: 20rpx;
  337. font-weight: bold;
  338. }
  339. }
  340. /* 底部导航 */
  341. .tabbar {
  342. position: fixed;
  343. bottom: 0;
  344. left: 0;
  345. right: 0;
  346. height: 100rpx;
  347. background: #FFFFFF;
  348. border-top: 1rpx solid #F0F0F0;
  349. display: flex;
  350. justify-content: space-around;
  351. align-items: center;
  352. padding-bottom: env(safe-area-inset-bottom);
  353. .tabbar-item {
  354. display: flex;
  355. flex-direction: column;
  356. align-items: center;
  357. gap: 8rpx;
  358. padding: 10rpx 0;
  359. .tabbar-icon {
  360. width: 44rpx;
  361. height: 44rpx;
  362. background-size: contain;
  363. background-repeat: no-repeat;
  364. background-position: center;
  365. position: relative;
  366. .badge {
  367. position: absolute;
  368. top: -8rpx;
  369. right: -8rpx;
  370. background: #FF4444;
  371. color: #FFFFFF;
  372. font-size: 20rpx;
  373. font-weight: bold;
  374. width: 32rpx;
  375. height: 32rpx;
  376. display: flex;
  377. align-items: center;
  378. justify-content: center;
  379. border-radius: 16rpx;
  380. }
  381. }
  382. .tabbar-text {
  383. font-size: 20rpx;
  384. color: #999;
  385. }
  386. &.active .tabbar-text {
  387. color: #9C27B0;
  388. font-weight: bold;
  389. }
  390. &.home .tabbar-icon {
  391. 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>');
  392. }
  393. &.home.active .tabbar-icon {
  394. 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>');
  395. }
  396. &.resources .tabbar-icon {
  397. 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>');
  398. }
  399. &.resources.active .tabbar-icon {
  400. 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>');
  401. }
  402. &.trophy .tabbar-icon {
  403. 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>');
  404. }
  405. &.trophy.active .tabbar-icon {
  406. 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>');
  407. }
  408. &.message .tabbar-icon {
  409. 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>');
  410. }
  411. &.message.active .tabbar-icon {
  412. 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>');
  413. }
  414. &.mine .tabbar-icon {
  415. 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>');
  416. }
  417. &.mine.active .tabbar-icon {
  418. 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>');
  419. }
  420. }
  421. }
  422. </style>