From d6ab9647128459718a8191a765f4b0768f9ba588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Mon, 1 Dec 2025 09:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/live-content/live-content.vue | 2 +- pages/plugins/live/pull/mixins/mixins.js | 31 ++++++++++++++++++- pages/plugins/live/pull/pull.nvue | 4 +-- pages/plugins/live/pull/pull.vue | 4 +-- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/pages/plugins/live/pull/components/live-content/live-content.vue b/pages/plugins/live/pull/components/live-content/live-content.vue index 18bf8b29..f7b02f38 100644 --- a/pages/plugins/live/pull/components/live-content/live-content.vue +++ b/pages/plugins/live/pull/components/live-content/live-content.vue @@ -279,7 +279,7 @@ handler(new_value) { if (new_value.data != null) { // 获取配置信息 - this.live_data = new_value.data; + this.live_data = new_value; } }, immediate: true, diff --git a/pages/plugins/live/pull/mixins/mixins.js b/pages/plugins/live/pull/mixins/mixins.js index b68025a5..ee7774a0 100644 --- a/pages/plugins/live/pull/mixins/mixins.js +++ b/pages/plugins/live/pull/mixins/mixins.js @@ -1,10 +1,12 @@ const app = getApp(); +import { isEmpty } from '@/common/js/common/common.js'; export default { data() { return { windowWidth: 0, windowHeight: 0, - is_live_ended: false + is_live_ended: false, + live_config: {}, } }, onLoad(params) { @@ -33,6 +35,33 @@ export default { }, live_back() { app.globalData.page_back_prev_event(); + }, + init() { + uni.showLoading({ + title: '加载中...', + mask: true + }); + uni.request({ + url: app.globalData.get_request_url('index,room,live'), + method: 'POST', + data: {}, + dataType: 'json', + success: (res) => { + is_loading.value = false; + uni.hideLoading(); + const new_data = res.data; + // 获取直播间信息 + this.live_config = new_data.data || {}; + // 如果不存在拉流地址则认为直播已结束,避免因为报错导致的页面异常 + if (isEmpty(new_data.data.pull_flv_url)) { + this.is_live_ended = true; + } + }, + fail: (err) => { + is_loading.value = false; + uni.hideLoading(); + } + }); } } } \ No newline at end of file diff --git a/pages/plugins/live/pull/pull.nvue b/pages/plugins/live/pull/pull.nvue index c966c177..482ae6ad 100644 --- a/pages/plugins/live/pull/pull.nvue +++ b/pages/plugins/live/pull/pull.nvue @@ -2,11 +2,11 @@ - +