|
|
@@ -1,9 +1,11 @@
|
|
|
<script>
|
|
|
import LiveNotice from "@/components/notcie/LiveNotice.vue";
|
|
|
+import TestSmallWin from "@/components/test-small-win/TestSmallWin.vue";
|
|
|
+// import {WebViewBridge} from "@polyv/web-view-bridge";
|
|
|
|
|
|
export default {
|
|
|
name: "LiveHeader",
|
|
|
- components: {LiveNotice},
|
|
|
+ components: {TestSmallWin, LiveNotice},
|
|
|
props: {
|
|
|
// 是否全屏
|
|
|
isFullScreen: {
|
|
|
@@ -11,6 +13,53 @@ export default {
|
|
|
default: false,
|
|
|
}
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ webviewBridge: null,
|
|
|
+ show: false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ /*this.webviewBridge = new WebViewBridge();
|
|
|
+
|
|
|
+ console.log("webviewBridge", this.webviewBridge)
|
|
|
+
|
|
|
+
|
|
|
+ //初始化
|
|
|
+ await this.webviewBridge.connectWebViewBridge();
|
|
|
+ // webview 被小窗化
|
|
|
+ this.webviewBridge.on('changeToSmall', (event) => {
|
|
|
+ console.log("event:changeToSmall:", event)
|
|
|
+ });
|
|
|
+
|
|
|
+ // webview 取消小窗化
|
|
|
+ this.webviewBridge.on('changeToNormal', (event) => {
|
|
|
+ console.log("event:changeToNormal:", event)
|
|
|
+ });
|
|
|
+
|
|
|
+ this.webviewBridge.on('callWebViewEvent', (event) => {
|
|
|
+ console.log("event:callWebViewEvent:", event)
|
|
|
+ });*/
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 进入小窗
|
|
|
+ handleSmallWindow() {
|
|
|
+ this.webviewBridge?.sendData('clickProduct', {
|
|
|
+ newPage: false,
|
|
|
+ ...{width: 375, height: 180,}
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 退出小窗
|
|
|
+ handleExitSmallWindow() {
|
|
|
+ this.webviewBridge?.sendData('changeToNormal', {});
|
|
|
+ },
|
|
|
+
|
|
|
+ // 关闭页面
|
|
|
+ handleCloseWindow() {
|
|
|
+ this.webviewBridge?.sendData('closeWindow', {});
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
headerClass() {
|
|
|
return this.isFullScreen ? 'horiz' : "vertical"
|
|
|
@@ -35,7 +84,7 @@ export default {
|
|
|
</div>
|
|
|
|
|
|
<div class="header-r">
|
|
|
- <img src="@/assets/fenestrule.png" class="header-r-icon" />
|
|
|
+ <img src="@/assets/fenestrule.png" class="header-r-icon" @click="show = true" />
|
|
|
<img src="@/assets/more.png" class="header-r-icon" />
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -47,6 +96,8 @@ export default {
|
|
|
<img src="@/assets/undulate.png" class="undulate-icon" />
|
|
|
<span>直播中</span>
|
|
|
</div>
|
|
|
+
|
|
|
+ <test-small-win :show="show"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|