diff --git a/pages/plugins/live/detail/components/live-content/live-content.vue b/pages/plugins/live/detail/components/live-content/live-content.vue index 3f11654a..6769d99e 100644 --- a/pages/plugins/live/detail/components/live-content/live-content.vue +++ b/pages/plugins/live/detail/components/live-content/live-content.vue @@ -411,19 +411,19 @@ deep: true }, }, - /** - * 组件挂载后执行初始化操作 - */ - onShow() { - // 初始化窗口信息和滚动条高度 - this.init_window_info(); - // 滚动到评论区底部 - this.scroll_to_lower(); - // 获取用户信息 - // this.init_user_info(); - // 创建监听事件 - this.bind_keyboard_listener(); - }, + // /** + // * 组件挂载后执行初始化操作 + // */ + // onShow() { + // // 初始化窗口信息和滚动条高度 + // this.init_window_info(); + // // 滚动到评论区底部 + // this.scroll_to_lower(); + // // 获取用户信息 + // // this.init_user_info(); + // // 创建监听事件 + // this.bind_keyboard_listener(); + // }, /** * 组件销毁前清理资源 */ diff --git a/pages/plugins/live/detail/mixins/mixins.js b/pages/plugins/live/detail/mixins/mixins.js index b151c166..7ab9d91e 100644 --- a/pages/plugins/live/detail/mixins/mixins.js +++ b/pages/plugins/live/detail/mixins/mixins.js @@ -158,25 +158,26 @@ export default { // 隐藏加载提示 uni.hideLoading(); } - //#ifndef H5 - // 确保每次重新显示都触发组件中的初始化方法 - this.liveContentTimer = setInterval(() => { - if (this.$refs.liveContent) { - const content = this.$refs.liveContent; + + // 确保每次重新显示都触发组件中的初始化方法 + this.liveContentTimer = setInterval(() => { + if (this.$refs.liveContent) { + const content = this.$refs.liveContent; + //#ifndef H5 // 链接socket content.socket_connect(); - // 初始化头部信息 - content.init_window_info(); - // 滚动到消息底部 - content.scroll_to_lower(); - // 绑定键盘事件 - content.bind_keyboard_listener(); - // 执行成功后取消定时任务 - clearInterval(this.liveContentTimer); - this.liveContentTimer = null; - } - }, 200); - //#endif + //#endif + // 初始化头部信息 + content.init_window_info(); + // 滚动到消息底部 + content.scroll_to_lower(); + // 绑定键盘事件 + content.bind_keyboard_listener(); + // 执行成功后取消定时任务 + clearInterval(this.liveContentTimer); + this.liveContentTimer = null; + } + }, 200); }, fail: (err) => { // 隐藏加载提示