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

174 lines
6.7 KiB
Vue
Raw Normal View History

2025-10-27 10:38:30 +00:00
<template>
2026-01-06 07:18:26 +00:00
<view :class="theme_view + ' pr'">
<view class="pr live-bg" @click="handle_click" @touchend="handle_touch_end" :data-ignore="false">
2026-01-07 03:41:31 +00:00
<component-live-video v-if="!is_live_ended" ref="liveVideo" :propSrc="live_video_src || 'https://live-pull-all.shopxo.vip/68f764013572f9240ca7ce6c/shopxo.m3u8'" @ended="ended" @loadedmetadata="loadedmetadata" @mutedAutoPlaySuccess="muted_auto_play_success" @mutedTap="muted_tap"></component-live-video>
2025-12-02 09:11:52 +00:00
<!-- 简化版点赞效果组件 -->
2025-12-15 08:33:12 +00:00
<component-full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs"></component-full-screen-like-effect>
2025-11-25 02:30:43 +00:00
</view>
2025-12-10 03:12:31 +00:00
<template v-if="!is_loading">
<view class="live-content pointer-events-none">
2026-01-06 07:35:47 +00:00
<component-live-content ref="liveContent" :propWindowWidth="windowWidth" :propWindowHeight="windowHeight" :propLiveData="live_data" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @liveStatus="socket_live_status"></component-live-content>
2025-12-10 02:01:58 +00:00
</view>
2025-12-10 03:12:31 +00:00
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c">
<view class="flex-col align-c">
2025-12-10 09:42:47 +00:00
<text class="live-ended-text">直播已结束</text>
2025-12-10 03:12:31 +00:00
<button plain size="mini" class="mt-10 live-ended-button" @tap.stop="live_back">
<text class="cr-f pa-5">退出直播间</text>
</button>
</view>
</view>
2025-12-10 03:12:31 +00:00
<!-- 静音提示 -->
2026-01-06 05:45:38 +00:00
<view v-if="!is_live_ended && is_muted_auto_play_success && !live_be_right_back_error" class="live-muted flex-row align-c jc-c pointer-events-none">
2025-12-17 02:52:54 +00:00
<view class="live-muted-tips pointer-events-auto">
2025-12-10 03:12:31 +00:00
因浏览器限制静音<text class="ml-5 cr-f live-muted-text" @tap="muted_tap"></text>
</view>
</view>
2026-01-08 02:01:05 +00:00
<!-- 视频播放提示 -->
2026-01-08 02:32:43 +00:00
<view v-if="!is_live_ended && is_muted_auto_play_error && !live_be_right_back_error" class="live-play flex-row align-c jc-c pointer-events-none">
2026-01-08 03:38:53 +00:00
<component-icon propName="bofang" class="component-icon-play" propSize="200rpx" propColor="#fff" @click="muted_tap"></component-icon>
2026-01-08 02:01:05 +00:00
</view>
2025-12-10 09:42:47 +00:00
<!-- 主播暂时离开的提示信息-->
2025-12-15 07:25:15 +00:00
<view v-if="live_be_right_back_error" class="live-pause flex-row align-c jc-c pointer-events-none">
2025-12-15 08:33:12 +00:00
<view class="flex-1 flex-col align-c jc-c">
2026-01-06 05:45:38 +00:00
<component-icon propName="coffee" propSize="100rpx" propColor="#fff"></component-icon>
2025-12-17 02:52:54 +00:00
<text class="text-size mt-5 cr-white">主播暂时离开</text>
<text class="text-size-sm mt-5 cr-white">休息片刻更多精彩马上到来</text>
2025-12-15 08:33:12 +00:00
</view>
2025-12-10 09:42:47 +00:00
</view>
2025-12-10 03:12:31 +00:00
</template>
2025-10-27 10:38:30 +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-10-27 13:29:50 +00:00
const app = getApp();
export default {
2025-11-24 07:26:22 +00:00
components: {
2025-12-15 08:33:12 +00:00
componentLiveVideo,
componentLiveContent,
componentIcon,
componentFullScreenLikeEffect
2025-11-24 07:26:22 +00:00
},
2025-11-27 10:11:14 +00:00
mixins: [mixins],
2025-10-27 13:29:50 +00:00
data() {
return {
2025-11-27 10:11:14 +00:00
theme_view: app.globalData.get_theme_value_view(),
is_muted_auto_play_success: false,
2026-01-08 02:01:05 +00:00
is_muted_auto_play_error: false,
2025-12-15 07:25:15 +00:00
initial_reminder: false
}
},
methods: {
2026-01-08 02:01:05 +00:00
muted_auto_play_success(is_muted) {
if (is_muted) {
this.is_muted_auto_play_success = true;
}
},
muted_auto_play_error() {
this.is_muted_auto_play_error = true;
},
// 静音提示点击
muted_tap() {
2025-12-10 09:42:47 +00:00
if (this.$refs.liveVideo) {
this.$refs.liveVideo.muted_tap();
}
// 关闭静音提示
this.is_muted_auto_play_success = false;
2026-01-08 02:01:05 +00:00
// 关闭播放按钮
this.is_muted_auto_play_error = false;
2025-10-27 13:29:50 +00:00
}
2025-10-27 10:38:30 +00:00
},
}
</script>
2025-11-28 09:20:46 +00:00
<style lang="scss" scoped>
2025-11-28 10:19:51 +00:00
.live-bg {
background-image: linear-gradient(to bottom,#ba623c,#14766a);
2026-01-06 07:18:26 +00:00
width: 100%;
2025-12-10 09:42:47 +00:00
height: 100vh;
2025-11-28 10:19:51 +00:00
}
2025-11-26 03:14:15 +00:00
.live-content {
position: absolute;
top: 0;
left: 0;
2025-12-15 07:25:15 +00:00
z-index: 9;
2025-11-26 03:14:15 +00:00
width: 100%;
height: 100%;
}
2025-12-10 09:42:47 +00:00
.live-pause {
position: absolute;
top: 0;
2025-12-15 07:25:15 +00:00
left: 0;
z-index: 8;
2025-12-10 09:42:47 +00:00
width: 100%;
2025-12-15 07:25:15 +00:00
height: 100%;
2025-12-15 08:33:12 +00:00
background: linear-gradient(to bottom, #330066, #000000);
2025-12-10 09:42:47 +00:00
}
.live-muted {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
2025-12-10 02:01:58 +00:00
z-index: 11;
width: 100%;
height: 100%;
.live-muted-tips {
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
padding: 15rpx 20rpx;
font-size: 32rpx;
color: #fff;
}
.live-muted-text {
color: rgba(210,27,70,1);
padding-bottom: 4rpx;
font-size:16px;
}
.live-muted-text:hover {
color: rgba(210,27,70,1);
border-bottom: 1px solid rgba(210,27,70,1);
}
}
2026-01-08 02:32:43 +00:00
.live-play {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 11;
width: 100%;
height: 100%;
2026-01-08 03:56:58 +00:00
background: rgba(0, 0, 0, 0.1);
2026-01-08 03:38:53 +00:00
.component-icon-play {
2026-01-08 02:32:43 +00:00
height: 200rpx;
width: 200rpx;
font-size: 200rpx !important;
color: inherit !important;
background: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
}
2025-11-28 08:01:50 +00:00
.live-ended {
2025-12-26 09:26:37 +00:00
background: 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-11-28 09:20:46 +00:00
.live-ended-text {
color:#fff;
font-size:16px;
2025-11-28 09:20:46 +00:00
}
2025-11-28 08:01:50 +00:00
}
2025-12-01 10:25:01 +00:00
.live-ended-button {
border-radius: 6px;
border-color: #fff;
}
2025-10-27 10:38:30 +00:00
</style>