|
@@ -148,6 +148,10 @@ const msgRecordEvent = async (toIdValue) => {
|
|
|
pageSize: 10,
|
|
|
};
|
|
|
const resMsgData = await msgRecord(toIdValue, queryParams);
|
|
|
+ if(resMsgData.rows.length<=0){
|
|
|
+ chatRecords.data = []
|
|
|
+ return
|
|
|
+ }
|
|
|
if(resMsgData.rows[0].isRead === "N"){
|
|
|
readChat()
|
|
|
}
|
|
@@ -265,6 +269,7 @@ const changeMsg = async (val,isnew) => {
|
|
|
resInfo.showCircel = true
|
|
|
}
|
|
|
searchData.value.unshift(resInfo);
|
|
|
+ chatRecords.data = []
|
|
|
}
|
|
|
} else {
|
|
|
//为空数组的时候无需判断
|
|
@@ -453,7 +458,9 @@ const loadPreviousPage = async () => {
|
|
|
const mainContainer = document.querySelector(".right-container");
|
|
|
const newMessages = document.querySelectorAll(".message-container");
|
|
|
const firstNewMessage = newMessages[previousPageData.length];
|
|
|
- const firstNewMessageTop = mainContainer.offsetHeight + 100;
|
|
|
+ // const firstNewMessageTop = mainContainer.offsetHeight + 100;
|
|
|
+ const firstNewMessageTop = mainContainer.offsetHeight-100;
|
|
|
+ console.log('firstNewMessageTop',firstNewMessageTop);
|
|
|
mainContainer.scrollTop = firstNewMessageTop;
|
|
|
chatRecords.data;
|
|
|
//===========
|