zhengyiming
2025-02-10 0f686ea1fe4700a909a6159efcf1fcb0e1f88a17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<template>
  <!-- <MessageTimestamp
    :currTime="prevTime === 0 ? 0 : dayjs(prevTime).toDate().getTime()"
    :prevTime="dayjs(creationTime).toDate().getTime()"
  ></MessageTimestamp> -->
  <div class="bl-message-timestamp">
    {{ dayjs(creationTime).format('YYYY-MM-DD') }}
  </div>
  <Card class="system-message-card-wrapper-v2">
    {{ messageContent }}
    <!-- <div class="system-message-card-inner">
      <Avatar :size="30" :src="IconSystemAvatar" class="system-message-card-avatar" />
      <div class="system-message-card-content">
        <div class="system-message-card-content-top">
          <div class="system-message-card-title">系统消息</div>
          <div class="system-message-card-time">{{ dayjs(creationTime).format('YYYY-MM-DD') }}</div>
        </div>
        <div class="system-message-card-content-bottom">
          {{ messageContent }}
        </div>
      </div>
    </div> -->
  </Card>
</template>
 
<script setup lang="ts">
import Card from './Card.vue';
import { Avatar } from '@12333/components';
import dayjs from 'dayjs';
import IconSystemAvatar from '@/assets/message/icon-system-avatar.png';
import MessageTimestamp from '../message/message-timestamp.vue';
 
defineOptions({
  name: 'SystemMessageCard',
});
 
type Props = {
  id?: string;
  messageContent?: string;
  creationTime?: string;
  prevTime?: string | number;
  type?: number;
};
 
const props = withDefaults(defineProps<Props>(), {});
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.system-message-card-wrapper {
  border-radius: 0;
  padding: 0 boleGetCssVar('size', 'body-padding-h');
  margin-bottom: 0;
 
  &:last-child {
    .system-message-card-inner {
      border-bottom: none;
    }
  }
 
  .system-message-card-inner {
    border-bottom: 2px solid #f6f6f6;
    padding: 32px 0;
    display: flex;
 
    .system-message-card-avatar {
      margin-right: 20px;
    }
 
    .system-message-card-content {
      flex: 1;
      min-width: 0;
 
      .system-message-card-content-top {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
 
        .system-message-card-title {
          font-weight: 600;
          font-size: 28px;
          color: #555555;
          line-height: 40px;
          @include ellipsis;
          flex: 1;
          min-width: 0;
        }
 
        .system-message-card-time {
          font-weight: 400;
          font-size: 22px;
          color: boleGetCssVar('text-color', 'regular');
          line-height: 32px;
        }
      }
 
      .system-message-card-content-bottom {
        font-weight: 400;
        font-size: 24px;
        color: boleGetCssVar('text-color', 'regular');
        line-height: 34px;
        @include ellipsis;
      }
    }
  }
}
 
.system-message-card-wrapper-v2 {
  padding: 32px boleGetCssVar('size', 'body-padding-h');
  font-weight: 400;
  font-size: 28px;
  color: boleGetCssVar('text-color', 'primary');
  line-height: 44px;
}
</style>