问题修复
This commit is contained in:
@@ -174,7 +174,7 @@
|
||||
import {
|
||||
onReady,
|
||||
onReachBottom,
|
||||
onLoad,
|
||||
onLoad,onShow,
|
||||
onPageScroll,
|
||||
} from "@dcloudio/uni-app";
|
||||
import {
|
||||
@@ -243,7 +243,6 @@ chatStore.onReceiveMsg = (msg) => {
|
||||
scrollView.intoView = "msg-0";
|
||||
});
|
||||
};
|
||||
chatStore.connectSocket();
|
||||
const msg = ref("");
|
||||
|
||||
const shopInfo = uni.getStorageSync("shopInfo");
|
||||
@@ -477,6 +476,18 @@ onLoad((opt) => {
|
||||
// #endif
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
chatStore.connectSocket();
|
||||
// 确保状态监听已初始化
|
||||
if (!chatStore._listenersInitialized) {
|
||||
chatStore.initStateListeners();
|
||||
chatStore._listenersInitialized = true;
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
});
|
||||
|
||||
function toMore() {
|
||||
go.to("PAGES_CHAT_GROUP_INFO", {
|
||||
group_id: groupInfo.value.id,
|
||||
|
||||
Reference in New Issue
Block a user