skyblued 2 years ago
parent
commit
c17eecad7a
2 changed files with 22 additions and 13 deletions
  1. 22 0
      colexiu-report.html
  2. 0 13
      src/subpages/colexiu-report/index.tsx

+ 22 - 0
colexiu-report.html

@@ -38,6 +38,28 @@
         document.getElementById('loading').className = ''
       }
     })
+    function _postMessage(data, callback) {
+      const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA)
+      if (instance) {
+        const uuid = '' + Date.now() + Math.floor(Math.random() * 1000000)
+        data.content = data.content ? { ...data.content, uuid } : { uuid }
+        console.log('h5发送:', JSON.stringify(data))
+        instance.postMessage(JSON.stringify(data))
+      }
+    }
+    // 安卓的状态栏
+    _postMessage({
+      api: 'setStatusBarVisibility',
+      content: {
+        isVisibility: 0,
+      },
+    })
+    _postMessage({
+      api: 'setTitleBarVisibility',
+      content: {
+        status: 0,
+      },
+    })
   </script>
   <style>
     #lottieWebWrap{

+ 0 - 13
src/subpages/colexiu-report/index.tsx

@@ -85,19 +85,6 @@ const useDetail = (id: number | string): [Ref<ShaeetStatusType>, Ref<MusicSheelD
 export default defineComponent({
   name: 'Colexiu',
   setup() {
-    // 安卓的状态栏
-    postMessage({
-      api: 'setStatusBarVisibility',
-      content: {
-        isVisibility: 0,
-      },
-    })
-    postMessage({
-      api: 'setTitleBarVisibility',
-      content: {
-        status: 0,
-      },
-    })
     const headerRef = ref()
     const renderLoading = ref(true)
     const renderError = ref(false)