diff --git a/src/components/examination/characters-subject.vue b/src/components/examination/characters-subject.vue index ef704eaf..ea099eef 100644 --- a/src/components/examination/characters-subject.vue +++ b/src/components/examination/characters-subject.vue @@ -19,7 +19,11 @@ {{subject_data.qnsContent}} - + @@ -33,10 +37,12 @@ computed, toRaw } from 'vue' + import questionVue from './question.vue'; import radioSubjectItem from './radio-subject-item.vue' import { SUBJECT_TYPE } from '@/enum.js' + const talkingInfo = reactive({}) const customStyle = { borderRadius: '16rpx', width: '292rpx', @@ -67,7 +73,9 @@ }) // 题类型 const subject_type_text = computed(() => SUBJECT_TYPE.find(res => subject_data.qnsTyp === res.value)?.label || '') - + const changePlay = (id) => { + // emit('handleEvents', 'changePlay', props.talkingInfo, id) + } \ No newline at end of file diff --git a/src/pages/examination/index.vue b/src/pages/examination/index.vue index 09c0fcd9..4a57945f 100644 --- a/src/pages/examination/index.vue +++ b/src/pages/examination/index.vue @@ -57,8 +57,11 @@ @click="button_tab(1)"> - + + + @@ -85,6 +88,9 @@ import { getPageCache } from '@/common/common'; + import { + commonUploadVoiceFile + } from "@/api/common.js" const sendLoadingText = ref('问题回答中,请在问题回答结束后重试!') const answerIsOver = ref(true) const examId = ref('') @@ -94,14 +100,19 @@ limitTm: 0, papersName: '', }) // 试卷信息 + const topicList = reactive([]) // 问题列表 + const questionNumber = ref(0) // 题号 + + const showTouchBtn = computed(() => { + return topicList[questionNumber.value]['qnsTyp'] === 'ES' + }) + // const showTouchBtn = ref(true) const progress = computed(() => { // 计算进度百分比(保留两位小数) const total = topicList.length; if (total === 0) return 0; const completed = questionNumber.value + 1; return Math.min(Math.round((completed / total) * 10000) / 100, 100); }) - const topicList = reactive([]) // 问题列表 - const questionNumber = ref(0) // 题号 const swiperChange = (item) => { questionNumber.value = item.detail.current } @@ -116,9 +127,54 @@ questionNumber.value = newNumber; } // 发送语音 - const uploadRecordNow = (voicePath) => {} + const uploadRecordNow = (voicePath) => { + //#ifdef APP-PLUS + // talkingList.value.push({ + // type: 'question', + // talkingText: '', + // isLoading: true + // }) + // scrollToBottomNow() + commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {}).then(res => { + let _res = JSON.parse(res.data) + console.log('_res', _res); + if (_res.rtnCode === '0000') { + // if (!!(_res.body.transContent || '').trim()) { + // askData.value = { + // reqBatch: reqBatch.value, + // intrctWay: '02', //01-文本;02-语音;03-图片 + // intrctContent: _res.body.transContent, + // bucketKey: _res.body.fileId, + // ossFileAddr: _res.body.ossFileAddr, + // talkingVoice: voicePath + // } + // sendMessage({ + // "commond": 'ASK', + // "body": askData.value + // }) + // } else { + // // talkingList.value.pop() + // uni.showToast({ + // title: '未识别到文字!', + // icon: "none", + // duration: 1000 + // }); + // } + } else {} + }).catch(err => { + // talkingList.value.pop() + uni.showToast({ + title: '系统异常,请联系管理员', + icon: "none", + duration: 1000 + }); + }) + // #endif + } // 发送文本 - const submitAnswerNow = (val, cb = null) => {} + const submitAnswerNow = (val, cb = null) => { + + } // 初始化时检查 onLoad(() => { const examination = getPageCache('examination') @@ -136,13 +192,14 @@ }))) }); const hand_in_paper = () => { - console.log('点击交卷', topicList); + console.log('点击交卷', showTouchBtn.value); + showTouchBtn.value = !showTouchBtn.value }