skyblued 2 lat temu
rodzic
commit
2267a6cf78

+ 16 - 37
colexiu-report.html

@@ -38,54 +38,33 @@
         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: 'setRequestedOrientation',
-      content: {
-        orientation: 0
-      }
-    })
-    // 安卓的状态栏
-    _postMessage({
-      api: 'setStatusBarVisibility',
-      content: {
-        isVisibility: 0
-      }
-    })
-    _postMessage({
-      api: 'setTitleBarVisibility',
-      content: {
-        status: 0
-      }
-    })
   </script>
   <style>
-    #lottieWeb {
+    #lottieWebWrap{
       position: fixed;
+      top: 0;
+      left: 0;
+      width: 100vw;
+      height: 100vh;
+      display: flex;
+      justify-content: center;
+      align-items: center;
       z-index: 100;
-      top: 50%;
-      left: 50%;
-      width: 100Px;
-      height: 100Px;
-      transform: translate(-50%, -50%);
       pointer-events: none;
       transition: opacity .3s;
     }
+    #lottieWeb {
+      width: 100Px;
+      height: 100Px;
+    }
   </style>
 </head>
 
 <body>
   <div id="app"></div>
-  <div id="lottieWeb"></div>
+  <div id="lottieWebWrap">
+    <div id="lottieWeb"></div>
+  </div>
   <script>
     lottie.loadAnimation({
       container: document.getElementById('lottieWeb'),
@@ -97,7 +76,7 @@
       path: '/orchestra-music-score/loading.json'
     });
     window.addEventListener('load', function () {
-      const loadingEle = document.getElementById('lottieWeb')
+      const loadingEle = document.getElementById('lottieWebWrap')
       loadingEle.style.opacity = '0'
       setTimeout(() => {
         loadingEle.style.display = 'none'

+ 15 - 1
src/subpages/colexiu-report/index.tsx

@@ -24,7 +24,7 @@ import { getLeveByScoreMeasure } from '/src/pages/detail/evaluating/helper'
 import { Button, Skeleton } from 'vant'
 import Empty from '/src/components/empty'
 import { useSpecialShapedScreen } from '../colexiu/uses/use-app'
-import { promisefiyPostMessage } from '/src/helpers/native-message'
+import { postMessage, promisefiyPostMessage } from '/src/helpers/native-message'
 
 const search = useOriginSearch()
 
@@ -85,6 +85,19 @@ 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)
@@ -103,6 +116,7 @@ export default defineComponent({
     // useUser()
 
     useSpecialShapedScreen()
+    
 
     const getOffsetPosition = (type: keyof typeof colorsClass): string => {
       switch (type) {

+ 0 - 2
src/subpages/colexiu-report/main.ts

@@ -6,6 +6,4 @@ import '../colexiu/app.css'
 import '../../base.css'
 
 import App from './index'
-import { postMessage } from '/src/helpers/native-message'
-
 createApp(App).mount('#app')

+ 8 - 2
src/subpages/colexiu/popups/evaluating/content.tsx

@@ -129,7 +129,7 @@ export default defineComponent({
 
     const viewReport = () => {
       postMessage({
-        api: 'openAccompanyWebView',
+        api: 'openWebView',
         content: {
           url:
             location.origin +
@@ -236,7 +236,13 @@ export default defineComponent({
                     <img class={styles.btnIcon} src={iconLianxi} />
                   </Button>
                 )}
-                <Button style={{ margin: '0 4px' }} onClick={() => emit('restart')}>
+                <Button
+                  style={{ margin: '0 4px' }}
+                  onClick={() => {
+                    detailState.evaluatings = {}
+                    emit('restart')
+                  }}
+                >
                   <img class={styles.btnIcon} src={TryIcon} />
                 </Button>
                 {isUnitTest ? null : (