skyblued 2 years ago
parent
commit
85f0afe70e
1 changed files with 23 additions and 8 deletions
  1. 23 8
      src/views/coursewarePlay/index.tsx

+ 23 - 8
src/views/coursewarePlay/index.tsx

@@ -1,5 +1,5 @@
 import { Icon, Swipe, SwipeItem, Tab, Tabs } from 'vant'
-import { defineComponent, onMounted, reactive, nextTick,onUnmounted } from 'vue'
+import { defineComponent, onMounted, reactive, nextTick, onUnmounted } from 'vue'
 import iconBack from './image/back.svg'
 import styles from './index.module.less'
 import Plyr from 'plyr'
@@ -12,12 +12,21 @@ import { postMessage } from '@/helpers/native-message'
 export default defineComponent({
   name: 'CoursewarePlay',
   setup() {
-    postMessage({
-      api: 'setRequestedOrientation',
-      content:{
-        orientation: 0
-      }
-    })
+    const handleInit = () => {
+      postMessage({
+        api: 'setRequestedOrientation',
+        content: {
+          orientation: 0
+        }
+      })
+      postMessage({
+        api: 'setBarStatus',
+        content: {
+          status: 0
+        }
+      })
+    }
+    handleInit()
     const route = useRoute()
     const data = reactive({
       detail: null,
@@ -60,10 +69,16 @@ export default defineComponent({
     onUnmounted(() => {
       postMessage({
         api: 'setRequestedOrientation',
-        content:{
+        content: {
           orientation: 1
         }
       })
+      postMessage({
+        api: 'setBarStatus',
+        content: {
+          status: 1
+        }
+      })
     })
     return () => (
       <div class={styles.coursewarePlay}>