|
@@ -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,8 @@ const soundNeedShow = () => {
|
|
|
* 检查耳机连接状态,并且打开耳机连接状态的提示,以及校音
|
|
|
* @param res IPostMessage
|
|
|
*/
|
|
|
-const setWiredStatus = (res?: IPostMessage) => {
|
|
|
- if (runtime.evaluatingStatus) {
|
|
|
+export const setWiredStatus = (res?: IPostMessage) => {
|
|
|
+ if (runtime.evaluatingStatus && !delayData.open) {
|
|
|
permissionPopup.active = 'earphone'
|
|
|
permissionPopup.show = !res?.content.checkIsWired
|
|
|
soundNeedShow()
|
|
@@ -53,8 +54,8 @@ export const handleCheckEvaluatStatus = () => {
|
|
|
// postMessage({ api: 'isWiredHeadsetOn' }, setWiredStatus)
|
|
|
postMessage({ api: 'isWiredHeadsetOn' }, (evt) => {
|
|
|
// console.log('🚀 ~ 耳机状态', evt)
|
|
|
- // permissionPopup.active = 'earphone'
|
|
|
- // permissionPopup.show = !evt?.content.checkIsWired
|
|
|
+ permissionPopup.active = 'earphone'
|
|
|
+ permissionPopup.show = !evt?.content.checkIsWired
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -110,13 +111,13 @@ export const useWiredHeadsetCheck = () => {
|
|
|
}
|
|
|
)
|
|
|
|
|
|
- // onMounted(() => {
|
|
|
- // listenerMessage('listenerWiredStatus', setWiredStatus)
|
|
|
- // })
|
|
|
+ onMounted(() => {
|
|
|
+ listenerMessage('listenerWiredStatus', setWiredStatus)
|
|
|
+ })
|
|
|
|
|
|
- // onBeforeUnmount(() => {
|
|
|
- // removeListenerMessage('listenerWiredStatus', setWiredStatus)
|
|
|
- // })
|
|
|
+ onBeforeUnmount(() => {
|
|
|
+ removeListenerMessage('listenerWiredStatus', setWiredStatus)
|
|
|
+ })
|
|
|
|
|
|
return [wiredStatus]
|
|
|
}
|