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 bba727e9..7dc8587f 100644 --- a/src/components/examination/subject.vue +++ b/src/components/examination/subject.vue @@ -39,7 +39,7 @@ 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); }; @@ -133,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 @@ -143,7 +145,7 @@ const subject_type_text = computed(() => 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); diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 513c86e0..4b23e9f1 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,13 @@ 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||{}), + my_answer: dataInfo.value?.traQnsInfoVo?.anserResult||'' + } + }) const mode = ref('study') // 考试 examination 练习practice 学习study const showWithdraw = computed(()=>{ @@ -350,7 +361,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) const voiceTime = ref('') const itemInfo = ref({}) onMounted(()=>{ - console.log() initVoice() }) onUnload(()=>{ @@ -405,7 +415,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 +463,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) success: cb, file: ()=>{ voiceLoading.value = false - console.log('文件保存失败!') } }) } @@ -530,7 +538,6 @@ const audioCacheObj = computed(() => storageStore.audioObj) } // 撤回 const withdraw = () => { - console.log(unref(dataInfo)) emit('withdraw', unref(dataInfo)) } // 完成 @@ -538,9 +545,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) })