浏览代码

Merge branch 'gyt-feature-tianyong' into online

TIANYONG 1 年之前
父节点
当前提交
b2d4eaa145

+ 1 - 1
src/helpers/utils.ts

@@ -37,7 +37,7 @@ export const browser = () => {
     isTeacher: u.indexOf('ORCHESTRATEACHER') > -1,
     isStudent: u.indexOf('ORCHESTRASTUDENT') > -1,
     isSchool: u.indexOf('ORCHESTRASCHOOL') > -1,
-    iPad: u.indexOf('iPad') > -1, //是否iPad
+    iPad: (navigator.userAgent.match(/(iPad)/) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)), //是否iPad
     webApp: u.indexOf('Safari') == -1, //是否web应该程序,没有头部与底部
     weixin: u.indexOf('MicroMessenger') > -1, //是否微信 (2015-01-22新增)
     huawei: !!u.match(/huawei/i) || !!u.match(/honor/i),

+ 21 - 6
src/pages/detail/CheckDelayPopup/index.module.less

@@ -14,8 +14,8 @@
         left: -20%;
     }
     .delayPadBg {
-        width: 160%;
-        left: -30%;
+        width: 170%;
+        left: -35%;
     }
     .delayAdorn {
         position: absolute;
@@ -28,14 +28,29 @@
     .leftAdorn {
         position: fixed;
         left: 0;
-        bottom: -1px;
-        width: 1.66rem;
+        bottom: -2px;
+        width: 1.9rem;
     }
     .rightAdorn {
         position: fixed;
         right: 0;
-        bottom: -1px;
-        width: 1.28rem;
+        bottom: -2px;
+        width: 1.5rem;
+    }
+}
+
+.delayPadBg {
+    .leftAdorn {
+        position: fixed;
+        left: 0;
+        bottom: -3px;
+        width: 2.3rem;
+    }
+    .rightAdorn {
+        position: fixed;
+        right: 0;
+        bottom: -3px;
+        width: 1.8rem;
     }
 }
 

+ 8 - 2
src/subpages/colexiu/buttons/evaluating.tsx

@@ -14,7 +14,7 @@ import {
 import { browser } from '/src/helpers/utils'
 import runtime, * as RuntimeUtils from '/src/pages/detail/runtime'
 import { getBoundingBoxByverticalNote, getNoteByMeasuresSlursStart, getParentNote } from '/src/pages/detail/helpers'
-import { handleCheckEvaluatStatus, useClientType, useOriginSearch } from '../uses'
+import { handleCheckEvaluatStatus, useClientType, useOriginSearch, setWiredStatus } from '../uses'
 import { startButtonShow } from './index'
 import { getLeveByScoreMeasure } from '/src/pages/detail/evaluating/helper'
 import Evaluating, { evaluatingShow } from '../popups/evaluating'
@@ -77,7 +77,7 @@ const browserInfo = browser()
 const scoreList: any[] = []
 let calculateInfo: any = {}
 /** 延迟数据 */
-const delayData =  reactive({
+export const delayData =  reactive({
   /** 是否强制检测 */
   isForce: true,
   /** 弹窗 */
@@ -253,6 +253,12 @@ let startTuneTimer: any = null
       setTimeout(() => {
         delayData.checkStatus = 'init'
         delayData.step = 1
+        postMessage(
+          {
+            api: 'isWiredHeadsetOn',
+          },
+          setWiredStatus
+        )
       }, 500);
 			handleToggleTune('stop')
 			// this.close();

+ 12 - 5
src/subpages/colexiu/uses/use-evaluat.ts

@@ -8,6 +8,7 @@ import detailState from '/src/pages/detail/state'
 import { storeKeys } from '/src/constant/store-keys'
 import { soundEffectShow } from '../popups/sound-effect'
 import { evaluatingShow } from '../popups/evaluating'
+import { delayData } from '/src/subpages/colexiu/buttons/evaluating'
 import { Toast } from 'vant'
 
 /** 打开校音或者距离上一次校音超过一天 */
@@ -34,8 +35,9 @@ const soundNeedShow = () => {
  * 检查耳机连接状态,并且打开耳机连接状态的提示,以及校音
  * @param res IPostMessage
  */
-const setWiredStatus = (res?: IPostMessage) => {
-  if (runtime.evaluatingStatus) {
+export const setWiredStatus = (res?: IPostMessage) => {
+  console.log('检测耳机状态', res?.content)
+  if (runtime.evaluatingStatus && !delayData.open) {
     permissionPopup.active = 'earphone'
     permissionPopup.show = !res?.content.checkIsWired
     soundNeedShow()
@@ -48,13 +50,17 @@ const setWiredStatus = (res?: IPostMessage) => {
  */
 export const handleCheckEvaluatStatus = () => {
   // 是否需要效音
-  soundNeedShow()
+  // soundNeedShow()
   // 检测耳机状态
   // postMessage({ api: 'isWiredHeadsetOn' }, setWiredStatus)
   postMessage({ api: 'isWiredHeadsetOn' }, (evt) => {
     // console.log('🚀 ~ 耳机状态', evt)
-    // permissionPopup.active = 'earphone'
-    // permissionPopup.show = !evt?.content.checkIsWired
+    if (runtime.evaluatingStatus && !delayData.open) {
+      permissionPopup.active = 'earphone'
+      permissionPopup.show = !evt?.content.checkIsWired
+    } else {
+      permissionPopup.show = false
+    }
   })
 }
 
@@ -111,6 +117,7 @@ export const useWiredHeadsetCheck = () => {
   )
 
   // onMounted(() => {
+  //   console.log('检测耳机状态')
   //   listenerMessage('listenerWiredStatus', setWiredStatus)
   // })