From 9adeba89d5e85740d02903d8559e60e060113724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Mon, 22 Sep 2025 14:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8D=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=97=AE=E7=AD=94=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=99=BE?= =?UTF-8?q?=E7=A6=84=E5=BD=A2=E8=B1=A1=E4=B8=8D=E9=87=8D=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common.js | 4 +- src/components/examination/question.vue | 12 +- src/components/examination/subject.vue | 4 +- src/components/watermark/watermark.vue | 137 +- src/composables/useUpdateAvatar.js | 83 ++ src/pages/course/study.vue | 484 +++---- src/pages/examination/index.vue | 60 +- src/pages/index/dialog.vue | 57 +- src/pages/me/index.vue | 71 +- src/pages/practice/index.vue | 1456 +++++++++++---------- src/pages/setting/index.vue | 134 +- src/pages/wrongQuestionRecord/correct.vue | 1451 ++++++++++---------- 12 files changed, 1944 insertions(+), 2009 deletions(-) create mode 100644 src/composables/useUpdateAvatar.js diff --git a/src/api/common.js b/src/api/common.js index cb7c54b9..79105795 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -91,11 +91,11 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey = 'voice') = try { const res = JSON.parse(result.data); if (res.rtnCode === '0000') { - return resolve(result); + return resolve(res); } else if (REQUES_ERROR_CODES['NO_LOGIN'].includes(res.rtnCode)) { goto_login_fun() return reject('NO_LOGIN'); - }else if(res.rtnCode === '0004') { + } else if (res.rtnCode === '0004') { return reject('N'); } return reject('Other'); diff --git a/src/components/examination/question.vue b/src/components/examination/question.vue index 678d4a7a..c91821bc 100644 --- a/src/components/examination/question.vue +++ b/src/components/examination/question.vue @@ -80,8 +80,6 @@ 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 @@