Skip to content

Commit edc50b6

Browse files
author
preschooler
committed
🐞 fix:修复时间格式错误
1 parent eb9a925 commit edc50b6

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/utils/formatTime.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ export const defaultShortcuts = [
5656
* 时间日期转换
5757
* @param date 当前时间,new Date() 格式
5858
* @param format 需要转换的时间格式字符串
59-
* @description format 字符串随意,如 `YYYY-mm、YYYY-mm-dd`
60-
* @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ"
61-
* @description format 星期:"YYYY-mm-dd HH:MM:SS WWW"
62-
* @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ"
63-
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
59+
* @description format 字符串随意,如 `YYYY-mm、YYYY-MM-DD`
60+
* @description format 季度:"YYYY-MM-DD HH:MM:SS QQQQ"
61+
* @description format 星期:"YYYY-MM-DD HH:MM:SS WWW"
62+
* @description format 几周:"YYYY-MM-DD HH:MM:SS ZZZ"
63+
* @description format 季度 + 星期 + 几周:"YYYY-MM-DD HH:MM:SS WWW QQQQ ZZZ"
6464
* @returns 返回拼接后的时间字符串
6565
*/
6666
export function formatDate(date: Date, format?: string): string {
@@ -110,7 +110,7 @@ export function getWeek(dateTime: Date): number {
110110
* @description param 3天: 60 * 60* 24 * 1000 * 3
111111
* @returns 返回拼接后的时间字符串
112112
*/
113-
export function formatPast(param: string | Date, format = 'YYYY-mm-dd HH:MM:SS'): string {
113+
export function formatPast(param: string | Date, format = 'YYYY-MM-DD HH:MM:SS'): string {
114114
// 传入格式处理、存储转换值
115115
let t: any, s: number
116116
// 获取js 时间戳

src/views/mall/promotion/kefu/components/KeFuConversationList.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="flex justify-between items-center w-100%">
2424
<span class="username">{{ item.userNickname }}</span>
2525
<span class="color-[#989EA6]">
26-
{{ formatPast(item.lastMessageTime, 'YYYY-mm-dd') }}
26+
{{ formatPast(item.lastMessageTime, 'YYYY-MM-DD') }}
2727
</span>
2828
</div>
2929
<!-- 最后聊天内容 -->
@@ -186,26 +186,26 @@ watch(showRightMenu, (val) => {
186186
transition: border-left 0.05s ease-in-out; /* 设置过渡效果 */
187187
188188
.username {
189-
min-width: 0;
189+
display: -webkit-box;
190190
max-width: 60%;
191+
min-width: 0;
191192
overflow: hidden;
192193
text-overflow: ellipsis;
193-
display: -webkit-box;
194194
-webkit-box-orient: vertical;
195195
-webkit-line-clamp: 1;
196196
}
197197
198198
.last-message {
199199
width: 200px;
200200
overflow: hidden; // 隐藏超出的文本
201-
white-space: nowrap; // 禁止换行
202201
text-overflow: ellipsis; // 添加省略号
202+
white-space: nowrap; // 禁止换行
203203
}
204204
}
205205
206206
.active {
207-
border-left: 5px #3271ff solid;
208207
background-color: #eff0f1;
208+
border-left: 5px #3271ff solid;
209209
}
210210
211211
.pinned {
@@ -214,13 +214,13 @@ watch(showRightMenu, (val) => {
214214
215215
.right-menu-ul {
216216
position: absolute;
217-
background-color: #fff;
217+
width: 130px;
218218
padding: 10px;
219219
margin: 0;
220220
list-style-type: none; /* 移除默认的项目符号 */
221+
background-color: #fff;
221222
border-radius: 12px;
222-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
223-
width: 130px;
223+
box-shadow: 0 2px 4px rgb(0 0 0 / 10%); /* 阴影效果 */
224224
225225
li {
226226
padding: 8px 16px;

0 commit comments

Comments
 (0)