diff --git a/src/lib/msgUtils.js b/src/lib/msgUtils.js index ce52875..cf98c69 100644 --- a/src/lib/msgUtils.js +++ b/src/lib/msgUtils.js @@ -379,7 +379,8 @@ export const whatsappMsgTypeMapped = { meetingID: msg.wamid, title: msg.contacts.length === 1 ? `联系人` : `${msg.contacts.length} 位联系人`, text: msg.contacts.map((ele) => `${(ele?.org?.company || '') +' '+ele.name.formatted_name}: ${ele.phones[0].wa_id || ele.phones[0].phone}`).join('\n'), - data: msg.contacts.map((ele) => ({ id: ele.phones[0]?.wa_id || ele.phones[0].phone, wa_id: ele.phones[0]?.wa_id || ele.phones[0].phone, name: (ele?.org?.company || '') +' '+ele.name.formatted_name })), + data: msg.contacts.map((ele) => ({ id: ele.phones[0]?.wa_id || ele.phones[0].phone, wa_id: ele.phones[0]?.wa_id || '', phone: ele.phones[0].phone, name: (ele?.org?.company || '') +' '+ele.name.formatted_name })), + waBtn: msg.contacts.some(ele => ele.phones.some(p => p.wa_id)), }), renderForReply: (msg) => ({ id: msg.wamid, diff --git a/src/views/Conversations/Components/MessagesList.jsx b/src/views/Conversations/Components/MessagesList.jsx index 8a48e9b..cac27f0 100644 --- a/src/views/Conversations/Components/MessagesList.jsx +++ b/src/views/Conversations/Components/MessagesList.jsx @@ -73,9 +73,15 @@ const MessagesList = ({ messages, handlePreview, reference, longListLoading, get return (
- {loadNextPage && messages.length>0 && ( + {loadNextPage && messages.length > 0 && (
- {!longListLoading ? : } + {!longListLoading ? ( + + ) : ( + + )}
)} {messages.map((message, index) => ( @@ -103,10 +109,14 @@ const MessagesList = ({ messages, handlePreview, reference, longListLoading, get {...(message.type === 'meetingLink' ? { actionButtons: [ - { - onClickButton: () => handleContactClick(message.data), - Component: () =>
发消息
, - }, + ...(message.waBtn + ? [ + { + onClickButton: () => handleContactClick(message.data), + Component: () =>
发消息
, + }, + ] + : []), { onClickButton: () => { navigator.clipboard.writeText(message.text);