skyblued 2 years ago
parent
commit
ab9329e80b
1 changed files with 11 additions and 2 deletions
  1. 11 2
      src/views/coursewarePlay/index.tsx

+ 11 - 2
src/views/coursewarePlay/index.tsx

@@ -1,5 +1,5 @@
 import { Icon, Swipe, SwipeItem, Tab, Tabs } from 'vant'
-import { defineComponent, onMounted, reactive, nextTick } 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'
@@ -53,9 +53,18 @@ export default defineComponent({
     onMounted(() => {
       getDetail()
     })
+    // 返回
     const goback = () => {
-      history.go(-1)
+      postMessage({ api: 'back' })
     }
+    onUnmounted(() => {
+      postMessage({
+        api: 'setRequestedOrientation',
+        content:{
+          orientation: 1
+        }
+      })
+    })
     return () => (
       <div class={styles.coursewarePlay}>
         <div class={styles.backBtn} onClick={() => goback()}>