From 8ce81540d97cbfefda6c0df431e8db0cc00e3ef8 Mon Sep 17 00:00:00 2001 From: tangxinyue <524779910@qq.com> Date: Fri, 26 Jun 2026 14:58:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=8D=8E=E4=B8=BA=E6=9C=BA?= =?UTF-8?q?=E5=9E=8B=E6=97=B6=E9=97=B4=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/message/chat/chat-list.vue | 14 +++++++------- main.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/message/chat/chat-list.vue b/components/message/chat/chat-list.vue index c1b6806..369a499 100644 --- a/components/message/chat/chat-list.vue +++ b/components/message/chat/chat-list.vue @@ -46,8 +46,8 @@ 'image-wrap-left': phone == 'iphone' && shouldApplyTailLeft(index) && isImageMsg(message), 'image-wrap-right': phone == 'iphone' && shouldApplyTailRight(index) && isImageMsg(message) }"> - { return Math.abs(currentMsgTime - prevMsgTime) > 180000; } -// 格式化文本:给网址和 5 位以上连续数字加上下划线样式,非我方消息同时赋予文字蓝色 +// 格式化文本:给网址、5位以上连续数字和日期时间加上下划线样式,非我方消息同时赋予文字蓝色 const formatMessageContent = (content, isMe) => { if (!content) return ''; - // 匹配 url 或 5位以上连续数字 - // URL: http(s)://... 或 xxx.xxx/... - const combinedRegex = /((?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[a-zA-Z0-9_/%-]*)*)|(\b\d{5,}(?:\.\d+)?\b)/g; + // 匹配 url 或 5位以上连续数字 或 YYYY-MM-DD HH:mm:ss 时间格式 + const combinedRegex = /((?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[a-zA-Z0-9_/%-]*)*)|(\b\d{5,}(?:\.\d+)?\b)|(\d{4}-\d{2}-\d{2}\s\d{1,2}:\d{2}:\d{2})/g; - return content.replace(combinedRegex, (match, p1, p2) => { + return content.replace(combinedRegex, (match, p1, p2, p3) => { // 如果是数字且包含小数点(通常是金额),则不添加下划线样式 if (p2 && p2.includes('.')) { return match; @@ -373,6 +372,7 @@ const formatMessageContent = (content, isMe) => { if (props.phone == 'iphone') color = '#0B7AE3' if (props.phone == 'mi') color = '#3A85F8' if (props.phone == 'oppo') color = '#03A311' + if (props.phone == 'huawei') color = '#0052D9' // 华为手机链接蓝色 const colorStyle = !isMe ? `color: ${color};` : ''; return `${match}`; }); diff --git a/main.js b/main.js index eb30071..cc04e01 100644 --- a/main.js +++ b/main.js @@ -29,7 +29,7 @@ export function createApp() { app.config.globalProperties.$system = plus.os.name; // #endif app.config.globalProperties.$systemInfo = systemInfo - uni.setStorageSync('version', '1.0.6.sp15') + uni.setStorageSync('version', '1.0.6.sp16') app.config.globalProperties.$version = uni.getStorageSync('version') app.use(globalMethods); return {