|
@@ -2,20 +2,17 @@
|
|
|
import LiveInteract from "@/components/live/LiveInteract.vue";
|
|
import LiveInteract from "@/components/live/LiveInteract.vue";
|
|
|
import LiveVideo from "@/components/live-video/LiveVideo.vue";
|
|
import LiveVideo from "@/components/live-video/LiveVideo.vue";
|
|
|
import Live from "@/utils/Live";
|
|
import Live from "@/utils/Live";
|
|
|
-import {WebViewBridge} from "@polyv/web-view-bridge";
|
|
|
|
|
|
|
+import SmallWin from "@/components/small-win/SmallWin.vue";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "LiveItem",
|
|
name: "LiveItem",
|
|
|
- components: {LiveVideo, LiveInteract},
|
|
|
|
|
|
|
+ components: {SmallWin, LiveVideo, LiveInteract},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
fullScreen: false,
|
|
fullScreen: false,
|
|
|
// 直播实例
|
|
// 直播实例
|
|
|
liveInstance: null,
|
|
liveInstance: null,
|
|
|
|
|
|
|
|
- // 小窗
|
|
|
|
|
- showSmallWin: false,
|
|
|
|
|
- webviewBridge: null,
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -26,27 +23,20 @@ export default {
|
|
|
// 测试获取公告
|
|
// 测试获取公告
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- this.webviewBridge = new WebViewBridge();
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- handleClick() {
|
|
|
|
|
- console.log("测试点击")
|
|
|
|
|
- this.fullScreen = true
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
handleSmallWindow() {
|
|
handleSmallWindow() {
|
|
|
- console.log('出发')
|
|
|
|
|
- this.showSmallWin = true;
|
|
|
|
|
- this.webviewBridge?.sendData('clickProduct', {
|
|
|
|
|
- newPage: false,
|
|
|
|
|
- ...{width: 375, height: 180,}
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- handleExitSmallWindow() {
|
|
|
|
|
- this.webviewBridge?.sendData('changeToNormal', {});
|
|
|
|
|
- this.showSmallWin = false;
|
|
|
|
|
|
|
+ this.fullScreen = false;
|
|
|
|
|
+ if(this.fullScreen) {
|
|
|
|
|
+ this.fullScreen = false;
|
|
|
|
|
+ this.$refs.interact.isLandscape = false;
|
|
|
|
|
+ // 全屏下需要延迟一下
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$refs.smallWin.handleSmallWindow();
|
|
|
|
|
+ }, 300)
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.smallWin.handleSmallWindow();
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -55,12 +45,12 @@ export default {
|
|
|
<template>
|
|
<template>
|
|
|
<div class="live-item">
|
|
<div class="live-item">
|
|
|
<div class="live-video-box">
|
|
<div class="live-video-box">
|
|
|
- <div class="video-box" :class="{'full-video-box': fullScreen, 'small-win':showSmallWin}">
|
|
|
|
|
- <live-video>
|
|
|
|
|
- <div id="livePlayer"></div>
|
|
|
|
|
- </live-video>
|
|
|
|
|
-
|
|
|
|
|
- <div class="close-btn" @click="handleExitSmallWindow" v-if="showSmallWin">关闭小窗</div>
|
|
|
|
|
|
|
+ <div class="video-box" :class="{'full-video-box': fullScreen}">
|
|
|
|
|
+ <small-win ref="smallWin">
|
|
|
|
|
+ <live-video>
|
|
|
|
|
+ <div id="livePlayer"></div>
|
|
|
|
|
+ </live-video>
|
|
|
|
|
+ </small-win>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="video-tip">
|
|
<div class="video-tip">
|
|
|
市场有风险 投资需谨慎
|
|
市场有风险 投资需谨慎
|
|
@@ -69,6 +59,7 @@ export default {
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<live-interact
|
|
<live-interact
|
|
|
|
|
+ ref="interact"
|
|
|
@smallWin="handleSmallWindow"
|
|
@smallWin="handleSmallWindow"
|
|
|
:liveInstance="liveInstance"
|
|
:liveInstance="liveInstance"
|
|
|
class="interact1"
|
|
class="interact1"
|
|
@@ -135,24 +126,4 @@ export default {
|
|
|
transform: rotate(90deg);
|
|
transform: rotate(90deg);
|
|
|
background: #000000;
|
|
background: #000000;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-.small-win {
|
|
|
|
|
- position: fixed;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- z-index: 9999;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.close-btn {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- z-index: 9999;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- padding: 8px 12px;
|
|
|
|
|
- border-radius: 8px;
|
|
|
|
|
- color: #FFFFFF;
|
|
|
|
|
- background: #000000;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
</style>
|
|
</style>
|