From 1eba78da8ca9585e583fad25e8104ab2a77d2ce3 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 10 Jan 2025 10:26:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E5=89=8D=E7=AB=AF):=20=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E7=9A=84=E6=B6=88=E6=81=AF=E6=9B=B4=E6=96=B0,=20?= =?UTF-8?q?=E6=97=A0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channel/bubbleMsgUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' ? `发送失败 ❌` : '', }), From 13d3bc13763aff602941dbb29eff9125a0f6cff9 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 10 Jan 2025 10:43:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(=E5=89=8D=E7=AB=AF):=20WhatsApp?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=A8=A1=E6=9D=BF=E6=B6=88=E6=81=AF,=20?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=8F=91=E9=80=81=E6=9C=AA=E7=BA=AF=E6=96=87?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Conversations/Online/Input/ComposerTools.jsx | 2 +- src/views/Conversations/Online/Input/Template.jsx | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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