todo: 切换会话的订单

dev/emitter
Lei OT 10 months ago
parent 68e46c8ba7
commit a9724d0982

@ -76,12 +76,13 @@ export const fetchOrderConversationsList = async (params) => {
export const MESSAGE_PAGE_SIZE = 50;
/**
*
* @param {object} params { opisn, whatsappid, conversationid, lasttime, pagesize }
* @param {object} params { coli_sn, opisn, whatsappid, conversationid, lasttime, pagesize }
*/
export const fetchMessages = async (params) => {
const defaultParams = {
// opisn: '',
// whatsappid: '',
coli_sn: '',
conversationid: '',
lasttime: '',
pagesize: MESSAGE_PAGE_SIZE,

@ -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));

Loading…
Cancel
Save