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

95 lines
4.3 KiB
Plaintext
Raw Normal View History

2025-11-26 08:51:13 +00:00
<template>
2025-11-28 10:19:51 +00:00
<view :class="theme_view + ' flex-row pr'" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
2025-12-10 09:42:47 +00:00
<view class="flex-1 pr live-bg" @dblclick="handle_double_click" @touchend="handle_touch_end" :data-ignore="false">
2025-12-17 07:07:36 +00:00
<component-live-video v-if="!is_live_ended" ref="liveVideo" :propSrc="live_video_src || 'http://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo122.m3u8'" @loadedmetadata="loadedmetadata" @ended="ended"></component-live-video>
2025-12-03 08:56:34 +00:00
<!-- 简化版点赞效果组件 -->
2025-12-17 07:07:36 +00:00
<component-full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></component-full-screen-like-effect>
2025-11-26 08:51:13 +00:00
</view>
2025-12-10 03:12:31 +00:00
<template v-if="!is_loading">
2025-12-15 08:33:12 +00:00
<!-- 主播暂时离开的提示信息-->
2025-12-17 07:07:36 +00:00
<view v-if="live_be_right_back_error" class="live-pause flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
2025-12-15 08:33:12 +00:00
<view class="flex-1 flex-col align-c jc-c">
<component-icon propName="smallbell" propSize="100rpx" propColor="#fff"></component-icon>
<text class="pointer-events-auto text-size mb-5 cr-white">主播暂时离开</text>
<text class="pointer-events-auto text-size-sm cr-white">休息片刻,更多精彩马上到来</text>
</view>
</view>
<!-- 主体内容显示 -->
2025-12-10 03:12:31 +00:00
<view class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
2025-12-17 07:07:36 +00:00
<component-live-content ref="liveContent" :propWindowWidth="windowWidth" :propWindowHeight="windowHeight" :propLiveData="live_data" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></component-live-content>
2025-12-10 02:01:58 +00:00
</view>
2025-12-15 08:33:12 +00:00
<!-- 直播间结束的显示 -->
2025-12-10 03:12:31 +00:00
<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">
2025-12-17 07:07:36 +00:00
<text class="live-ended-text cr-f">直播已结束</text>
2025-12-10 03:12:31 +00:00
<button plain size="mini" class="mt-10 live-ended-button" @tap="live_back">
<text class="cr-f pa-5">退出直播间</text>
</button>
</view>
</view>
</template>
2025-11-26 08:51:13 +00:00
</view>
</template>
<script>
2025-12-15 08:33:12 +00:00
import componentIcon from './components/icon/icon.vue';
import componentLiveVideo from './components/video/video.vue';
import componentLiveContent from './components/live-content/live-content.vue';
2025-12-01 10:25:01 +00:00
// 引入点赞效果组件
2025-12-15 08:33:12 +00:00
import componentFullScreenLikeEffect from './components/full-screen-like-effect/full-screen-like-effect.vue';
2025-11-27 10:11:14 +00:00
// 引入混入公共逻辑避免nvue和vue使用同一套逻辑出现问题
import mixins from './mixins/mixins.js';
2025-11-26 08:51:13 +00:00
const app = getApp();
export default {
components: {
2025-12-15 08:33:12 +00:00
componentIcon,
componentLiveVideo,
componentLiveContent,
componentFullScreenLikeEffect
2025-11-26 08:51:13 +00:00
},
2025-11-27 10:11:14 +00:00
mixins: [mixins],
2025-11-26 08:51:13 +00:00
data() {
return {
2025-11-27 10:11:14 +00:00
theme_view: app.globalData.get_theme_value_view(),
2025-11-26 08:51:13 +00:00
}
}
}
</script>
2025-11-28 09:20:46 +00:00
<style lang="scss" scoped>
2025-12-10 09:42:47 +00:00
.live-bg {
background-image: linear-gradient(to bottom,#ba623c,#14766a);
}
.live-pause {
position: absolute;
top: 0;
left: 0;
z-index: 9;
2025-12-26 09:26:37 +00:00
background-image: linear-gradient(to bottom, #330066, #000000);
2025-12-10 09:42:47 +00:00
}
2025-11-26 08:51:13 +00:00
.live-content {
position: absolute;
top: 0;
left: 0;
z-index: 9;
width: 100%;
height: 100%;
2025-11-28 10:19:51 +00:00
background: transparent;
2025-11-26 08:51:13 +00:00
}
2025-11-28 09:20:46 +00:00
.live-ended {
// 添加渐变背景色
background-image: linear-gradient(to bottom,#AD18F9,#05DFC7);
2025-12-10 02:01:58 +00:00
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 100%;
2025-12-17 07:07:36 +00:00
.live-ended-text {
color:#fff;
font-size:16px;
}
2025-11-28 09:20:46 +00:00
}
2025-11-28 10:19:51 +00:00
.live-ended-button {
border-radius: 6px;
border-color: #fff;
}
2025-11-26 08:51:13 +00:00
</style>