修改页面显示处理
parent
2c237c8cc2
commit
d6ab964712
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,11 +2,11 @@
|
|||
<view :class="theme_view + ' flex-row pr'" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<view class="flex-1 pr">
|
||||
<view class="live-bg" :style="'z-index:1;width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></view>
|
||||
<live-video src="http://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo122.m3u8" @ended="ended"></live-video>
|
||||
<live-video :src="live_config?.pull_flv_url || ''" @ended="ended"></live-video>
|
||||
</view>
|
||||
<view class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<template v-if="!is_live_ended">
|
||||
<live-content @live-back="live_back"></live-content>
|
||||
<live-content :live-config="live_config" @live-back="live_back"></live-content>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="live-ended flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<view :class="theme_view + ' live-bg'">
|
||||
<view class="w h">
|
||||
<live-video src="http://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo122.m3u8" @ended="ended"></live-video>
|
||||
<live-video :src="live_config?.pull_flv_url || ''" @ended="ended"></live-video>
|
||||
</view>
|
||||
<view class="live-content">
|
||||
<template v-if="!is_live_ended">
|
||||
<live-content @live-back="live_back"></live-content>
|
||||
<live-content :live-config="live_config" @live-back="live_back"></live-content>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="live-ended flex-row align-c jc-c">
|
||||
|
|
|
|||
Loading…
Reference in New Issue