与牧同行-小程序用户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.3 KiB

  1. /* 页面背景 - 微信灰 */
  2. .chat-list {
  3. background-color: #ededed;
  4. min-height: 100vh;
  5. }
  6. /* 列表项 - 微信白色卡片 */
  7. .list-item {
  8. display: flex;
  9. padding: 10px 15px;
  10. background-color: #ffffff;
  11. position: relative;
  12. align-items: center; /* 关键:垂直居中对齐 */
  13. }
  14. /* 微信没有点击变色效果,如果要加可以保留,不加可以删除 */
  15. .list-item:active {
  16. background-color: #f4f4f4;
  17. }
  18. /* 头像区域 - 微信45px,固定大小不变 */
  19. .avatar {
  20. width: 45px;
  21. height: 45px;
  22. margin-right: 12px;
  23. flex-shrink: 0;
  24. }
  25. .avatar image {
  26. width: 100%;
  27. height: 100%;
  28. border-radius: 6px;
  29. background-color: #f0f0f0;
  30. }
  31. /* 内容区域 - 占据剩余空间,垂直居中 */
  32. .content {
  33. flex: 1;
  34. min-width: 0;
  35. display: flex;
  36. flex-direction: column;
  37. justify-content: center; /* 内容垂直居中 */
  38. height: 100%; /* 占满父容器高度 */
  39. }
  40. /* 第一行:用户名和时间 */
  41. .info-row {
  42. display: flex;
  43. justify-content: space-between;
  44. align-items: center;
  45. width: 100%;
  46. line-height: 1.2; /* 控制行高 */
  47. }
  48. /* 用户名 - 微信字体16px,粗体,不换行 */
  49. .username {
  50. font-size: 16px;
  51. font-weight: bold;
  52. color: #333333;
  53. white-space: nowrap;
  54. overflow: hidden;
  55. text-overflow: ellipsis;
  56. flex: 1; /* 自动伸缩 */
  57. min-width: 0; /* 防止溢出 */
  58. }
  59. /* 时间 - 微信浅灰色小字,固定宽度不换行 */
  60. .time {
  61. font-size: 12px;
  62. color: #b3b3b3;
  63. white-space: nowrap;
  64. margin-left: 8px;
  65. }
  66. /* 第二行:最后一条消息 */
  67. .message-row {
  68. display: flex;
  69. align-items: center;
  70. width: 100%;
  71. margin-top: 16rpx;
  72. }
  73. /* 消息基础样式 - 微信14px灰色 */
  74. .last-message {
  75. font-size: 14px;
  76. white-space: nowrap;
  77. overflow: hidden;
  78. text-overflow: ellipsis;
  79. flex: 1; /* 自动伸缩 */
  80. min-width: 0; /* 防止溢出 */
  81. }
  82. /* 正常消息 - 微信灰色 #8a8a8a */
  83. .last-message.normal {
  84. color: #9E9E9E;
  85. }
  86. /* 空消息 - 微信红色 */
  87. .last-message.empty {
  88. color: #fa5151;
  89. }
  90. /* 空状态页面 */
  91. .empty-state {
  92. display: flex;
  93. justify-content: center;
  94. align-items: center;
  95. height: 80vh;
  96. color: #b3b3b3;
  97. font-size: 15px;
  98. }