From 1a94e26b77207e44ba84bf730acb401608e78590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 22 Sep 2025 13:51:22 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix=EF=BC=9B=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 +++-- src/components/file-preview/file-preview.vue | 8 ++++++-- src/pages/index/dialog.vue | 3 ++- src/pages/index/preview.vue | 15 ++++++++------- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.env.development b/.env.development index 0ca35a60..583a07ea 100644 --- a/.env.development +++ b/.env.development @@ -11,14 +11,15 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' # app入口 -#VITE_APP_BASE_API_Url = 'http://25.16.122.65:7001' +# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' # VITE_APP_BASE_API_Url = 'http://25.16.122.92:9786' # VITE_APP_BASE_API_Url = 'http://25.18.122.66:9786' # h5专用地址x2 # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' -# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.21:9786' +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' +# VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' diff --git a/src/components/file-preview/file-preview.vue b/src/components/file-preview/file-preview.vue index 021e2f00..d4db2703 100644 --- a/src/components/file-preview/file-preview.vue +++ b/src/components/file-preview/file-preview.vue @@ -14,12 +14,14 @@ diff --git a/src/composables/useUpdateAvatar.js b/src/composables/useUpdateAvatar.js new file mode 100644 index 00000000..d1f55e48 --- /dev/null +++ b/src/composables/useUpdateAvatar.js @@ -0,0 +1,83 @@ +import { + reactive, + ref, + computed, + nextTick +} from 'vue'; +import { + uploadFile +} from '@/api/common'; +import { + queryCurrentUser +} from '@/api/login.js'; +import common from '@/common/common'; +import { + updateDfSysUserExtandInfoImageAddr +} from '@/api/user.js'; + +export default function useUpdateAvatar({ + success = () => {} +}) { + const avatarCropperUrl = ref(''); + const avatarCropperStatus = ref(true); + // 点击修改头像 + const click_update_avatar = () => { + uni.chooseImage({ + count: 1, + sizeType: ['compressed'], + success: (resPicture) => { + uni.getFileInfo({ + filePath: resPicture.tempFilePaths[0], + success: function(resSize) { + if (resSize.size > 10 * 1024 * 1024) return common.msg( + '图片过大,请重新选择'); + avatarCropperUrl.value = resPicture.tempFilePaths[0]; + avatarCropperStatus.value = true; + }, + fail: function(err) { + common.msg('获取图片失败,请选择其他图片'); + } + }); + } + }); + }; + // 选择头像取消 + const avatarOnCancel = (value) => { + avatarCropperStatus.value = false; + }; + // 选择头像确定 + const avatarOnConfirm = (file) => { + avatarCropperStatus.value = false; + nextTick(async () => { + common.loading('更新头像中'); + try { + const data = { + bizScen: 'S3007', + thumbnailFlag: true, + thumbImgSize: 100 + }; + // 上传图片 + const res = await uploadFile(file.tempFilePath, data); + // 更新个人信息 + await updateDfSysUserExtandInfoImageAddr({ + imageAddr: res.thumbFileId + }); + // 更新个人信息 + const userData = await queryCurrentUser(); + common.msg('修改成功'); + success(userData) + + } catch { + common.msg('修改失败'); + } + common.hideLoading(); + }); + }; + return { + avatarCropperUrl, + avatarCropperStatus, + click_update_avatar, + avatarOnCancel, + avatarOnConfirm, + }; +} \ No newline at end of file diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 6c5eca81..33e35d1f 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -8,32 +8,38 @@ - + 语言选择,开启学习之旅 - + - + {{ item.teacherName }} 描述:{{ item.voiceDesc || '--' }} - - + + - - + + - + - 开启学习之旅 + 开启学习之旅 @@ -43,46 +49,48 @@ - + 课程学习 - {{ showOrder }} / {{ pgrphNum }} + {{ showOrder }} + / {{ pgrphNum }} - + + class="talking-item" + v-for="(item, index) in talkingList" + :key="'item' + item.id" + :type="item.type" + :dataInfo="item" + :activeVoiceId="activeVoiceTalkingItemId" + :isPlaying="activeVoiceTalkingItemId === item.id" + :voiceRate="chooseRate" + :lastQuestionInfo="lastTalkingInfo" + :teacherInfo="choiceTeacherInfo" + @changePlay="changePlayItemId" + @nextQuestion="nextQuestionSuccess" + @withdraw="withdrawNow" + @answerQuestion="answerQuestionNow" + @finishQuestion="finishQuestionNow" + :id="'item' + item.id" + :isLast="talkingList.length === index + 1"> + class="talk-btns" + @uploadVoice="uploadRecordNow" + @submitAnswer="submitAnswerNow" + @startRecord="changePlayItemId('')" + :isLoading="isUploadingVoice" + :onlyVoice="answerOnlyVoice" + :canAnswer="testAnswer" + :adjustPosition="true" + :canAnswerText="canAnswerText" + :isDisabled="(lastTalkingInfo.type || 0) !== 4 || ['SN', 'MU', 'JD'].includes(lastTalkingInfo.qnsTyp)"/> @@ -99,17 +107,19 @@ - 设置 + 设置 音色 - + - + {{ item.teacherName }} - + @@ -121,37 +131,37 @@ diff --git a/src/pages/setting/index.vue b/src/pages/setting/index.vue index f3292b30..0b5bfb55 100644 --- a/src/pages/setting/index.vue +++ b/src/pages/setting/index.vue @@ -20,37 +20,8 @@ - - - @@ -69,26 +40,31 @@ From eea33dd60424dbcf11eec86fd5f63579a241c22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Mon, 22 Sep 2025 15:49:16 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=92=8C=E8=80=83=E8=AF=95=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=88=B7=E6=96=B0=E5=90=8E=EF=BC=8C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9A=84=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E6=A0=87=E4=B8=8D=E5=A4=8D=E5=8E=9F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/components/examination/question.vue | 3 +-- src/pages/courseRecord/components/studyRecordList.vue | 3 +++ src/pages/courseRecord/useItemList.js | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 583a07ea..7d10ff90 100644 --- a/.env.development +++ b/.env.development @@ -18,7 +18,7 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' # h5专用地址x2 # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' -VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' +# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' # VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' diff --git a/src/components/examination/question.vue b/src/components/examination/question.vue index c91821bc..14332801 100644 --- a/src/components/examination/question.vue +++ b/src/components/examination/question.vue @@ -219,8 +219,7 @@ innerAudio.setAudioSrc(res.tempFilePath); }); } else if (newVal === undefined) { - - // innerAudio.stopAudio(); + innerAudio.stopAudio(); } else { voiceTime.value = ''; innerAudio.setAudioSrc(newVal); diff --git a/src/pages/courseRecord/components/studyRecordList.vue b/src/pages/courseRecord/components/studyRecordList.vue index 68427c58..67a037c0 100644 --- a/src/pages/courseRecord/components/studyRecordList.vue +++ b/src/pages/courseRecord/components/studyRecordList.vue @@ -29,9 +29,12 @@ } }); }; + + // 自定义下拉刷新下拉结束 const refresherTouchend = () => { clearAll(); }; + const props = defineProps<{ tabIndex: number; currentIndex: number; diff --git a/src/pages/courseRecord/useItemList.js b/src/pages/courseRecord/useItemList.js index cde18d40..2ff3c9b1 100644 --- a/src/pages/courseRecord/useItemList.js +++ b/src/pages/courseRecord/useItemList.js @@ -98,6 +98,7 @@ export function useItemList(fetchFunction, item) { const clear = () => { total.value = -1 data_list.length = 0 + show_list_state.value = false } return { status, From 63de38b2f8173c43cdb1afe6a1f679d5596e5844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 22 Sep 2025 15:50:00 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=E8=AF=AD=E9=9F=B3=E6=92=AD=E6=94=BE?= =?UTF-8?q?bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/talkingItem.vue | 193 +++++++++++--------- src/pages/course/study.vue | 3 + 2 files changed, 107 insertions(+), 89 deletions(-) diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 6a3805ee..1c92653d 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -416,28 +416,36 @@ pauseVoice(); }); let prevTime = -1; + let pauseTime = -1; talkVoiceObj.value.onEnded(() => { console.log('onEnded'); - emit('changePlay', ''); + if(props.activeVoiceId){ + emit('changePlay', ''); + } prevTime = -1; + pauseTime = prevTime talkVoiceObj.value.src = ''; }); talkVoiceObj.value.onStop(() => { console.log('onStop'); - emit('changePlay', ''); + if(props.activeVoiceId){ + emit('changePlay', ''); + } prevTime = -1; + pauseTime = prevTime talkVoiceObj.value.src = ''; }); talkVoiceObj.value.onPause(() => { - console.log('onPause'); prevTime = talkVoiceObj.value.currentTime; - emit('changePlay', ''); + pauseTime = prevTime }); talkVoiceObj.value.onPlay(() => { console.log('onPlay'); prevTime = talkVoiceObj.value.currentTime; + pauseTime = prevTime emit('changePlay', unref(dataInfo)?.id); }); + talkVoiceObj.value.onTimeUpdate(() => { if (activeVoiceId.value === unref(dataInfo)?.id) { setTimeout(() => { @@ -446,18 +454,22 @@ prevTime = talkVoiceObj.value.currentTime; } } else { - emit('changePlay', ''); + if (props.isPlaying && (talkVoiceObj.value.currentTime > 0) && (pauseTime !== talkVoiceObj.value.currentTime) && props.activeVoiceId) { + emit('changePlay', ''); + } } - }, 500); + }, 100); } }); talkVoiceObj.value.onError(() => { - if(!talkVoiceObj.value.src) return - talkVoiceObj.value.src = ''; - emit('changePlay', ''); + // console.log('onError'); + // if(!talkVoiceObj.value.src) return + // talkVoiceObj.value.src = ''; + // emit('changePlay', ''); }); const pauseVoice = () => { + console.log('手动') if (!talkVoiceObj.value) return; talkVoiceObj.value.pause(); emit('changePlay', ''); @@ -478,92 +490,95 @@ }; const playVoice = (readType = 'pgth') => { let _content = showContent.value; - console.log(_content); if (!_content) { common.msg('没有可以播放的文字信息!'); return; } - emit('changePlay', unref(dataInfo)?.id); - // readType 阅读内容类型pgrh段落/qns问题 - if (talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) { - talkVoiceObj.value.play(); - return; - } - talkVoiceObj.value.src = ''; - if (itemVoice.value) { - setTimeout(() => { - talkVoiceObj.value.src = itemVoice.value; + setTimeout(() => { + emit('changePlay', unref(dataInfo)?.id); + console.log(1) + // readType 阅读内容类型pgrh段落/qns问题 + if (talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) { talkVoiceObj.value.play(); - }, 100); - } else { - voiceLoading.value = true; - let _type = - props.type == 2 ? - 'ans' : - props.type == 3 ? - 'pgrh' : - props.type == 4 ? - 'qns' : - props.type == 5 ? - 'analysis' : - props.type == 8 ? - 'stemAnalysis' : - ''; - let _readId = - props.type == 2 ? - unref(dataInfo)?.intrctId : - props.type == 3 ? - unref(dataInfo)?.pgrphId : - props.type == 4 ? - unref(dataInfo)?.qnsId : - props.type == 5 ? - unref(dataInfo)?.qnsId : - props.type == 8 ? - unref(dataInfo)?.qnsId : - ''; - let _params = { - crsId: unref(dataInfo)?.crsId || '', - pgrphId: unref(dataInfo)?.pgrphId || '', - qnsId: unref(dataInfo)?.qnsId || '', - readType: _type, // 2 文本回答 3, 段落信息 4 问题信息 - teachNo: unref(teacherInfo)?.teacherNo, // 必填 - readId: _readId - // content: _content - }; - - let _url = - '/trastudy/traStdyInfo/readContent?' + - Object.keys(_params) - .map((t) => { - return encodeURIComponent(t) + '=' + encodeURIComponent(_params[t]); - }) - .join('&'); - - storageStore.getStorageById('audio', _url + _params.teachNo, (url) => { - if (url) { - voiceLoading.value = false; - itemVoice.value = url; - talkVoiceObj.value.src = url; + return; + } + talkVoiceObj.value.src = ''; + if (itemVoice.value) { + setTimeout(() => { + talkVoiceObj.value.src = itemVoice.value; talkVoiceObj.value.play(); - } else { - downloadVoiceFile(_url) - .then((res) => { - if (res?.data) { - common.msg(res.data.message); - return; - } - voiceLoading.value = false; - itemVoice.value = res.tempFilePath; - talkVoiceObj.value.src = res.tempFilePath; - talkVoiceObj.value.play(); - storageStore.setStorage('audio', _url + _params.teachNo, itemVoice.value); - }) - .catch((err) => { - voiceLoading.value = false; - }); - } - }); - } + }, 100); + } else { + voiceLoading.value = true; + let _type = + props.type == 2 ? + 'ans' : + props.type == 3 ? + 'pgrh' : + props.type == 4 ? + 'qns' : + props.type == 5 ? + 'analysis' : + props.type == 8 ? + 'stemAnalysis' : + ''; + let _readId = + props.type == 2 ? + unref(dataInfo)?.intrctId : + props.type == 3 ? + unref(dataInfo)?.pgrphId : + props.type == 4 ? + unref(dataInfo)?.qnsId : + props.type == 5 ? + unref(dataInfo)?.qnsId : + props.type == 8 ? + unref(dataInfo)?.qnsId : + ''; + let _params = { + crsId: unref(dataInfo)?.crsId || '', + pgrphId: unref(dataInfo)?.pgrphId || '', + qnsId: unref(dataInfo)?.qnsId || '', + readType: _type, // 2 文本回答 3, 段落信息 4 问题信息 + teachNo: unref(teacherInfo)?.teacherNo, // 必填 + readId: _readId + // content: _content + }; + + let _url = + '/trastudy/traStdyInfo/readContent?' + + Object.keys(_params) + .map((t) => { + return encodeURIComponent(t) + '=' + encodeURIComponent(_params[t]); + }) + .join('&'); + + storageStore.getStorageById('audio', _url + _params.teachNo, (url) => { + if (url) { + voiceLoading.value = false; + itemVoice.value = url; + talkVoiceObj.value.src = url; + talkVoiceObj.value.play(); + } else { + downloadVoiceFile(_url) + .then((res) => { + if (res?.data) { + common.msg(res.data.message); + return; + } + voiceLoading.value = false; + itemVoice.value = res.tempFilePath; + talkVoiceObj.value.src = res.tempFilePath; + talkVoiceObj.value.play(); + storageStore.setStorage('audio', _url + _params.teachNo, itemVoice.value); + }) + .catch((err) => { + voiceLoading.value = false; + }); + } + }); + + } + }, 100); }; const saveFile = (buffer, filePath, cb = () => {}) => { let fileManager = uni.getFileSystemManager(); diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 33e35d1f..b09db19c 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -295,11 +295,13 @@ const showChangeSeekModelNow = () => { } const showBgModel = ref(false) const showChangeBgModelNow = () => { + console.log(222) changePlayItemId() showBgModel.value = true } // 关闭播放状态 const changePlayItemId = (id = '') => { + console.log(id,'id') activeVoiceTalkingItemId.value = id // if(activeVoiceTalkingItemId.value === id){ // activeVoiceTalkingItemId.value = '' @@ -1103,6 +1105,7 @@ const getQuestionEvalateRequest = (id, data, num) => { if (t.id === id) { lastTalkingInfo.value = { ..._body.chatBody, + crsId: crsId.value, pgrphId: data.pgrphId, qstLogId: loadingExecLogId.value, id, From 008dc6b2ab961380024cd67b22428900d68a3583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Mon, 22 Sep 2025 16:09:33 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=92=8C=E8=80=83=E8=AF=95=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=88=B7=E6=96=B0=E5=90=8E=EF=BC=8C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9A=84=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E6=A0=87=E4=B8=8D=E5=A4=8D=E5=8E=9F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/pages/practice/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.development b/.env.development index 7d10ff90..23e0e4f5 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ ENV = 'development' # 'development' -VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' +VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # UAT # VITE_APP_BASE_API_Url = 'http://25.18.122.78:9786' diff --git a/src/pages/practice/index.vue b/src/pages/practice/index.vue index 5363ac0c..fb3099b6 100644 --- a/src/pages/practice/index.vue +++ b/src/pages/practice/index.vue @@ -307,7 +307,7 @@ const touchBtnSubmit = (type, submitObj) => { const topic = topicList[questionNumber.value]; touchBtnRef.value?.clearinputText(); // 清除发送框数据 if (type === 'voice') { - if (topic.es_status == '00') return; + if (topic.es_status === '00') return; topic.es_status = '00'; // 00转圈 const voicePath = submitObj; commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {}) From f645fe7bbb47946d2e9e7af8293b13092f54dc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 22 Sep 2025 16:09:53 +0800 Subject: [PATCH 6/6] fix: bug --- src/pages/course/components/talkingItem.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 1c92653d..2ff31718 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -454,7 +454,8 @@ prevTime = talkVoiceObj.value.currentTime; } } else { - if (props.isPlaying && (talkVoiceObj.value.currentTime > 0) && (pauseTime !== talkVoiceObj.value.currentTime) && props.activeVoiceId) { + if (props.isPlaying && (talkVoiceObj.value.currentTime > 0) && props.activeVoiceId) { + console.log(pauseTime , prevTime) emit('changePlay', ''); } }