chore: 提交剩余开发改动
包含商务通消息映射、会话时间与未读状态、前端消息展示、数据库修复迁移、测试覆盖备份及 Captain 设计文档。
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { zhCN } from 'date-fns/locale';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { messageTimestamp } from 'shared/helpers/timeHelper';
|
||||
|
||||
import MessageStatus from './MessageStatus.vue';
|
||||
@@ -32,9 +34,17 @@ const {
|
||||
contentAttributes,
|
||||
} = useMessageContext();
|
||||
|
||||
const readableTime = computed(() =>
|
||||
messageTimestamp(createdAt.value, 'LLL d, h:mm a')
|
||||
);
|
||||
const { locale } = useI18n();
|
||||
|
||||
const readableTime = computed(() => {
|
||||
if (locale.value === 'zh_CN') {
|
||||
return messageTimestamp(createdAt.value, 'M月d日 aaa h:mm', {
|
||||
locale: zhCN,
|
||||
fallbackFormat: 'yyyy年M月d日 aaa h:mm',
|
||||
});
|
||||
}
|
||||
return messageTimestamp(createdAt.value, 'LLL d, h:mm a');
|
||||
});
|
||||
|
||||
const showStatusIndicator = computed(() => {
|
||||
if (isPrivate.value) return false;
|
||||
@@ -73,7 +83,8 @@ const isSent = computed(() => {
|
||||
// All messages will be mark as sent for the Line channel, as there is no source ID.
|
||||
if (isALineChannel.value) return true;
|
||||
|
||||
return false;
|
||||
// Custom channels persist platform-side messages with their final status.
|
||||
return status.value === MESSAGE_STATUS.SENT;
|
||||
});
|
||||
|
||||
const isDelivered = computed(() => {
|
||||
@@ -99,7 +110,7 @@ const isDelivered = computed(() => {
|
||||
return status.value === MESSAGE_STATUS.DELIVERED;
|
||||
}
|
||||
|
||||
return false;
|
||||
return status.value === MESSAGE_STATUS.DELIVERED;
|
||||
});
|
||||
|
||||
const isRead = computed(() => {
|
||||
@@ -119,7 +130,7 @@ const isRead = computed(() => {
|
||||
return status.value === MESSAGE_STATUS.READ;
|
||||
}
|
||||
|
||||
return false;
|
||||
return status.value === MESSAGE_STATUS.READ;
|
||||
});
|
||||
|
||||
const statusToShow = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user