perf: 会话提示 perf: text消息显示客人的昵称

fix: 有会话才获取消息记录
dev/mobile
Lei OT 2 years ago
parent 642b4ec3dd
commit 27832f452b

@ -35,7 +35,7 @@ export const fetchOrderConversationsList = async (params) => {
return list;
};
export const MESSAGE_PAGE_SIZE = 100;
export const MESSAGE_PAGE_SIZE = 50;
/**
*
* @param {object} params { opisn, whatsappid, lasttime, pagesize }

@ -255,7 +255,7 @@ export const whatsappMsgTypeMapped = {
},
text: {
type: 'text',
data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg.text.body), originText: msg.text.body }),
data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg.text.body), originText: msg.text.body, title: msg?.customerProfile?.name || '' }),
renderForReply: (msg) => ({ id: msg.wamid, message: msg.text.body }),
},
image: {

@ -248,6 +248,7 @@ function ChatHistory() {
onOpen={() => handlePreview(message)}
onTitleClick={() => handlePreview(message)}
notch={false}
title={message.type === 'text' ? '' : message.title}
text={<RenderText str={message?.text || ''} />}
copiableDate={true}
dateString={message.dateString || message.localDate}

@ -82,7 +82,7 @@ const Conversations = () => {
useEffect(() => {
const messagesList = activeConversations[`${currentConversation.sn}`] || [];
if (messagesList.length < 20) {
if (currentConversation.sn && messagesList.length < 20) {
getMessages(currentConversation);
}

@ -34,14 +34,20 @@ const MessagesHeader = () => {
{/* {currentConversation.customer_name && <Avatar src={`https://api.dicebear.com/7.x/avataaars/svg?seed=${currentConversation.customer_name}`} />} */}
<Flex flex={'1'} justify='space-between'>
<Flex vertical={false} gap={12} justify='space-between'>
{currentConversation.whatsapp_phone_number ? (
{(currentConversation.coli_sn || currentConversation.sn) ? (
<>
<Typography.Text strong>{currentConversation.customer_name}</Typography.Text>
<Typography.Text>{currentConversation.whatsapp_phone_number}</Typography.Text>
{currentConversation.whatsapp_phone_number ? (
<Typography.Text>{currentConversation.whatsapp_phone_number}</Typography.Text>
) : (
<Typography.Text strong type='danger'>
没有WhatsApp号码
</Typography.Text>
)}
</>
) : (
<Typography.Text strong type='danger'>
没有WhatsApp号码
<Typography.Text strong className='text-primary'>
请选择会话
</Typography.Text>
)}
<Spin spinning={msgListLoading} />

Loading…
Cancel
Save