vr-shopxo-uniapp/pages/plugins/live/pull/pull.nvue

68 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view :class="theme_view + ' flex-row pr'" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
<view v-if="!is_live_ended" class="flex-1 pr" @dblclick="handle_double_click" @touchend="handle_touch_end" :data-ignore="false">
<live-video ref="live-video" :propSrc="live_config.pull_flv_url || 'http://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo122.m3u8'" @ended="ended"></live-video>
<!-- 简化版点赞效果组件 -->
<full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></full-screen-like-effect>
</view>
<view v-if="!is_loading" class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></live-content>
</view>
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
<view class="flex-col align-c">
<text class="live-ended-text">{{live_end_msg}}</text>
<button plain size="mini" class="mt-10 live-ended-button" @tap="live_back">
<text class="cr-f pa-5">退出直播间</text>
</button>
</view>
</view>
</view>
</template>
<script>
import liveVideo from './components/video/video.vue';
import liveContent from './components/live-content/live-content.vue';
// 引入点赞效果组件
import fullScreenLikeEffect from './components/full-screen-like-effect/full-screen-like-effect.vue';
// 引入混入公共逻辑避免nvue和vue使用同一套逻辑出现问题
import mixins from './mixins/mixins.js';
const app = getApp();
export default {
components: {
liveVideo,
liveContent,
fullScreenLikeEffect
},
mixins: [mixins],
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
}
}
}
</script>
<style lang="scss" scoped>
.live-content {
position: absolute;
top: 0;
left: 0;
z-index: 9;
width: 100%;
height: 100%;
background: transparent;
}
.live-ended {
// 添加渐变背景色
background-image: linear-gradient(to bottom,#AD18F9,#05DFC7);
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 100%;
}
.live-ended-button {
border-radius: 6px;
border-color: #fff;
}
</style>