订单号传参

dev/chat
Lei OT 2 years ago
parent f6bc762413
commit bd4b864518

@ -1,10 +1,12 @@
import { useEffect } from 'react';
import { Layout, Spin } from 'antd';
import { useParams, useNavigate } from 'react-router-dom';
import MessagesHeader from './Components/MessagesHeader';
import Messages from './Components/Messages';
import InputComposer from './Components/InputComposer';
import ConversationsList from './Components/ConversationsList';
import CustomerProfile from './Components/CustomerProfile';
import { useConversationState, useConversationDispatch } from '@/stores/ConversationContext';
import './Conversations.css';
@ -15,6 +17,8 @@ const { Sider, Content, Header, Footer } = Layout;
*/
const ChatWindow = () => {
console.log('chat window;;;;;;;;;;;;;;;;;;;;;;;;');
const { order_sn } = useParams();
const { currentConversation } = useConversationState();
useEffect(() => {
console.log('chat window 222;;;;;;;;;;;;;;;;;;;;;;;;');
@ -46,7 +50,7 @@ const ChatWindow = () => {
</Content>
<Sider width={300} theme={'light'} className='h-full overflow-y-auto' style={{ maxHeight: 'calc(100vh - 198px)', height: 'calc(100vh - 198px)' }}>
<CustomerProfile />
<CustomerProfile colisn={currentConversation.coli_sn ?? order_sn} />
</Sider>
</Layout>
</Spin>

@ -22,7 +22,8 @@ const CDropdown = () => {
const { currentConversation } = useConversationState();
const dispatch = useConversationDispatch();
const handleConversationItemClose = async (item) => {
await fetchConversationItemClose({ conversationid: item.sn, opisn: userId });
console.log('invoke close', {conversationid: item.sn, opisn: userId });
// await fetchConversationItemClose({ conversationid: item.sn, opisn: userId });
dispatch(delConversationitem(item));
};
return (
@ -89,7 +90,9 @@ const Conversations = () => {
useEffect(() => {
if (order_sn) {
getCustomerProfile(order_sn);
// getCustomerProfile(order_sn);
// reset chat window
dispatch(setCurrentConversation({ sn: '', customer_name: '', coli_sn: order_sn }));
}
return () => {};

@ -21,7 +21,8 @@ const orderStatus = [
const { Meta } = Card;
const CustomerProfile = (() => {
const CustomerProfile = (({ colisn }) => {
console.log('invoke customer profile+++++++++++++++++++++++++++++++++++++++++++++', colisn);
const { customerOrderProfile: orderInfo } = useConversationState();
const { loginUser: currentUser } = useAuthContext();
const { quotes, contact, last_contact, ...order } = orderInfo;

Loading…
Cancel
Save