Fix:3648 【商城小程序】进入客服会话页面并返回后,再次进入未显示消息数据
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user