|
@@ -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)
|
|
|
// })
|
|
|
|