Fix:3648 【商城小程序】进入客服会话页面并返回后,再次进入未显示消息数据
This commit is contained in:
@@ -132,13 +132,19 @@ export default {
|
|||||||
this.token = uni.getStorageSync("login_status");
|
this.token = uni.getStorageSync("login_status");
|
||||||
this.userInfo = uni.getStorageSync("userInfo");
|
this.userInfo = uni.getStorageSync("userInfo");
|
||||||
this.uid = this.userInfo.uid
|
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) {
|
if (this.socketOpen) {
|
||||||
this.socketTask.close();
|
this.socketTask.close();
|
||||||
}
|
}
|
||||||
|
uni.onSocketClose(res => {
|
||||||
|
console.log('WebSocket 已关闭!', res);
|
||||||
|
});
|
||||||
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -247,7 +253,6 @@ export default {
|
|||||||
console.log('WebSocket连接已打开!', res);
|
console.log('WebSocket连接已打开!', res);
|
||||||
this.socketOpen = true;
|
this.socketOpen = true;
|
||||||
this.createRoom();
|
this.createRoom();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
uni.onSocketError(err => {
|
uni.onSocketError(err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user