diff --git a/src/channel/bubbleMsgUtils.js b/src/channel/bubbleMsgUtils.js index 9ff593b..a4ad17d 100644 --- a/src/channel/bubbleMsgUtils.js +++ b/src/channel/bubbleMsgUtils.js @@ -651,7 +651,7 @@ export const parseRenderMessageItem = (msg) => { customer_name: msg?.customerProfile?.name || '', whatsapp_name: msg?.customerProfile?.name || '', whatsapp_phone_number: isEmpty(msg?.customerProfile) ? msg.to : msg.from, - whatsapp_msg_type: msg.msg_source==='WABA' ? msg.type : '', + whatsapp_msg_type: (msg.msg_source || 'WABA') === 'WABA' ? msg.type : '', // 1.0接口没有msg_source statusCN: msgStatusRenderMappedCN[msg?.status || 'failed'], statusTitle: msgStatusRenderMappedCN[msg?.status || 'failed'], replyButton: ['text', 'document', 'image', 'email'].includes(msg.type) && (msg?.status || '') !== 'failed', @@ -671,6 +671,7 @@ export const parseRenderMessageItem = (msg) => { }, origin: msg.context, }), + msg_source: msg.msg_source, }; }; /** diff --git a/src/views/Conversations/Online/Components/BubbleIM.jsx b/src/views/Conversations/Online/Components/BubbleIM.jsx index 46fd9e0..5b9492c 100644 --- a/src/views/Conversations/Online/Components/BubbleIM.jsx +++ b/src/views/Conversations/Online/Components/BubbleIM.jsx @@ -17,7 +17,7 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s setNewChatModalVisible(true); setNewChatFormValues((prev) => ({ ...prev, phone_number: wa_id, name: wa_name })); }; - const RenderText = memo(function renderText({ str, className, template }) { + const RenderText = memo(function renderText({ str, className, template, message }) { let headerObj, footerObj, buttonsArr; if (!isEmpty(template) && !isEmpty(template.components)) { const componentsObj = groupBy(template.components, (item) => item.type); @@ -43,6 +43,8 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s } return prev; }, []); + + const receivedMsgFooter = message.sender === 'me' ? '' : WABAccountsMapped[message.msgOrigin.to]?.verifiedName; return ( {headerObj ? ( @@ -62,19 +64,25 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s {part.key} - ); + ) } else if (part.type === 'number') { return ( openNewChatModal({ wa_id: part.key, wa_name: part.key })}> {part.key} - ); + ) } else { // if (part.type === 'emoji') - return part.key; + return part.key } })} {footerObj ?
{footerObj.text}
: null} + {receivedMsgFooter ? ( +
+ + {receivedMsgFooter} +
+ ) : null} {buttonsArr && buttonsArr.length > 0 ? (
{buttonsArr.map((btn, index) => @@ -90,12 +98,12 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s - ) + ), )}
) : null}
- ); + ) }); return ( handlePreview(message)} onTitleClick={() => handlePreview(message)} // title={
{message.title}
} - text={} + text={} replyButton={['text', 'document', 'image'].includes(message.whatsapp_msg_type)} {...(message.sender === 'me' ? { @@ -117,7 +125,7 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s title: <> {WABAccountsMapped[message.from]?.verifiedName}, } : { - title: <>  {message.title}, + // title: <>  {message.title}, })} className={[ 'whitespace-pre-wrap', diff --git a/src/views/Conversations/Online/Components/ChannelLogo.jsx b/src/views/Conversations/Online/Components/ChannelLogo.jsx index 0b9cfb2..ff3c24d 100644 --- a/src/views/Conversations/Online/Components/ChannelLogo.jsx +++ b/src/views/Conversations/Online/Components/ChannelLogo.jsx @@ -2,7 +2,7 @@ import React, { } from 'react'; import { WhatsAppOutlined, MailOutlined } from '@ant-design/icons'; import { WABIcon, } from '@/components/Icons'; -const ChannelLogo = ({channel}) => { +const ChannelLogo = ({channel, className, ...props}) => { // if is array, get last if (Array.isArray(channel)) { channel = channel[channel.length - 1]; @@ -10,14 +10,14 @@ const ChannelLogo = ({channel}) => { const _channel = (channel || '').toLowerCase(); switch (_channel) { case 'waba': - return ; + return ; case 'wa': - return ; + return ; case 'email': - return + return default: - // return - return ; + // return + return ; } } export default ChannelLogo;