Fix:3648 【商城小程序】进入客服会话页面并返回后,再次进入未显示消息数据

This commit is contained in:
linxi
2025-04-21 14:32:36 +08:00
parent 19632a69ad
commit 3c86c4561a
+9 -4
View File
@@ -132,13 +132,19 @@ export default {
this.token = uni.getStorageSync("login_status");
this.userInfo = uni.getStorageSync("userInfo");
this.uid = this.userInfo.uid
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
this.connectSocketInit()
},
onHide() {
onShow() {
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
this.connectSocketInit();
},
onUnload() {
if (this.socketOpen) {
this.socketTask.close();
}
uni.onSocketClose(res => {
console.log('WebSocket 已关闭!', res);
});
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
},
methods: {
@@ -247,7 +253,6 @@ export default {
console.log('WebSocket连接已打开!', res);
this.socketOpen = true;
this.createRoom();
});
uni.onSocketError(err => {