no message

This commit is contained in:
wangdongbo 2026-02-09 17:32:49 +08:00
parent ab64e7c9c9
commit 56eeede97e
2 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,5 @@
MP_API_BASE_URL=https://ykt.youcan365.com
MP_CACHE_PREFIX=production
MP_WX_APP_ID=production
MP_TIM_SDK_APP_ID=1600123876
MP_WX_APP_ID=wx6ee11733526b4f04
MP_TIM_SDK_APP_ID=1600123876
MP_CORP_ID=wpLgjyawAA8N0gWmXgyJq8wpjGcOT7fg

View File

@ -314,8 +314,12 @@ const closePreview = () => {
const sendArticle = async (article) => {
try {
const { globalTimChatManager } = await import("@/utils/tim-chat.js");
if (!globalTimChatManager || !globalTimChatManager.tim || !globalTimChatManager.isLoggedIn) {
if (
!globalTimChatManager ||
!globalTimChatManager.tim ||
!globalTimChatManager.isLoggedIn
) {
uni.showToast({
title: "IM系统未就绪请重试",
icon: "none",
@ -326,9 +330,9 @@ const sendArticle = async (article) => {
// ID
const conversationID = `GROUP${pageParams.value.groupId}`;
globalTimChatManager.currentConversationID = conversationID;
console.log("发送文章会话ID:", conversationID);
//
const customMessageData = {
type: "article",
@ -337,16 +341,18 @@ const sendArticle = async (article) => {
imgUrl: article.cover || "",
desc: "点击查看详情",
};
//
const sendResult = await globalTimChatManager.sendCustomMessage(customMessageData);
const sendResult = await globalTimChatManager.sendCustomMessage(
customMessageData
);
if (sendResult && sendResult.success) {
console.log("✓ 文章消息已发送");
uni.showToast({
title: "发送成功",
icon: "success",
});
//
setTimeout(() => {
uni.navigateBack();