|
|
|
|
@ -1,30 +1,36 @@
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { Layout, Spin, Button } from 'antd';
|
|
|
|
|
import { RightCircleOutlined, RightOutlined, ReloadOutlined, MenuFoldOutlined, MenuUnfoldOutlined, LeftOutlined } from '@ant-design/icons';
|
|
|
|
|
// import { useParams, useNavigate } from 'react-router-dom';
|
|
|
|
|
import MessagesHeader from './Conversations/Online/MessagesHeader';
|
|
|
|
|
import MessagesWrapper from './Conversations/Online/MessagesWrapper';
|
|
|
|
|
import ConversationsList from './Conversations/Online/ConversationsList';
|
|
|
|
|
import { useState } from 'react'
|
|
|
|
|
import { Layout, Empty, Button } from 'antd'
|
|
|
|
|
import { RightOutlined, LeftOutlined } from '@ant-design/icons'
|
|
|
|
|
import MessagesHeader from './Conversations/Online/MessagesHeader'
|
|
|
|
|
import MessagesWrapper from './Conversations/Online/MessagesWrapper'
|
|
|
|
|
import ConversationsList from './Conversations/Online/ConversationsList'
|
|
|
|
|
import OrderProfile from '@/components/OrderProfile'
|
|
|
|
|
import ReplyWrapper from './Conversations/Online/ReplyWrapper';
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow';
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
|
import ReplyWrapper from './Conversations/Online/ReplyWrapper'
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow'
|
|
|
|
|
|
|
|
|
|
import './Conversations/Conversations.css';
|
|
|
|
|
import EmailEditorPopup from './Conversations/Online/Input/EmailEditorPopup';
|
|
|
|
|
import ConversationBind from '@/views/Conversations/Online/ConversationBind'
|
|
|
|
|
import './Conversations/Conversations.css'
|
|
|
|
|
import EmailEditorPopup from './Conversations/Online/Input/EmailEditorPopup'
|
|
|
|
|
|
|
|
|
|
const { Sider, Content, Header, Footer } = Layout;
|
|
|
|
|
const { Sider, Content, Header, Footer } = Layout
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
const ChatWindow = () => {
|
|
|
|
|
const [collapsedRight, setCollapsedRight] = useState(true)
|
|
|
|
|
|
|
|
|
|
const [collapsedLeft, setCollapsedLeft] = useState(false);
|
|
|
|
|
const [collapsedRight, setCollapsedRight] = useState(true);
|
|
|
|
|
const loginUser = useAuthStore((state) => state.loginUser)
|
|
|
|
|
const currentOrder = useConversationStore(useShallow((state) => state.currentConversation?.coli_sn || ''))
|
|
|
|
|
const currentConversationID = useConversationStore(useShallow((state) => state.currentConversation?.sn || ''))
|
|
|
|
|
const [updateCurrentConversation] = useConversationStore((state) => [state.updateCurrentConversation])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const currentOrder = useConversationStore(useShallow(state => state.currentConversation?.coli_sn || ""));
|
|
|
|
|
const renderEmptyOrder = () => {
|
|
|
|
|
return (
|
|
|
|
|
<Empty description={<span>没有订单关联</span>}>
|
|
|
|
|
<ConversationBind currentConversationID={currentConversationID} userId={loginUser.userId} onBoundSuccess={(coli_sn) => updateCurrentConversation({ coli_sn })} />
|
|
|
|
|
</Empty>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
@ -54,7 +60,7 @@ const ChatWindow = () => {
|
|
|
|
|
{/* <Button type='text' icon={<ReloadOutlined />} onClick={() => setCollapsedRight(!collapsedRight)} className='' title='最新消息记录' /> */}
|
|
|
|
|
<Button type='text' icon={collapsedRight ? <RightOutlined /> : <LeftOutlined />} onClick={() => setCollapsedRight(!collapsedRight)} className=' rounded-none rounded-r' />
|
|
|
|
|
</Header>
|
|
|
|
|
<Content className="flex-grow bg-whatsapp-bg relative" >
|
|
|
|
|
<Content className='flex-grow bg-whatsapp-bg relative'>
|
|
|
|
|
<MessagesWrapper />
|
|
|
|
|
</Content>
|
|
|
|
|
<Footer className='ant-layout-sider-light p-0'>
|
|
|
|
|
@ -75,12 +81,12 @@ const ChatWindow = () => {
|
|
|
|
|
collapsedWidth={0}
|
|
|
|
|
trigger={null}
|
|
|
|
|
collapsed={collapsedRight}>
|
|
|
|
|
<OrderProfile coliSN={currentOrder} />
|
|
|
|
|
<OrderProfile coliSN={currentOrder} renderEmpty={renderEmptyOrder} />
|
|
|
|
|
</Sider>
|
|
|
|
|
</Layout>
|
|
|
|
|
<EmailEditorPopup key='email-editor-online' />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ChatWindow;
|
|
|
|
|
export default ChatWindow
|
|
|
|
|
|