diff --git a/.env.development b/.env.development index 1af6108b..ee2d52e3 100644 --- a/.env.development +++ b/.env.development @@ -4,15 +4,13 @@ ENV = 'development' -VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' +#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' -#VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' - +VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' -# VITE_APP_BASE_API_Url = 'http://192.168.247.200' # VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001' -# VITE_APP_BASE_API_Url = 'http://192.168.108.129' + # dev # DEV diff --git a/src/components/examination/question.vue b/src/components/examination/question.vue index a9ab2d4a..fe340a49 100644 --- a/src/components/examination/question.vue +++ b/src/components/examination/question.vue @@ -169,7 +169,7 @@ setTimeout(() => { textShow.value = true; textLoading.value = false; - }, 500); + }, 400); } else { textShow.value = false; } @@ -222,7 +222,7 @@ console.log('加载声音', props.dataInfo); if (newVal === '' && props.dataInfo.ossKey) { // 去下载oss内容 - console.log('真下载oss内容'); + console.log('真下载oss内容', props.dataInfo.ossKey); downloadFile(props.dataInfo.ossKey).then((res) => { voiceTime.value = ''; innerAudio.setAudioSrc(res.tempFilePath); @@ -236,6 +236,22 @@ }, { immediate: true } ); + watch( + () => props.dataInfo.ossKey, + (newVal) => { + if (props.dataInfo.voicePath === undefined && props.dataInfo.ossKey) { + console.log('真下载oss内容', props.dataInfo.ossKey); + downloadFile(props.dataInfo.ossKey).then((res) => { + voiceTime.value = ''; + props.dataInfo.voicePath = res.tempFilePath; + innerAudio.setAudioSrc(res.tempFilePath); + }); + } else if (newVal === undefined) { + innerAudio.stopAudio(); + } + }, + { immediate: true } + ); }); onUnload(() => { // 1. 停止当前播放(优先处理,避免音频继续播放) diff --git a/src/components/touch-btn/style/popup.scss b/src/components/touch-btn/style/popup.scss index e21164c4..94b35bc4 100644 --- a/src/components/touch-btn/style/popup.scss +++ b/src/components/touch-btn/style/popup.scss @@ -61,6 +61,7 @@ .circle-bg-box { animation: moveBottomOut 0.3s ease-out forwards; } + } // 仅语音 &.voice-only { @@ -143,6 +144,10 @@ visibility: visible; // 激活后可见 animation: fadeIn 0.4s ease-out 0.1s forwards; } + // 仅文字模式,隐藏发送原语音按钮 + &.text-only>.trans-btn{ + visibility: hidden; + } .transVoiceIng { width: 154rpx; height: 154rpx; diff --git a/src/components/touch-btn/touch-btn.images.ts b/src/components/touch-btn/touch-btn.images.ts index c6f901a8..d59e587e 100644 --- a/src/components/touch-btn/touch-btn.images.ts +++ b/src/components/touch-btn/touch-btn.images.ts @@ -17,7 +17,7 @@ export const icKeyboardSvg = () : string => { }; export const iconMicSvg = () : string => { const svgXml = ` - + `; return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgXml)}`; }; diff --git a/src/components/touch-btn/touch-btn.types.ts b/src/components/touch-btn/touch-btn.types.ts index 7db8a762..71878349 100644 --- a/src/components/touch-btn/touch-btn.types.ts +++ b/src/components/touch-btn/touch-btn.types.ts @@ -44,7 +44,7 @@ export type TouchBtnEmits = { * @param voiceData - 语音相关数据(包含ossKey、识别文本等核心字段) * @param duration - 录音时长(单位:毫秒),用于校验最短录音时长 */ - submitVoice: [params: { ossKey: string; text: string }]; + submitVoice: [params: { ossKey: string; text: string, recordId:string }]; /** * 提交文字答案(用户确认识别结果/手动编辑后触发) * @param answerText - 最终提交的文字答案内容 diff --git a/src/components/touch-btn/touch-btn.vue b/src/components/touch-btn/touch-btn.vue index cfd17f89..22fae1b3 100644 --- a/src/components/touch-btn/touch-btn.vue +++ b/src/components/touch-btn/touch-btn.vue @@ -1,52 +1,84 @@ \ No newline at end of file + diff --git a/src/pages/practice/index.vue b/src/pages/practice/index.vue index f3f1ab39..c5b40cdd 100644 --- a/src/pages/practice/index.vue +++ b/src/pages/practice/index.vue @@ -67,7 +67,7 @@ - + /> --> + { + const topic = topicList[questionNumber.value]; + console.log('录音组件提交中转圈', topic.es_status); + if (topic.es_status === '00') return; + topic.es_status = '00'; // 00转圈 + } + // 新录音组件语音提交 + const submitVoice = (voiceObj) => { + console.log('新录音组件语音提交'); + const topic = topicList[questionNumber.value]; + touchBtnRef.value?.clearInputText(); // 清除发送框数据 + const _content = voiceObj.text; + if (_content === '') { + topic.es_status = ''; // 取消转圈 + return common.msg('未识别到文字'); + } else { + topic.es_status = '02'; + topic.my_answer = { + anserResult: _content, + ossKey: voiceObj.ossKey + }; + } + + } // 录音组件提交 const touchBtnSubmit = (type, submitObj) => { const topic = topicList[questionNumber.value];