diff --git a/src/channel/bubbleMsgUtils.js b/src/channel/bubbleMsgUtils.js index 647cad0..4ce7cb3 100644 --- a/src/channel/bubbleMsgUtils.js +++ b/src/channel/bubbleMsgUtils.js @@ -369,7 +369,7 @@ const whatsappMsgMapped = { ...msgcontent, ...parseRenderMessageItem(msgcontent), id: msgcontent.wamid, - status: msgStatusRenderMapped[msgcontent?.status || 'failed'], + status: msgcontent.msg_direction === 'outbound' ? msgStatusRenderMapped[msgcontent?.status || 'failed'] : '', sender: msgcontent.msg_direction === 'outbound' ? 'me' : msgcontent?.customerProfile?.name || '', dateString: msgcontent.status === 'failed' ? `发送失败 ❌` : '', }), diff --git a/src/views/Conversations/Online/Input/ComposerTools.jsx b/src/views/Conversations/Online/Input/ComposerTools.jsx index 0216085..a2002ba 100644 --- a/src/views/Conversations/Online/Input/ComposerTools.jsx +++ b/src/views/Conversations/Online/Input/ComposerTools.jsx @@ -17,7 +17,7 @@ const ComposerTools = ({ channel, invokeSendUploadMessage, invokeSendMessage, in return ( <> - {['waba'].includes(channel) && } + {['waba', 'wai'].includes(channel) && } diff --git a/src/views/Conversations/Online/Input/Template.jsx b/src/views/Conversations/Online/Input/Template.jsx index 124960a..8120d09 100644 --- a/src/views/Conversations/Online/Input/Template.jsx +++ b/src/views/Conversations/Online/Input/Template.jsx @@ -160,7 +160,7 @@ const CategoryList = ({ dataSource, handleSendTemplate, valueMapped, onInput, ac ) } -const InputTemplate = ({ disabled = false, invokeSendMessage }) => { +const InputTemplate = ({ disabled = false, invokeSendMessage, channel }) => { const [mobile] = useStyleStore((state) => [state.mobile]); const searchInputRef = useRef(null); @@ -240,6 +240,10 @@ const InputTemplate = ({ disabled = false, invokeSendMessage }) => { }, template_origin: fromTemplate, }; + const plainTextMsgObj = { + type: 'text', + text: msgObj.template.components.map((citem) => citem.text).join(''), + }; if (valid !== true) { notification.warning({ message: '提示', @@ -250,7 +254,7 @@ const InputTemplate = ({ disabled = false, invokeSendMessage }) => { }); return false; } - invokeSendMessage(msgObj); + invokeSendMessage(channel === 'waba' ? msgObj : plainTextMsgObj); setOpenTemplates(false); setActiveInput({}); }; @@ -314,7 +318,7 @@ const InputTemplate = ({ disabled = false, invokeSendMessage }) => { ...(Object.keys(templateLangMapped).map(lang => ({ key: lang, label: lang.toUpperCase(), children: }))) - ]} defaultActiveKey='utility' tabBarExtraContent={{right: , }} size='small' /> + ]} defaultActiveKey='utility' tabBarExtraContent={{right: , }} size='small' /> ) : ( // Search result