|
|
@ -18,8 +18,8 @@ export default { |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
if (option) { |
|
|
if (option) { |
|
|
// this.url = decodeURIComponent(option.url) |
|
|
// this.url = decodeURIComponent(option.url) |
|
|
this.url = option.url |
|
|
|
|
|
this.params = option.params? JSON.parse(option.params) : '' |
|
|
|
|
|
|
|
|
this.url = option.url |
|
|
|
|
|
this.params = option.params ? JSON.parse(option.params) : '' |
|
|
console.log('params', option.params) |
|
|
console.log('params', option.params) |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -35,6 +35,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
makeSocket({ pageInfo: 'page-view', retry: true }).then((res) => { |
|
|
makeSocket({ pageInfo: 'page-view', retry: true }).then((res) => { |
|
|
|
|
|
this.destroySocket() |
|
|
this.socket = res |
|
|
this.socket = res |
|
|
this.socket.onMessage(this.getMessage) |
|
|
this.socket.onMessage(this.getMessage) |
|
|
}) |
|
|
}) |
|
|
@ -70,9 +71,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
destroyed() { |
|
|
destroyed() { |
|
|
this.destroySocket() |
|
|
this.destroySocket() |
|
|
}, |
|
|
|
|
|
onHide() { |
|
|
|
|
|
this.destroySocket() |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
// onHide() { |
|
|
|
|
|
// this.destroySocket() |
|
|
|
|
|
// } |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |