From edc50b6f006c9969e675de6b0f6a0e6ec02c74e6 Mon Sep 17 00:00:00 2001 From: preschooler Date: Wed, 21 Aug 2024 14:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=E4=BF=AE=E5=A4=8D=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/formatTime.ts | 12 ++++++------ .../kefu/components/KeFuConversationList.vue | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 134a986e..5fcfc66c 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -56,11 +56,11 @@ export const defaultShortcuts = [ * 时间日期转换 * @param date 当前时间,new Date() 格式 * @param format 需要转换的时间格式字符串 - * @description format 字符串随意,如 `YYYY-mm、YYYY-mm-dd` - * @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ" - * @description format 星期:"YYYY-mm-dd HH:MM:SS WWW" - * @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ" - * @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ" + * @description format 字符串随意,如 `YYYY-mm、YYYY-MM-DD` + * @description format 季度:"YYYY-MM-DD HH:MM:SS QQQQ" + * @description format 星期:"YYYY-MM-DD HH:MM:SS WWW" + * @description format 几周:"YYYY-MM-DD HH:MM:SS ZZZ" + * @description format 季度 + 星期 + 几周:"YYYY-MM-DD HH:MM:SS WWW QQQQ ZZZ" * @returns 返回拼接后的时间字符串 */ export function formatDate(date: Date, format?: string): string { @@ -110,7 +110,7 @@ export function getWeek(dateTime: Date): number { * @description param 3天: 60 * 60* 24 * 1000 * 3 * @returns 返回拼接后的时间字符串 */ -export function formatPast(param: string | Date, format = 'YYYY-mm-dd HH:MM:SS'): string { +export function formatPast(param: string | Date, format = 'YYYY-MM-DD HH:MM:SS'): string { // 传入格式处理、存储转换值 let t: any, s: number // 获取js 时间戳 diff --git a/src/views/mall/promotion/kefu/components/KeFuConversationList.vue b/src/views/mall/promotion/kefu/components/KeFuConversationList.vue index 60188f32..565176f1 100644 --- a/src/views/mall/promotion/kefu/components/KeFuConversationList.vue +++ b/src/views/mall/promotion/kefu/components/KeFuConversationList.vue @@ -23,7 +23,7 @@
{{ item.userNickname }} - {{ formatPast(item.lastMessageTime, 'YYYY-mm-dd') }} + {{ formatPast(item.lastMessageTime, 'YYYY-MM-DD') }}
@@ -186,11 +186,11 @@ watch(showRightMenu, (val) => { transition: border-left 0.05s ease-in-out; /* 设置过渡效果 */ .username { - min-width: 0; + display: -webkit-box; max-width: 60%; + min-width: 0; overflow: hidden; text-overflow: ellipsis; - display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; } @@ -198,14 +198,14 @@ watch(showRightMenu, (val) => { .last-message { width: 200px; overflow: hidden; // 隐藏超出的文本 - white-space: nowrap; // 禁止换行 text-overflow: ellipsis; // 添加省略号 + white-space: nowrap; // 禁止换行 } } .active { - border-left: 5px #3271ff solid; background-color: #eff0f1; + border-left: 5px #3271ff solid; } .pinned { @@ -214,13 +214,13 @@ watch(showRightMenu, (val) => { .right-menu-ul { position: absolute; - background-color: #fff; + width: 130px; padding: 10px; margin: 0; list-style-type: none; /* 移除默认的项目符号 */ + background-color: #fff; border-radius: 12px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */ - width: 130px; + box-shadow: 0 2px 4px rgb(0 0 0 / 10%); /* 阴影效果 */ li { padding: 8px 16px;