|
|
|
@ -13,6 +13,7 @@ import emailReItem from './Components/emailRe.json';
|
|
|
|
|
import EmailEditorPopup from './Input/EmailEditorPopup';
|
|
|
|
|
import EmailDetail from './Components/EmailDetail';
|
|
|
|
|
import { useOrderStore, } from "@/stores/OrderStore";
|
|
|
|
|
import { isEmpty } from '@/utils/commons';
|
|
|
|
|
|
|
|
|
|
const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
|
|
|
|
|
const userId = useAuthStore((state) => state.loginUser.userId);
|
|
|
|
@ -27,7 +28,7 @@ const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
|
|
|
|
|
|
|
|
|
|
const refreshTotalNotify = useConversationStore(useShallow((state) => state.refreshTotalNotify));
|
|
|
|
|
|
|
|
|
|
const { orderDetail, } = useOrderStore();
|
|
|
|
|
const [orderDetail] = useOrderStore(state => [state.orderDetail]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isVisible = useVisibilityState();
|
|
|
|
@ -41,7 +42,7 @@ const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
|
|
|
|
|
}
|
|
|
|
|
setShouldScrollBottom(true);
|
|
|
|
|
return () => {};
|
|
|
|
|
}, [currentConversation.sn]);
|
|
|
|
|
}, [currentConversation.sn, orderDetail.coli_sn]);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setLongList(activeMessages);
|
|
|
|
@ -68,6 +69,7 @@ const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
|
|
|
|
|
opisn: forceGetMessages ? currentConversation.opi_sn || '' : userId,
|
|
|
|
|
whatsappid: item.whatsapp_phone_number,
|
|
|
|
|
lasttime: '',
|
|
|
|
|
coli_sn: isEmpty(currentConversation.coli_sn) ? '' : (orderDetail.coli_sn || ''), // todo: 获取到上一个
|
|
|
|
|
})
|
|
|
|
|
const thisLastTime = data.length > 0 ? data[0].msgtime : ''; // orgmsgtime
|
|
|
|
|
const loadNextPage = !(data.length === 0 || data.length < MESSAGE_PAGE_SIZE);
|
|
|
|
@ -85,6 +87,7 @@ const MessagesWrapper = ({ updateRead = true, forceGetMessages }) => {
|
|
|
|
|
opisn: currentConversation.opi_sn,
|
|
|
|
|
whatsappid: currentConversation.whatsapp_phone_number,
|
|
|
|
|
lasttime: currentConversation?.lasttime || '',
|
|
|
|
|
coli_sn: isEmpty(currentConversation.coli_sn) ? '' : (orderDetail.coli_sn || ''),
|
|
|
|
|
})
|
|
|
|
|
setLongListLoading(false);
|
|
|
|
|
setLongList(prevValue => data.concat(prevValue));
|
|
|
|
|