粗提取链接
This commit is contained in:
@@ -43,6 +43,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<scroll-view class="message-detail-content" scroll-y>
|
<scroll-view class="message-detail-content" scroll-y>
|
||||||
<text>{{ detailMessageContent }}</text>
|
<text>{{ detailMessageContent }}</text>
|
||||||
|
<view v-if="detailLinks.length" class="detail-links-section">
|
||||||
|
<view class="detail-links-title">链接 ({{ detailLinks.length }})</view>
|
||||||
|
<view v-for="(link, i) in detailLinks" :key="i" class="detail-link-item" @click="openLink(link)">
|
||||||
|
<text class="link-text">{{ link }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -671,13 +677,29 @@
|
|||||||
// 消息详情弹窗
|
// 消息详情弹窗
|
||||||
const showMessageModal = ref(false)
|
const showMessageModal = ref(false)
|
||||||
const detailMessageContent = ref('')
|
const detailMessageContent = ref('')
|
||||||
|
const detailLinks = ref([])
|
||||||
|
const extractLinks = (text) => {
|
||||||
|
const regex = /https?:\/\/[^\s<>"{}|\\^`[\]]+/gi
|
||||||
|
const matches = text.match(regex)
|
||||||
|
return matches ? [...new Set(matches)] : []
|
||||||
|
}
|
||||||
const showMessageDetail = (message) => {
|
const showMessageDetail = (message) => {
|
||||||
detailMessageContent.value = message.content || ''
|
detailMessageContent.value = message.content || ''
|
||||||
|
detailLinks.value = extractLinks(detailMessageContent.value)
|
||||||
showMessageModal.value = true
|
showMessageModal.value = true
|
||||||
}
|
}
|
||||||
const closeMessageDetail = () => {
|
const closeMessageDetail = () => {
|
||||||
showMessageModal.value = false
|
showMessageModal.value = false
|
||||||
detailMessageContent.value = ''
|
detailMessageContent.value = ''
|
||||||
|
detailLinks.value = []
|
||||||
|
}
|
||||||
|
const openLink = (url) => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.openURL(url)
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
window.open(url, '_blank')
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendMessage = async () => {
|
const sendMessage = async () => {
|
||||||
@@ -1396,4 +1418,31 @@
|
|||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 消息详情弹窗 — 链接提取区域 */
|
||||||
|
.detail-links-section {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
padding-top: 24rpx;
|
||||||
|
border-top: 1rpx solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-links-title {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-link-item {
|
||||||
|
padding: 16rpx 20rpx;
|
||||||
|
background: #f5f7fa;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #007aff;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
126
unpackage/dist/dev/app-plus/app-service.js
vendored
126
unpackage/dist/dev/app-plus/app-service.js
vendored
@@ -5597,7 +5597,7 @@ This will fail in production.`);
|
|||||||
if (friendSocketStore.isConnected)
|
if (friendSocketStore.isConnected)
|
||||||
return;
|
return;
|
||||||
if (!userToken.value || !UserId.value) {
|
if (!userToken.value || !UserId.value) {
|
||||||
formatAppLog("warn", "at pages/Chat/Chat.vue:308", "Token或UserId未准备好");
|
formatAppLog("warn", "at pages/Chat/Chat.vue:314", "Token或UserId未准备好");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
friendSocketStore.connect({
|
friendSocketStore.connect({
|
||||||
@@ -5668,7 +5668,7 @@ This will fail in production.`);
|
|||||||
const html = t(content);
|
const html = t(content);
|
||||||
return html;
|
return html;
|
||||||
} catch (e2) {
|
} catch (e2) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:407", "解析失败", e2);
|
formatAppLog("error", "at pages/Chat/Chat.vue:413", "解析失败", e2);
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -5727,7 +5727,7 @@ This will fail in production.`);
|
|||||||
files
|
files
|
||||||
};
|
};
|
||||||
} catch (e2) {
|
} catch (e2) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:484", "解析文件信息失败:", e2);
|
formatAppLog("error", "at pages/Chat/Chat.vue:490", "解析文件信息失败:", e2);
|
||||||
return {
|
return {
|
||||||
textContent: content,
|
textContent: content,
|
||||||
files: []
|
files: []
|
||||||
@@ -5764,7 +5764,7 @@ This will fail in production.`);
|
|||||||
}
|
}
|
||||||
takeUserConversations();
|
takeUserConversations();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:529", "新建普通会话失败:", error);
|
formatAppLog("error", "at pages/Chat/Chat.vue:535", "新建普通会话失败:", error);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "创建会话失败,请重试",
|
title: "创建会话失败,请重试",
|
||||||
icon: "none"
|
icon: "none"
|
||||||
@@ -5802,7 +5802,7 @@ This will fail in production.`);
|
|||||||
};
|
};
|
||||||
const previewFileArray = vue.ref([]);
|
const previewFileArray = vue.ref([]);
|
||||||
const uploadPhoto = () => {
|
const uploadPhoto = () => {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:578", "点击了拍照上传");
|
formatAppLog("log", "at pages/Chat/Chat.vue:584", "点击了拍照上传");
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1,
|
count: 1,
|
||||||
sourceType: ["camera", "album"],
|
sourceType: ["camera", "album"],
|
||||||
@@ -5825,7 +5825,7 @@ This will fail in production.`);
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:596", "选择图片失败", err);
|
formatAppLog("error", "at pages/Chat/Chat.vue:602", "选择图片失败", err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -5834,12 +5834,12 @@ This will fail in production.`);
|
|||||||
};
|
};
|
||||||
const fileList = vue.ref([]);
|
const fileList = vue.ref([]);
|
||||||
const uploadFile = () => {
|
const uploadFile = () => {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:607", "点击了上传文件");
|
formatAppLog("log", "at pages/Chat/Chat.vue:613", "点击了上传文件");
|
||||||
chooseFile({
|
chooseFile({
|
||||||
count: 5,
|
count: 5,
|
||||||
type: "all",
|
type: "all",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:612", "成功了");
|
formatAppLog("log", "at pages/Chat/Chat.vue:618", "成功了");
|
||||||
fileList.value = res.tempFiles;
|
fileList.value = res.tempFiles;
|
||||||
previewFileArray.value.push(...res.tempFiles);
|
previewFileArray.value.push(...res.tempFiles);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -5848,7 +5848,7 @@ This will fail in production.`);
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:623", "选择失败:", err);
|
formatAppLog("error", "at pages/Chat/Chat.vue:629", "选择失败:", err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "选择失败",
|
title: "选择失败",
|
||||||
icon: "error"
|
icon: "error"
|
||||||
@@ -5886,13 +5886,24 @@ This will fail in production.`);
|
|||||||
const streamingMessageId = vue.ref(null);
|
const streamingMessageId = vue.ref(null);
|
||||||
const showMessageModal = vue.ref(false);
|
const showMessageModal = vue.ref(false);
|
||||||
const detailMessageContent = vue.ref("");
|
const detailMessageContent = vue.ref("");
|
||||||
|
const detailLinks = vue.ref([]);
|
||||||
|
const extractLinks = (text) => {
|
||||||
|
const regex = /https?:\/\/[^\s<>"{}|\\^`[\]]+/gi;
|
||||||
|
const matches = text.match(regex);
|
||||||
|
return matches ? [...new Set(matches)] : [];
|
||||||
|
};
|
||||||
const showMessageDetail = (message) => {
|
const showMessageDetail = (message) => {
|
||||||
detailMessageContent.value = message.content || "";
|
detailMessageContent.value = message.content || "";
|
||||||
|
detailLinks.value = extractLinks(detailMessageContent.value);
|
||||||
showMessageModal.value = true;
|
showMessageModal.value = true;
|
||||||
};
|
};
|
||||||
const closeMessageDetail = () => {
|
const closeMessageDetail = () => {
|
||||||
showMessageModal.value = false;
|
showMessageModal.value = false;
|
||||||
detailMessageContent.value = "";
|
detailMessageContent.value = "";
|
||||||
|
detailLinks.value = [];
|
||||||
|
};
|
||||||
|
const openLink = (url) => {
|
||||||
|
plus.runtime.openURL(url);
|
||||||
};
|
};
|
||||||
const sendMessage = async () => {
|
const sendMessage = async () => {
|
||||||
const message = textMessage.value.trim();
|
const message = textMessage.value.trim();
|
||||||
@@ -5914,7 +5925,7 @@ This will fail in production.`);
|
|||||||
previewFileArray.value = [];
|
previewFileArray.value = [];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:704", "文件上传失败:", err);
|
formatAppLog("error", "at pages/Chat/Chat.vue:726", "文件上传失败:", err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "文件上传失败,请重试",
|
title: "文件上传失败,请重试",
|
||||||
icon: "error"
|
icon: "error"
|
||||||
@@ -6048,15 +6059,15 @@ This will fail in production.`);
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const stopConversation = async () => {
|
const stopConversation = async () => {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:873", "中断对话 - 当前会话ID:", currentSessionId.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:895", "中断对话 - 当前会话ID:", currentSessionId.value);
|
||||||
try {
|
try {
|
||||||
await socketStore.send({
|
await socketStore.send({
|
||||||
type: "stop",
|
type: "stop",
|
||||||
conversation_id: currentSessionId.value
|
conversation_id: currentSessionId.value
|
||||||
});
|
});
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:879", "中断指令已发送成功");
|
formatAppLog("log", "at pages/Chat/Chat.vue:901", "中断指令已发送成功");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:881", "中断指令发送失败:", err);
|
formatAppLog("error", "at pages/Chat/Chat.vue:903", "中断指令发送失败:", err);
|
||||||
}
|
}
|
||||||
if (streamingMessageId.value) {
|
if (streamingMessageId.value) {
|
||||||
allmessages.value = allmessages.value.filter((m) => m._id !== streamingMessageId.value);
|
allmessages.value = allmessages.value.filter((m) => m._id !== streamingMessageId.value);
|
||||||
@@ -6074,9 +6085,9 @@ This will fail in production.`);
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
vue.watch(() => socketStore.isThinking, (newVal, oldVal) => {
|
vue.watch(() => socketStore.isThinking, (newVal, oldVal) => {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:905", "isThinking 变化:", oldVal, "→", newVal, "messageString:", socketStore.messageString);
|
formatAppLog("log", "at pages/Chat/Chat.vue:927", "isThinking 变化:", oldVal, "→", newVal, "messageString:", socketStore.messageString);
|
||||||
if (!oldVal && newVal) {
|
if (!oldVal && newVal) {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:908", "AI开始回复(跨设备同步),锁定输入框");
|
formatAppLog("log", "at pages/Chat/Chat.vue:930", "AI开始回复(跨设备同步),锁定输入框");
|
||||||
isThinking.value = true;
|
isThinking.value = true;
|
||||||
if (!streamingMessageId.value) {
|
if (!streamingMessageId.value) {
|
||||||
streamingMessageId.value = "streaming-" + Date.now();
|
streamingMessageId.value = "streaming-" + Date.now();
|
||||||
@@ -6090,7 +6101,7 @@ This will fail in production.`);
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (oldVal && !newVal) {
|
if (oldVal && !newVal) {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:924", "AI回复结束(正常/中断),解锁并刷新消息列表");
|
formatAppLog("log", "at pages/Chat/Chat.vue:946", "AI回复结束(正常/中断),解锁并刷新消息列表");
|
||||||
if (streamingMessageId.value) {
|
if (streamingMessageId.value) {
|
||||||
allmessages.value = allmessages.value.filter((m) => m._id !== streamingMessageId.value);
|
allmessages.value = allmessages.value.filter((m) => m._id !== streamingMessageId.value);
|
||||||
streamingMessageId.value = null;
|
streamingMessageId.value = null;
|
||||||
@@ -6142,15 +6153,15 @@ This will fail in production.`);
|
|||||||
UserData.value = await getUserInfo(userToken.value);
|
UserData.value = await getUserInfo(userToken.value);
|
||||||
UserId.value = UserData.value._id;
|
UserId.value = UserData.value._id;
|
||||||
UserAvatar.value = UserData.value.avatar || "";
|
UserAvatar.value = UserData.value.avatar || "";
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:988", "用户信息已加载:", UserId.value, UserAvatar.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1010", "用户信息已加载:", UserId.value, UserAvatar.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:990", "获取用户信息失败:", error);
|
formatAppLog("error", "at pages/Chat/Chat.vue:1012", "获取用户信息失败:", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const takeUserConversations = async () => {
|
const takeUserConversations = async () => {
|
||||||
try {
|
try {
|
||||||
userToken.value = getToken();
|
userToken.value = getToken();
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:998", "token:", userToken.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1020", "token:", userToken.value);
|
||||||
UserConversations.value = await getUserConversations(userToken.value) || [];
|
UserConversations.value = await getUserConversations(userToken.value) || [];
|
||||||
const savedSessionId = getCurrentSessionId();
|
const savedSessionId = getCurrentSessionId();
|
||||||
if (savedSessionId && UserConversations.value.some((c) => c._id === savedSessionId)) {
|
if (savedSessionId && UserConversations.value.some((c) => c._id === savedSessionId)) {
|
||||||
@@ -6160,7 +6171,7 @@ This will fail in production.`);
|
|||||||
} else {
|
} else {
|
||||||
currentSessionId.value = "";
|
currentSessionId.value = "";
|
||||||
}
|
}
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1010", "保存会话id:", currentSessionId.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1032", "保存会话id:", currentSessionId.value);
|
||||||
uni.setStorageSync("currentSessionId", currentSessionId.value);
|
uni.setStorageSync("currentSessionId", currentSessionId.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -6172,17 +6183,17 @@ This will fail in production.`);
|
|||||||
const FriendInfoList = vue.ref([]);
|
const FriendInfoList = vue.ref([]);
|
||||||
const takeFriendList = async () => {
|
const takeFriendList = async () => {
|
||||||
try {
|
try {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1025", "开始获取好友列表");
|
formatAppLog("log", "at pages/Chat/Chat.vue:1047", "开始获取好友列表");
|
||||||
const friendList = await getChatFriend(UserId.value);
|
const friendList = await getChatFriend(UserId.value);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1028", "friendList:", friendList);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1050", "friendList:", friendList);
|
||||||
if (friendList && friendList.length) {
|
if (friendList && friendList.length) {
|
||||||
FriendInfoList.value = await takeUserAvatar(friendList);
|
FriendInfoList.value = await takeUserAvatar(friendList);
|
||||||
} else {
|
} else {
|
||||||
FriendInfoList.value = [];
|
FriendInfoList.value = [];
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1033", "好友列表为空");
|
formatAppLog("log", "at pages/Chat/Chat.vue:1055", "好友列表为空");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:1036", "获取好友列表失败:", error);
|
formatAppLog("error", "at pages/Chat/Chat.vue:1058", "获取好友列表失败:", error);
|
||||||
FriendInfoList.value = [];
|
FriendInfoList.value = [];
|
||||||
} finally {
|
} finally {
|
||||||
UserConversations.value = FriendInfoList.value;
|
UserConversations.value = FriendInfoList.value;
|
||||||
@@ -6209,17 +6220,17 @@ This will fail in production.`);
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:1066", "获取好友头像失败", err);
|
formatAppLog("error", "at pages/Chat/Chat.vue:1088", "获取好友头像失败", err);
|
||||||
return friendList;
|
return friendList;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const GroupList = vue.ref([]);
|
const GroupList = vue.ref([]);
|
||||||
const takeGroupList = async () => {
|
const takeGroupList = async () => {
|
||||||
try {
|
try {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1076", "开始获取群聊列表");
|
formatAppLog("log", "at pages/Chat/Chat.vue:1098", "开始获取群聊列表");
|
||||||
GroupList.value = await getGroup(UserId.value);
|
GroupList.value = await getGroup(UserId.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:1081", "获取群聊列表失败:", error);
|
formatAppLog("error", "at pages/Chat/Chat.vue:1103", "获取群聊列表失败:", error);
|
||||||
GroupList.value = [];
|
GroupList.value = [];
|
||||||
} finally {
|
} finally {
|
||||||
UserConversations.value = GroupList.value;
|
UserConversations.value = GroupList.value;
|
||||||
@@ -6231,22 +6242,22 @@ This will fail in production.`);
|
|||||||
return [];
|
return [];
|
||||||
try {
|
try {
|
||||||
const memberIds = memberList.map((item) => item.groupContactId);
|
const memberIds = memberList.map((item) => item.groupContactId);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1095", "请求头像的ID列表:", memberIds);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1117", "请求头像的ID列表:", memberIds);
|
||||||
const memberAvatarList = await getUserAvatar(userToken.value, memberIds);
|
const memberAvatarList = await getUserAvatar(userToken.value, memberIds);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1097", "头像接口返回数据:", memberAvatarList);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1119", "头像接口返回数据:", memberAvatarList);
|
||||||
const userMap = new Map(memberAvatarList.map((user) => [user.user_id, user]) || []);
|
const userMap = new Map(memberAvatarList.map((user) => [user.user_id, user]) || []);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1100", "userMap的keys:", Array.from(userMap.keys()));
|
formatAppLog("log", "at pages/Chat/Chat.vue:1122", "userMap的keys:", Array.from(userMap.keys()));
|
||||||
return memberList.map((member) => {
|
return memberList.map((member) => {
|
||||||
const memberId = member.groupContactId;
|
const memberId = member.groupContactId;
|
||||||
const userInfo = userMap.get(memberId);
|
const userInfo = userMap.get(memberId);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1105", `查找 ${memberId} 的头像:`, userInfo);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1127", `查找 ${memberId} 的头像:`, userInfo);
|
||||||
return {
|
return {
|
||||||
...member,
|
...member,
|
||||||
avatar: (userInfo == null ? void 0 : userInfo.avatar) || null
|
avatar: (userInfo == null ? void 0 : userInfo.avatar) || null
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
formatAppLog("error", "at pages/Chat/Chat.vue:1112", "获取群成员头像失败", err);
|
formatAppLog("error", "at pages/Chat/Chat.vue:1134", "获取群成员头像失败", err);
|
||||||
return memberList;
|
return memberList;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -6278,7 +6289,7 @@ This will fail in production.`);
|
|||||||
const takeFriendMessages = async () => {
|
const takeFriendMessages = async () => {
|
||||||
try {
|
try {
|
||||||
allmessages.value = await getFriendMessages(currentSessionId.value) || [];
|
allmessages.value = await getFriendMessages(currentSessionId.value) || [];
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1159", "好友消息:", JSON.stringify(allmessages.value));
|
formatAppLog("log", "at pages/Chat/Chat.vue:1181", "好友消息:", JSON.stringify(allmessages.value));
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -6290,12 +6301,12 @@ This will fail in production.`);
|
|||||||
const takeGroupMessages = async () => {
|
const takeGroupMessages = async () => {
|
||||||
try {
|
try {
|
||||||
allmessages.value = await getGroupMessages(currentSessionId.value) || [];
|
allmessages.value = await getGroupMessages(currentSessionId.value) || [];
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1172", "群聊消息:", allmessages.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1194", "群聊消息:", allmessages.value);
|
||||||
const memberList = await getGroupMemberList(currentSessionId.value);
|
const memberList = await getGroupMemberList(currentSessionId.value);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1175", "获取到的群成员列表:", memberList);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1197", "获取到的群成员列表:", memberList);
|
||||||
if (memberList && memberList.length) {
|
if (memberList && memberList.length) {
|
||||||
groupMemberList.value = await takeGroupMemberAvatar(memberList);
|
groupMemberList.value = await takeGroupMemberAvatar(memberList);
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1178", "群成员列表(带头像):", groupMemberList.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1200", "群成员列表(带头像):", groupMemberList.value);
|
||||||
} else {
|
} else {
|
||||||
groupMemberList.value = [];
|
groupMemberList.value = [];
|
||||||
}
|
}
|
||||||
@@ -6317,9 +6328,9 @@ This will fail in production.`);
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
vue.watch(() => friendSocketStore.MessageReceived, (newId) => {
|
vue.watch(() => friendSocketStore.MessageReceived, (newId) => {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1223", "收到了好友消息");
|
formatAppLog("log", "at pages/Chat/Chat.vue:1245", "收到了好友消息");
|
||||||
if (newId) {
|
if (newId) {
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1225", "ChatType:", ChatType.value);
|
formatAppLog("log", "at pages/Chat/Chat.vue:1247", "ChatType:", ChatType.value);
|
||||||
switch (ChatType.value) {
|
switch (ChatType.value) {
|
||||||
case 0:
|
case 0:
|
||||||
takeConversationMessages();
|
takeConversationMessages();
|
||||||
@@ -6334,7 +6345,7 @@ This will fail in production.`);
|
|||||||
friendSocketStore.MessageReceived = false;
|
friendSocketStore.MessageReceived = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
formatAppLog("log", "at pages/Chat/Chat.vue:1241", "default 分支");
|
formatAppLog("log", "at pages/Chat/Chat.vue:1263", "default 分支");
|
||||||
friendSocketStore.MessageReceived = false;
|
friendSocketStore.MessageReceived = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -6396,7 +6407,7 @@ This will fail in production.`);
|
|||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
socketStore.disconnect();
|
socketStore.disconnect();
|
||||||
});
|
});
|
||||||
const __returned__ = { friendSocketStore, handleFriendConnect, socketStore, ChatType, convertMarkdownTable, renderTable, pareseMarkdown, sanitizeContent, previewImage, openFile, formatFileSize, parseFileInfo, selectNormalChat, showNewChatModal, closeNewChatModal, isChatSidebar, handleChatSidebar, goWorkSpace, goCloudDatabase, logOut, previewFileArray, uploadPhoto, deleteImage, fileList, uploadFile, handleConnect, isThinking, isSelfSent, isUploading, uploadedFiles, streamingMessageId, showMessageModal, detailMessageContent, showMessageDetail, closeMessageDetail, sendMessage, sendFriendMessage, sendGroupMessage, sendAIMessage, stopConversation, textMessage, UserConversations, currentSessionId, userToken, UserId, UserAvatar, UserData, takeUserInfo, takeUserConversations, FriendInfoList, takeFriendList, takeTalkUserAvatar, takeUserAvatar, GroupList, takeGroupList, groupMemberList, takeGroupMemberAvatar, getGroupMemberAvatarById, allmessages, scrollToView, bottomToggle, isLoadingMore, currentPage, currentMessages, takeConversationMessages, takeFriendMessages, takeGroupMessages, onScroll, scrollToBottom, computed: vue.computed, getCurrentInstance: vue.getCurrentInstance, nextTick: vue.nextTick, onMounted: vue.onMounted, ref: vue.ref, watch: vue.watch, get onShow() {
|
const __returned__ = { friendSocketStore, handleFriendConnect, socketStore, ChatType, convertMarkdownTable, renderTable, pareseMarkdown, sanitizeContent, previewImage, openFile, formatFileSize, parseFileInfo, selectNormalChat, showNewChatModal, closeNewChatModal, isChatSidebar, handleChatSidebar, goWorkSpace, goCloudDatabase, logOut, previewFileArray, uploadPhoto, deleteImage, fileList, uploadFile, handleConnect, isThinking, isSelfSent, isUploading, uploadedFiles, streamingMessageId, showMessageModal, detailMessageContent, detailLinks, extractLinks, showMessageDetail, closeMessageDetail, openLink, sendMessage, sendFriendMessage, sendGroupMessage, sendAIMessage, stopConversation, textMessage, UserConversations, currentSessionId, userToken, UserId, UserAvatar, UserData, takeUserInfo, takeUserConversations, FriendInfoList, takeFriendList, takeTalkUserAvatar, takeUserAvatar, GroupList, takeGroupList, groupMemberList, takeGroupMemberAvatar, getGroupMemberAvatarById, allmessages, scrollToView, bottomToggle, isLoadingMore, currentPage, currentMessages, takeConversationMessages, takeFriendMessages, takeGroupMessages, onScroll, scrollToBottom, computed: vue.computed, getCurrentInstance: vue.getCurrentInstance, nextTick: vue.nextTick, onMounted: vue.onMounted, ref: vue.ref, watch: vue.watch, get onShow() {
|
||||||
return onShow;
|
return onShow;
|
||||||
}, get onUnload() {
|
}, get onUnload() {
|
||||||
return onUnload;
|
return onUnload;
|
||||||
@@ -6551,7 +6562,40 @@ This will fail in production.`);
|
|||||||
vue.toDisplayString($setup.detailMessageContent),
|
vue.toDisplayString($setup.detailMessageContent),
|
||||||
1
|
1
|
||||||
/* TEXT */
|
/* TEXT */
|
||||||
)
|
),
|
||||||
|
$setup.detailLinks.length ? (vue.openBlock(), vue.createElementBlock("view", {
|
||||||
|
key: 0,
|
||||||
|
class: "detail-links-section"
|
||||||
|
}, [
|
||||||
|
vue.createElementVNode(
|
||||||
|
"view",
|
||||||
|
{ class: "detail-links-title" },
|
||||||
|
"链接 (" + vue.toDisplayString($setup.detailLinks.length) + ")",
|
||||||
|
1
|
||||||
|
/* TEXT */
|
||||||
|
),
|
||||||
|
(vue.openBlock(true), vue.createElementBlock(
|
||||||
|
vue.Fragment,
|
||||||
|
null,
|
||||||
|
vue.renderList($setup.detailLinks, (link, i) => {
|
||||||
|
return vue.openBlock(), vue.createElementBlock("view", {
|
||||||
|
key: i,
|
||||||
|
class: "detail-link-item",
|
||||||
|
onClick: ($event) => $setup.openLink(link)
|
||||||
|
}, [
|
||||||
|
vue.createElementVNode(
|
||||||
|
"text",
|
||||||
|
{ class: "link-text" },
|
||||||
|
vue.toDisplayString(link),
|
||||||
|
1
|
||||||
|
/* TEXT */
|
||||||
|
)
|
||||||
|
], 8, ["onClick"]);
|
||||||
|
}),
|
||||||
|
128
|
||||||
|
/* KEYED_FRAGMENT */
|
||||||
|
))
|
||||||
|
])) : vue.createCommentVNode("v-if", true)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])) : vue.createCommentVNode("v-if", true),
|
])) : vue.createCommentVNode("v-if", true),
|
||||||
|
|||||||
23
unpackage/dist/dev/app-plus/pages/Chat/Chat.css
vendored
23
unpackage/dist/dev/app-plus/pages/Chat/Chat.css
vendored
@@ -1716,4 +1716,27 @@ to { opacity: 1; transform: translateY(0);
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
/* 消息详情弹窗 — 链接提取区域 */
|
||||||
|
.detail-links-section {
|
||||||
|
margin-top: 0.75rem;
|
||||||
|
padding-top: 0.75rem;
|
||||||
|
border-top: 0.03125rem solid #eee;
|
||||||
|
}
|
||||||
|
.detail-links-title {
|
||||||
|
font-size: 0.9375rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
.detail-link-item {
|
||||||
|
padding: 0.5rem 0.625rem;
|
||||||
|
background: #f5f7fa;
|
||||||
|
border-radius: 0.375rem;
|
||||||
|
margin-bottom: 0.375rem;
|
||||||
|
}
|
||||||
|
.link-text {
|
||||||
|
font-size: 0.875rem;
|
||||||
|
color: #007aff;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user