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 @@