瑶都万能墙
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.

149 lines
2.9 KiB

  1. <template>
  2. <view class="group-item" @click="$emit('click')">
  3. <view class="group-header">
  4. <view class="group-avatar">
  5. <image :src="item.avatar || '/static/image/logo.jpg'" mode="aspectFill"></image>
  6. </view>
  7. <view class="group-info">
  8. <view class="group-name">{{ item.name || '群组名称' }}</view>
  9. <view class="group-desc">{{ item.description || '群组描述' }}</view>
  10. <view class="group-stats">
  11. <text class="member-count">{{ item.memberCount || 0 }}</text>
  12. <text class="separator">·</text>
  13. <text class="group-type">{{ item.type || '同城群' }}</text>
  14. </view>
  15. </view>
  16. <view class="group-status">
  17. <view v-if="item.isJoined" class="joined-tag">已加入</view>
  18. <view v-else class="join-btn">加入</view>
  19. </view>
  20. </view>
  21. <view class="group-footer" v-if="item.lastMessage">
  22. <view class="last-message">
  23. <text class="message-prefix">最新消息</text>
  24. <text class="message-content">{{ item.lastMessage }}</text>
  25. </view>
  26. <view class="message-time">{{ item.lastMessageTime || '' }}</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props: {
  33. item: {
  34. type: Object,
  35. default: () => ({})
  36. }
  37. },
  38. data() {
  39. return {
  40. }
  41. },
  42. methods: {
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. .group-item {
  48. margin: 20rpx;
  49. background-color: #fff;
  50. padding: 30rpx;
  51. border-radius: 20rpx;
  52. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
  53. .group-header {
  54. display: flex;
  55. align-items: center;
  56. .group-avatar {
  57. width: 120rpx;
  58. height: 120rpx;
  59. margin-right: 20rpx;
  60. image {
  61. width: 100%;
  62. height: 100%;
  63. border-radius: 20rpx;
  64. }
  65. }
  66. .group-info {
  67. flex: 1;
  68. .group-name {
  69. font-size: 32rpx;
  70. font-weight: bold;
  71. color: #333;
  72. margin-bottom: 8rpx;
  73. }
  74. .group-desc {
  75. font-size: 26rpx;
  76. color: #666;
  77. margin-bottom: 8rpx;
  78. line-height: 1.4;
  79. }
  80. .group-stats {
  81. display: flex;
  82. align-items: center;
  83. font-size: 24rpx;
  84. color: #999;
  85. .separator {
  86. margin: 0 8rpx;
  87. }
  88. }
  89. }
  90. .group-status {
  91. .joined-tag {
  92. background-color: #5baaff;
  93. color: #fff;
  94. padding: 8rpx 16rpx;
  95. border-radius: 20rpx;
  96. font-size: 24rpx;
  97. }
  98. .join-btn {
  99. background-color: #f0f0f0;
  100. color: #5baaff;
  101. padding: 8rpx 16rpx;
  102. border-radius: 20rpx;
  103. font-size: 24rpx;
  104. border: 1rpx solid #5baaff;
  105. }
  106. }
  107. }
  108. .group-footer {
  109. margin-top: 20rpx;
  110. padding-top: 20rpx;
  111. border-top: 1rpx solid #f0f0f0;
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. .last-message {
  116. flex: 1;
  117. font-size: 24rpx;
  118. color: #999;
  119. .message-prefix {
  120. color: #666;
  121. }
  122. .message-content {
  123. color: #999;
  124. }
  125. }
  126. .message-time {
  127. font-size: 22rpx;
  128. color: #ccc;
  129. }
  130. }
  131. }
  132. </style>