diff --git a/pkg_common/views/room.vue b/pkg_common/views/room.vue index 9238697..622d043 100644 --- a/pkg_common/views/room.vue +++ b/pkg_common/views/room.vue @@ -147,6 +147,15 @@ export default { }); uni.setStorageSync(this.merName+this.uid+this.storeId, this.content) }, + onHide() { + if (this.socketOpen) { + this.socketTask.close(); + } + uni.onSocketClose(res => { + console.log('WebSocket 已关闭!', res); + }); + uni.setStorageSync(this.merName+this.uid+this.storeId, this.content) + }, methods: { toGoods(item) { console.log(item);