diff --git a/src/components/points-and-badge/usePointsAndBadge.js b/src/components/points-and-badge/usePointsAndBadge.js index 94bd3f10..63cd6caa 100644 --- a/src/components/points-and-badge/usePointsAndBadge.js +++ b/src/components/points-and-badge/usePointsAndBadge.js @@ -45,7 +45,7 @@ const typeConfig = { }, '06': { name: 'AI问答次数徽章', - paramsKey: '', + paramsKey: 'taskId', rule: '' }, '07': { @@ -84,7 +84,7 @@ export default function usePointsAndBadge() { // 适配参数键(crsId/papersId/无参数) if (config?.paramsKey) { - if (!params) { + if (!params && type !== '06') { console.warn(`类型${type}(${config.name})需传入${config.paramsKey}参数`); complete(false, '缺少必要参数'); return; @@ -105,7 +105,23 @@ export default function usePointsAndBadge() { } console.log('调用积分接口', res); console.log('pointsRefpointsRef', pointsRef.value); - + // 06AI问答 不弹出积分窗口 + if(type=== '06'){ + if (badgesList.length > 0) { + nextTick(() => { + setTimeout(() => { + badgeRef.value.open(pointsList, badgesList, () => { + badgeRef.value.close() + complete(true, '', res); + }); + }, pop_up_time); + }); + }else{ + complete(true, '', res); + } + return + } + // 弹出积分窗口 pointsRef.value.open(res.body.points, res.body.pointsBadges, (status, pointsList, badgesList) => { pointsRef.value.close() if (badgesList.length > 0) { diff --git a/src/pages/sparring/components/question.vue b/src/pages/sparring/components/question.vue index a5e2f35c..d8835cc4 100644 --- a/src/pages/sparring/components/question.vue +++ b/src/pages/sparring/components/question.vue @@ -105,6 +105,7 @@ import { onUnload } from '@dcloudio/uni-app'; const initVoice = () => { talkVoiceObj.value = uni.createInnerAudioContext() talkVoiceObj.value.onPause(()=>{ + talkVoiceObj.value.volume = 1 }) talkVoiceObj.value.onPlay(()=>{ if(isTesting.value){ @@ -115,6 +116,7 @@ import { onUnload } from '@dcloudio/uni-app'; talkVoiceObj.value.onEnded(()=>{ emit('changePlay', '') talkVoiceObj.value.src = '' + talkVoiceObj.value.volume = 1 }) talkVoiceObj.value.onError(()=>{ talkVoiceObj.value.src = '' @@ -122,6 +124,7 @@ import { onUnload } from '@dcloudio/uni-app'; itemVoice.value = unref(dataInfo).talkingVoice talkVoiceObj.value.src = itemVoice.value isTesting.value = true + talkVoiceObj.value.volume = 0 talkVoiceObj.value.play() talkVoiceObj.value.pause() setTimeout(()=>{ diff --git a/src/pages/sparring/tip.vue b/src/pages/sparring/tip.vue index 2059550b..37ebfe54 100644 --- a/src/pages/sparring/tip.vue +++ b/src/pages/sparring/tip.vue @@ -418,6 +418,7 @@ }).then(res=>{ watchFlag.value = 1; socketStore?.closeSocket(); + changePlayItemId('') pointAndBadgesRun(talkingType.value === '01'? '07': '08', null, ()=>{ common.navigateTo('/pages/sparring/result?traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':'')) })