diff --git a/src/pages/sparring/components/question.vue b/src/pages/sparring/components/question.vue index b482c506..22453bcb 100644 --- a/src/pages/sparring/components/question.vue +++ b/src/pages/sparring/components/question.vue @@ -169,18 +169,27 @@ } const isTesting = ref(false) const setVoiceTime = (sum) => { - let _sum = sum + 1 - if (Math.ceil(talkUserVoiceObj.value.duration) > 0) { - voiceTime.value = (Math.ceil(talkUserVoiceObj.value.duration) || 1) + 's' - } else { - if (_sum === 25) { - voiceTime.value = (props.dataInfo.voiceTime|| 1) + 's' - return + plus.io.getAudioInfo({ + filePath: unref(dataInfo).talkingVoice, + success:(res)=>{ + voiceTime.value = (Math.floor(res.duration) || 1) + 's' + }, + fail:(res)=>{ + voiceTime.value = (props.dataInfo.voiceTime || 1) + 's' } - setTimeout(() => { - setVoiceTime(_sum) - }, 200) - } + }) + // let _sum = sum + 1 + // if (Math.ceil(talkUserVoiceObj.value.duration) > 0) { + // voiceTime.value = (Math.ceil(talkUserVoiceObj.value.duration) || 1) + 's' + // } else { + // if (_sum === 25) { + // voiceTime.value = (props.dataInfo.voiceTime|| 1) + 's' + // return + // } + // setTimeout(() => { + // setVoiceTime(_sum) + // }, 200) + // } } watch(() => props.dataInfo, () => {}, { deep: true, diff --git a/src/pages/sparring/components/touchBtn.vue b/src/pages/sparring/components/touchBtn.vue index 5b6baf85..67c69a9d 100644 --- a/src/pages/sparring/components/touchBtn.vue +++ b/src/pages/sparring/components/touchBtn.vue @@ -293,7 +293,6 @@ let _res = await getPermission() console.log(2, '取到权限结果:', _res) if (_res) { - hasPermission.value = true setTimeout(() => { if (!isGettingPermission.value) { showOverlayTalking(obj); @@ -327,6 +326,7 @@ return false } else { // isGettingPermission.value = false + hasPermission.value = true return true } } else { diff --git a/src/pages/sparring/index.vue b/src/pages/sparring/index.vue index b478978f..6219a38a 100644 --- a/src/pages/sparring/index.vue +++ b/src/pages/sparring/index.vue @@ -642,8 +642,9 @@ text-align: center; background-color: #06f; height: 60rpx; - line-height: 58rpx; - border: 1rpx solid #06f; + line-height: 56rpx; + border: 2rpx solid #06f; + box-sizing: border-box; padding: 0 40rpx; color: #fff; border-radius: 8rpx;