From d8119506ef1cd505c25a6496ac53a3443f99ac7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Thu, 21 Aug 2025 11:11:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix=EF=BC=9A=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/talkingItem.vue | 31 +++++++----- src/pages/course/study.vue | 54 ++++++++++++--------- 2 files changed, 50 insertions(+), 35 deletions(-) diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 513c86e0..7909e506 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -39,7 +39,12 @@ {{ showContent }} - + @@ -97,7 +102,7 @@ 继续学 @@ -226,7 +231,7 @@ import { getUserInfo } from '@/common/common'; import { useStorageStore } from "@/store/storage.js" import { onUnload } from '@dcloudio/uni-app' -import RadioSubject from '@/components/examination/radio-subject.vue' +import Subject from '@/components/examination/subject.vue' // import RadioSubjectRequest from '@/pages/wrong_question_record/components/radio-subject.vue' const storageStore = useStorageStore() @@ -285,7 +290,12 @@ const audioCacheObj = computed(() => storageStore.audioObj) talkVoiceObj.value.playbackRate = Number(props.voiceRate) const userInfo = computed(() => getUserInfo()) const itemVoice = ref('') - + const subjectInfo = computed(()=>{ + return { + ...dataInfo.value, + ...(dataInfo.value?.traQnsInfoVo||{}) + } + }) const mode = ref('study') // 考试 examination 练习practice 学习study const showWithdraw = computed(()=>{ @@ -350,7 +360,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) const voiceTime = ref('') const itemInfo = ref({}) onMounted(()=>{ - console.log() initVoice() }) onUnload(()=>{ @@ -405,7 +414,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) voiceLoading.value = true let _type = props.type == 2 ? 'ans' : props.type == 3 ? 'pgrh' : props.type == 4 ? 'qns' : '' let _readId = props.type == 2 ? unref(dataInfo)?.intrctId : props.type == 3 ? unref(dataInfo)?.pgrphId : props.type == 4 ? unref(dataInfo)?.qnsId : '' - console.log(unref(dataInfo)) let _params = { crsId: unref(dataInfo)?.crsId || '', pgrphId: unref(dataInfo)?.pgrphId || '', @@ -454,7 +462,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) success: cb, file: ()=>{ voiceLoading.value = false - console.log('文件保存失败!') } }) } @@ -530,7 +537,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) } // 撤回 const withdraw = () => { - console.log(unref(dataInfo)) emit('withdraw', unref(dataInfo)) } // 完成 @@ -538,9 +544,12 @@ const audioCacheObj = computed(() => storageStore.audioObj) emit('finishQuestion',data) } // 答题 选择 - const subject_click = (type,data) => { - if(type === 'answer'){ - emit('answerQuestion', data, unref(dataInfo)) + const subject_click = (type, data) => { + if(['answer', 'choose'].includes(type)){ + emit('answerQuestion', { + ...data, + ...unref(dataInfo) + }) } } diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 8be24b68..93611c61 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -431,6 +431,7 @@ const qstLogId = ref('') // 获取问题 const getQuestionInfoUnStudy = (pgrphId) => { + console.log(pgrphId) textChartApi({ processType: 'QSN-ANSER', requestBody: JSON.stringify({ @@ -438,7 +439,7 @@ stdyId: unref(stdyId), stdyBatch: unref(stdyBatch), logId: unref(logId), - pgrphId + pgrphId: pgrphId }) }) .then(res => { @@ -492,6 +493,7 @@ // 继续 执行方法 const nextQuestionSuccess = (info, type = 'next') => { + console.log(info) let _id = new Date().getTime() + 'id' if (type === 'next') { talkingList.value.push({ @@ -533,26 +535,29 @@ // 重新回答 textChartApi({ processType: 'NEW-ANSER', //NEW-KNOW - requestBody: info.qstLogId + requestBody: info.qnsId }).then(res => { let _body = res.body || {} if (!_body.chatBody) { return } + console.log(info, 222222) lastTalkingInfo.value = { crsId: info.crsId, qstLogId: _body.chatBody, - pgrphId: info.pgrphId, chatContent: _body.chatContent, userInfo: { ...choiceTeacherInfo.value }, ..._body.chatBody, + pgrphId: info.pgrphId, type: Number(_body.bodyTyp) || 0, id: _id, - isQuestion: true + isQuestion: true, + my_answer: [], + backend_answer: [] } - talkingList.value.push(lastTalkingInfo.value) + talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value))) qstLogId.value = _body.chatBody.qstLogId scrollToBottomNow() }) @@ -588,7 +593,7 @@ id: _id, isQuestion: true } - talkingList.value.push(lastTalkingInfo.value) + talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value))) logId.value = _body.chatBody.logId qstLogId.value = _body.chatBody.qstLogId || qstLogId.value scrollToBottomNow() @@ -684,7 +689,9 @@ scrollToBottomNow() } onHide(() => { + //#ifdef APP-PLUS uni.offKeyboardHeightChange(setHeight) + // #endif if (watchFlag.value === 1) return changePlayItemId('') socketStore.closeSocket() @@ -693,7 +700,9 @@ // }).finally(() => {}) }) onShow(() => { + //#ifdef APP-PLUS uni.onKeyboardHeightChange(setHeight) + // #endif if (watchFlag.value === 1) return // getData('2'); initsocketTask() @@ -836,10 +845,7 @@ talkingList.value.push({ ..._data, chatContent: _body.chatContent, - userInfo: { - ...choiceTeacherInfo.value - }, - intrctId: _body.chatBody || '', + recordId: _body.chatBody || '', talkingContent: val, talkingVoice: '', type: 2, @@ -860,17 +866,24 @@ textChartApi({ processType: 'ANSER-WITHDRAW', requestBody: JSON.stringify({ - intrctId: data.intrctId + recordId : data.recordId }) }) .then(res => { // 删除撤回的数据item common.msg('撤回成功!') - talkingList.value = talkingList.value.filter(t => t.intrctId !== data.intrctId) + talkingList.value = talkingList.value.filter(t => t.recordId !== data.recordId ) }) } const loadingQstLogId = ref('') - const answerQuestionNow = (data, item) => { + const answerQuestionNow = (data) => { + let _data = { + qnsId: data.qnsId, // 问题ID 必输项:true 类型:String + pgrphId: data.pgrphId, // 段落ID 必输项:true 类型:String + crsId: crsId.value, // 课程ID 必输项:true 类型:String + stdyBatch: stdyBatch.value, // 学习批次 必输项:true 类型:String + ansterContent: data.answer.join(',') // 回答文本内容 必输项:false 类型:String + } // 发出答案 let _answer = data.answerItems.map(t => t.itemNo).join(',') let _id1 = new Date().getTime() + '3d' @@ -883,13 +896,6 @@ type: 0 }) scrollToBottomNow(0) - let _data = { - qnsId: item.qnsId, // 问题ID 必输项:true 类型:String - pgrphId: item.pgrphId, // 段落ID 必输项:true 类型:String - crsId: crsId.value, // 课程ID 必输项:true 类型:String - stdyBatch: stdyBatch.value, // 学习批次 必输项:true 类型:String - ansterContent: data.answer.join(',') // 回答文本内容 必输项:false 类型:String - } textChartApi({ processType: 'ANSER-CHOICE', requestBody: JSON.stringify(_data) @@ -901,8 +907,8 @@ stdyId: unref(stdyId), stdyBatch: unref(stdyBatch), logId: unref(logId), - pgrphId: item.pgrphId, - qnsId: item.qnsId, + pgrphId: data.pgrphId, + qnsId: data.qnsId, chatContent: _body.chatContent || '', ...(_body.chatBody || {}), type: Number(_body.bodyTyp || 8), @@ -914,7 +920,7 @@ my_answer: [], backend_answer: [] } - talkingList.value.push(lastTalkingInfo.value) + talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value))) scrollToBottomNow(0) }) } @@ -953,7 +959,7 @@ }, type: 5 } - talkingList.value.push(lastTalkingInfo.value) + talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value))) scrollToBottomNow(0) getQuestionEvalateRequest(_id, data, 1) }) From 880e2c311214b9a52b67e91d77e4f1a1d062ea21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Thu, 21 Aug 2025 11:14:13 +0800 Subject: [PATCH 2/4] fix: bug --- .env.development | 7 ++++--- src/components/examination/subject.vue | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index cb3b3b46..015f8308 100644 --- a/.env.development +++ b/.env.development @@ -23,7 +23,8 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # VITE_APP_BASE_H5_API_Url = 'http://25.64.16.130:9602' # 线上 -VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001' +# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001' +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' -#VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.140:9602' -#VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' +#VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601' +VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602' diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue index ebe00c50..e72150a8 100644 --- a/src/components/examination/subject.vue +++ b/src/components/examination/subject.vue @@ -134,6 +134,7 @@ qnsId: props.item.qnsId, qnsContent: props.item.qnsContent, qnsTyp: props.item.qnsTyp, + analyContent: props.item.analyContent, itemVos: (props.item.itemVos??[]).map((res) => ({ ...res, correctFlag: props.clearResult ? '' : res.correctFlag From 39af19d7e94c11b387fdeb499072f2b37793038f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Thu, 21 Aug 2025 11:18:26 +0800 Subject: [PATCH 3/4] fix: bug --- src/components/examination/subject.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue index e72150a8..7ed3cee2 100644 --- a/src/components/examination/subject.vue +++ b/src/components/examination/subject.vue @@ -39,7 +39,7 @@ SUBJECT_TYPE.find((res) => qnsTyp.value === res.value)?.label || ''); // 点击答题 const click_option = (analysisVo) => { - if (props.isPreview) return; + if (props.isPreview || !props.clearResult) return; // 无论什么类型如果表里已经有了,再次点击就是弹出 if (item_answer.value.includes(analysisVo.itemId)) { item_answer.value = item_answer.value.filter((id) => id !== analysisVo.itemId); From fc8153002b0d48e6521c6f8d200d05bc47b6d1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Thu, 21 Aug 2025 11:34:46 +0800 Subject: [PATCH 4/4] fix: bug --- src/components/examination/subject.vue | 5 +++-- src/pages/course/components/talkingItem.vue | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue index 7ed3cee2..9ba4b667 100644 --- a/src/components/examination/subject.vue +++ b/src/components/examination/subject.vue @@ -106,13 +106,14 @@ clearResult: { type: Boolean, default: true - } + }, }); const modelValue = computed({ get: () => props.modelValue, set: (val) => emit('update:modelValue', val) }); - const item_answer = ref(typeof props?.my_answer === 'string' ? props.my_answer.split(',') : []); + let answerText = props.item?.my_answer + const item_answer = ref(typeof answerText === 'string' ? answerText.split(',') : []); const feedback_click = () => { emit('subject_click', 'feedback', props.item); }; diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 7909e506..4b23e9f1 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -293,7 +293,8 @@ const audioCacheObj = computed(() => storageStore.audioObj) const subjectInfo = computed(()=>{ return { ...dataInfo.value, - ...(dataInfo.value?.traQnsInfoVo||{}) + ...(dataInfo.value?.traQnsInfoVo||{}), + my_answer: dataInfo.value?.traQnsInfoVo?.anserResult||'' } }) const mode = ref('study') // 考试 examination 练习practice 学习study