Merge branch 'Branch_1' of https://git.u8t.cn/tangxinyue/alipay-emulator into Branch_1

# Conflicts:
#	main.js
This commit is contained in:
小李 2026-06-26 15:00:42 +08:00
commit ccdab994a8
1 changed files with 7 additions and 7 deletions

View File

@ -46,8 +46,8 @@
'image-wrap-left': phone == 'iphone' && shouldApplyTailLeft(index) && isImageMsg(message), 'image-wrap-left': phone == 'iphone' && shouldApplyTailLeft(index) && isImageMsg(message),
'image-wrap-right': phone == 'iphone' && shouldApplyTailRight(index) && isImageMsg(message) 'image-wrap-right': phone == 'iphone' && shouldApplyTailRight(index) && isImageMsg(message)
}"> }">
<image :src="getImageSrc(message)" :mode="getImageMode(message, phone)" <image :src="getImageSrc(message)" :mode="getImageMode(message, phone)" class="chat-image"
class="chat-image" :class="{ :class="{
'chat-image-left': phone == 'iphone' && shouldApplyTailLeft(index) && isImageMsg(message), 'chat-image-left': phone == 'iphone' && shouldApplyTailLeft(index) && isImageMsg(message),
'chat-image-right': phone == 'iphone' && shouldApplyTailRight(index) && isImageMsg(message) 'chat-image-right': phone == 'iphone' && shouldApplyTailRight(index) && isImageMsg(message)
}" :style="phone == 'iphone' ? '' : getImageStyle(message)" }" :style="phone == 'iphone' ? '' : getImageStyle(message)"
@ -355,15 +355,14 @@ const shouldShowTime = (index) => {
return Math.abs(currentMsgTime - prevMsgTime) > 180000; return Math.abs(currentMsgTime - prevMsgTime) > 180000;
} }
// 5 线 // 5线
const formatMessageContent = (content, isMe) => { const formatMessageContent = (content, isMe) => {
if (!content) return ''; if (!content) return '';
// url 5 // url 5 YYYY-MM-DD HH:mm:ss
// 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)|(\d{4}-\d{2}-\d{2}\s\d{1,2}:\d{2}:\d{2})/g;
const combinedRegex = /((?:https?:\/\/)?(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[a-zA-Z0-9_/%-]*)*)|(\b\d{5,}(?:\.\d+)?\b)/g;
return content.replace(combinedRegex, (match, p1, p2) => { return content.replace(combinedRegex, (match, p1, p2, p3) => {
// 线 // 线
if (p2 && p2.includes('.')) { if (p2 && p2.includes('.')) {
return match; return match;
@ -373,6 +372,7 @@ const formatMessageContent = (content, isMe) => {
if (props.phone == 'iphone') color = '#0B7AE3' if (props.phone == 'iphone') color = '#0B7AE3'
if (props.phone == 'mi') color = '#3A85F8' if (props.phone == 'mi') color = '#3A85F8'
if (props.phone == 'oppo') color = '#03A311' if (props.phone == 'oppo') color = '#03A311'
if (props.phone == 'huawei') color = '#0052D9' //
const colorStyle = !isMe ? `color: ${color};` : ''; const colorStyle = !isMe ? `color: ${color};` : '';
return `<span style="text-decoration: underline; ${colorStyle}">${match}</span>`; return `<span style="text-decoration: underline; ${colorStyle}">${match}</span>`;
}); });