订单进入会话的切换;

暂不做沟通记录
dev/chat
Lei OT 1 year ago
parent a3a57847ec
commit 2dbcf78252

@ -137,7 +137,8 @@ export const useConversations = ({loginUser, realtimeAPI}) => {
// Get customer profile when switching conversation
useEffect(() => {
console.log('currentConversation', currentConversation);
setMessages([...(activeConversations[currentID] || [])]);
setCurrentID(currentConversation.sn);
setMessages([...(activeConversations[currentConversation.sn] || [])]);
return () => {};
}, [currentConversation]);

@ -68,11 +68,10 @@ const ChatWindow = (() => {
<InputBox onSend={(v) => sendMessage(v)} />
</Footer>
</Layout>
{/* <InputBox onSend={(v) => sendMessage(v)} /> */}
</Content>
<Sider width={300} theme={'light'} className='h-full overflow-y-auto' style={{ maxHeight: 'calc(100vh - 198px)', height: 'calc(100vh - 198px)' }}>
<CustomerProfile customer={{}} />
<CustomerProfile />
</Sider>
</Layout>
</Spin>

@ -16,7 +16,7 @@ const Conversations = (() => {
setChatlist(
(conversationsList || []).map((item) => ({
...item,
avatar: `https://api.dicebear.com/7.x/avataaars/svg?seed=${item.whatsapp_name}`,
avatar: `https://api.dicebear.com/7.x/avataaars/svg?seed=${item.whatsapp_name.trim() || item.whatsapp_phone_number}`,
id: item.sn,
alt: item.whatsapp_name,
title: item.whatsapp_name.trim() || item.whatsapp_phone_number,

@ -42,7 +42,7 @@ const CustomerProfile = (({ customer }) => {
<Typography.Text strong >{contact?.[0]?.name}</Typography.Text>
{contact?.[0]?.phone && <Typography.Text ><PhoneOutlined className=' pr-1' />{contact?.[0]?.phone}</Typography.Text>}
{contact?.[0]?.email && <Typography.Text ><MailOutlined className=' pr-1' />{contact?.[0]?.email}</Typography.Text>}
<Typography.Text ><WhatsAppOutlined className='pr-1 text-whatsapp' />{contact?.[0]?.whatsapp_phone_number}</Typography.Text>
{contact?.[0]?.whatsapp_phone_number && <Typography.Text ><WhatsAppOutlined className='pr-1 text-whatsapp' />{contact?.[0]?.whatsapp_phone_number}</Typography.Text>}
{/* <div>{order?.order_no}</div> */}
{/* <div>
{order?.location} <span>{order?.local_datetime}</span>
@ -59,11 +59,11 @@ const CustomerProfile = (({ customer }) => {
<QuotesHistory />
</Flex>
</Flex>
<pre className='p-2 overflow-auto max-h-32 m-0' dangerouslySetInnerHTML={{__html: order?.order_detail}}></pre>
<Flex vertical={true} className='p-2 '>
<pre className='p-2 overflow-auto max-h-72 m-0' dangerouslySetInnerHTML={{__html: order?.order_detail}}></pre>
{/* <Flex vertical={true} className='p-2 '>
<Typography.Text strong>沟通记录</Typography.Text>
<Table size={'small'} columns={[{ title: '进程', dataIndex: 'title' }, { title: '状态', dataIndex: 'title2' },]} />
</Flex>
</Flex> */}
</div>
);
});

Loading…
Cancel
Save