合并冲突

This commit is contained in:
杨航
2026-01-26 08:34:06 +08:00
12 changed files with 112 additions and 62 deletions
@@ -487,6 +487,14 @@
});
}
};
const clearInputText = (text = '') => {
let oldText = answerValue.value
answerValue.value = text;
return oldText
}
const give_up = () => {
console.log('调用结束语音回答');
};
const changeBtn = () => {
if (props.isDisabled) return;
keyboardIsShow.value = !keyboardIsShow.value;
@@ -495,6 +503,7 @@
onHide(() => {
isGettingPermission.value = true
})
defineExpose({clearInputText, give_up})
</script>
<style lang="scss" scoped>
@@ -66,8 +66,7 @@
modelValue: Object
});
import {ANSWER_METHOD_MAP} from '@/enum.js'
const answerMethod = computed(() => ANSWER_METHOD_MAP[props.item?.answerMethod || ''] || ANSWER_METHOD_MAP['01']);
const answerMethod = computed(() => ANSWER_METHOD_MAP[props.modelValue?.answerMethod || ''] || ANSWER_METHOD_MAP['01']);
const previewFile = info => {
previewFileFnc({
fileId: info.fileId,
@@ -6,15 +6,17 @@
</view>
<view class="qns-desc">你的答案</view>
<view class="ans-list">
<!-- {...item, ossAddr: 'http://25.18.122.91:9786' + item.ossAddr.slice(35,)} -->
<esQuestionAnswer v-for="item in dataInfo.analyContentVos" :dataInfo="item" :intrctWay="item.ossKey?'02':'01'"
:activeVoiceId="activeVoiceId" @changePlay="changePlay" />
</view>
<view class="analysis_div">
<slot></slot>
<!-- <view class="analysis_div">
<view class="analysis_title">
<view class="success_answer">参考答案{{ dataInfo.itemAnswer }}</view>
</view>
<view class="analysis_note">试题解析{{ dataInfo?.analyContent }}</view>
</view>
</view> -->
</view>
</template>
@@ -54,7 +56,6 @@
});
const emit = defineEmits(['changePlay', 'buutton_click']);
const changePlay = (val) => {
console.log('esq')
emit('changePlay', val)
}
watch(
@@ -119,6 +120,8 @@
font-size: 30rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
font-weight: bold;
color: #333333;
}
.talking-info {
@@ -49,6 +49,9 @@
import {
onUnload
} from '@dcloudio/uni-app';
import {
getToken
} from '@/common/common.js'
const props = defineProps({
dataInfo: {
default: () => ({
@@ -135,21 +138,23 @@
emit('buutton_click', type, props.dataInfo);
};
const pauseVoice = () => {
console.log('pauseVoice')
if (!talkVoiceObj.value) return;
talkVoiceObj.value.pause();
isPlaying.value = false;
emit('changePlay', '');
// emit('changePlay', '');
};
const playVoice = () => {
emit('changePlay', unref(dataInfo)?.ossAddr);
// emit('changePlay', unref(dataInfo)?.ossAddr);
if (talkVoiceObj.value && talkVoiceObj.value.src) {
talkVoiceObj.value.play();
isPlaying.value = true;
return;
} else {
talkVoiceObj.value.src = '';
// talkVoiceObj.value.src = '';
if (unref(dataInfo).ossAddr) {
setTimeout(() => {
talkVoiceObj.value.src = unref(dataInfo).ossAddr;
talkVoiceObj.value.src = unref(dataInfo).ossAddr + '?tk=' + getToken();
talkVoiceObj.value.play();
isPlaying.value = true;
}, 100);
@@ -160,22 +165,26 @@
talkVoiceObj.value = uni.createInnerAudioContext();
let prevTime = -1;
talkVoiceObj.value.onEnded(() => {
console.log('onEnded')
emit('changePlay', '');
prevTime = -1;
talkVoiceObj.value.src = '';
});
talkVoiceObj.value.onStop(() => {
console.log('onStop')
emit('changePlay', '');
prevTime = -1;
talkVoiceObj.value.src = '';
});
talkVoiceObj.value.onPause(() => {
console.log('onPause')
prevTime = talkVoiceObj.value.currentTime;
emit('changePlay', '');
});
talkVoiceObj.value.onError(() => {
prevTime = -1;
emit('changePlay', '');
console.log('onError')
// prevTime = -1;
// emit('changePlay', '');
});
talkVoiceObj.value.onPlay(() => {
prevTime = talkVoiceObj.value.currentTime;
@@ -194,12 +203,8 @@
}, 500);
}
});
if (unref(dataInfo).intrctWay === '02') {
itemVoice.value = unref(dataInfo).ossAddr;
talkVoiceObj.value.src = itemVoice.value;
setTimeout(() => {
setVoiceTime(0);
}, 100);
if (unref(dataInfo).ossKey) {
talkVoiceObj.value.src = unref(dataInfo).ossAddr + '?tk=' + getToken();
}
};
const setVoiceTime = (sum) => {
@@ -31,10 +31,13 @@
{{ showContent }}
</text>
<!-- 试题问题 -->
<Subject v-if="[4, 8].indexOf(type) >= 0" :isPreview="!isLast" :item="subjectInfo"
:mode="mode" :clearResult="type === 4" @subject_click="subject_click" />
<!-- <esQuestion v-if="[4, 8].indexOf(type) >= 0 && dataInfo.qnsTyp === 'ES'" @changePlay="changePlay"
:activeVoiceId="activeVoiceId" :dataInfo="esSubjectInfo" /> -->
<esQuestion v-if="[4, 8].indexOf(type) >= 0 && dataInfo.qnsTyp === 'ES'" @changePlay="changePlay"
:activeVoiceId="activeVoiceId" :dataInfo="esSubjectInfo">
<Subject :isPreview="!isLast" :item="subjectInfo"
:mode="mode" :clearResult="type === 4" @subject_click="subject_click" />
</esQuestion>
<Subject v-if="[4, 8].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :isPreview="!isLast" :item="subjectInfo"
mode="study" :clearResult="type === 4" @subject_click="subject_click" />
<!-- 试题问题反馈 -->
<!-- <RadioSubjectRequest v-if="[8].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" /> -->
<!-- 段落图片视频预览 -->
@@ -257,7 +260,7 @@
})
return _sum
})
const mode = ref('study') // 考试 examination 练习practice 学习study
const mode = ref('study_record') // 考试 examination 练习practice 学习study
const showWithdraw = computed(() => {
let _isMe = unref(lastQuestionInfo).qstLogId === unref(dataInfo).qstLogId
+15 -1
View File
@@ -96,7 +96,21 @@
</view>
</view>
<view class="touch-btn-div" :class="{ show: showTouchBtn }">
<TouchBtnOnlyVoice
v-if="answerMethod === '03'"
class="talk-btns"
ref="touchBtnRef"
@uploadVoice="touchBtnSubmit('voice', $event)"
@submitAnswer="touchBtnSubmit('text', $event)"
:isLoading="touchIsDisabled"
loadingText="只能进行一条回答"
:adjustPosition="false"
:isDisabled="false"
:onlyVoice="true"
:answerMethod="answerMethod"
/>
<TouchBtn
v-else
class="talk-btns"
ref="touchBtnRef"
@uploadVoice="touchBtnSubmit('voice',$event)"
@@ -162,6 +176,7 @@
import Subject from '@/components/examination/subject.vue';
// import TouchBtn from '@/components/examination/touchBtn.vue';
import TouchBtn from '@/pages/course/components/touchBtn.vue';
import TouchBtnOnlyVoice from '@/pages/course/components/touchBtnOnlyVoice.vue';
import { ref, reactive, computed, onMounted, nextTick } from 'vue';
import { onLoad, onBackPress } from '@dcloudio/uni-app';
import common from '@/common/common';
@@ -169,7 +184,6 @@
import { commonUploadVoiceFile } from '@/api/common.js';
import { optionErrorIcon, examinationSheetIcon, practiceExitIcon } from '@/common/imgSvg';
import { commitPaperExam, commitCrsExam, commitPaperCache } from '@/api/examination.js';
const answerIsOver = ref(true);
const feedbackRef = ref(null);
const dialogRef = ref(null);
+28 -13
View File
@@ -64,20 +64,36 @@
</swiper-item>
</swiper>
</view>
<view class="fixed-box font_pf" :style="{ marginBottom: popup_input_bottom }">
<view class="touch-btn-div" :class="{ show: showTouchBtn }">
<TouchBtn
<TouchBtnOnlyVoice
v-if="answerMethod === '03'"
class="talk-btns"
ref="touchBtnRef"
@uploadVoice="touchBtnSubmit('voice',$event)"
@submitAnswer="touchBtnSubmit('text',$event)"
@uploadVoice="touchBtnSubmit('voice', $event)"
@submitAnswer="touchBtnSubmit('text', $event)"
:isLoading="touchIsDisabled"
loadingText="只能进行一条回答"
:adjustPosition="false"
:isDisabled="false"
:onlyVoice="true"
:answerMethod="answerMethod"
/>
<TouchBtn
v-else
class="talk-btns"
ref="touchBtnRef"
@uploadVoice="touchBtnSubmit('voice', $event)"
@submitAnswer="touchBtnSubmit('text', $event)"
:isLoading="touchIsDisabled"
loadingText="只能进行一条回答"
:adjustPosition="false"
:isDisabled="false"
:answerMethod="answerMethod"
/>
</view>
</view>
<!-- 反馈组件 -->
@@ -97,6 +113,7 @@
import CharactersSubject from '@/components/examination/characters-subject.vue';
// import TouchBtn from '@/components/examination/touchBtn.vue';
import TouchBtn from '@/pages/course/components/touchBtn.vue';
import TouchBtnOnlyVoice from '@/pages/course/components/touchBtnOnlyVoice.vue';
import common from '@/common/common';
import { setPageCache, formatSeconds, getPageCache, setupKeyboardHeightListener } from '@/common/common';
import { commonUploadVoiceFile } from '@/api/common.js';
@@ -104,7 +121,6 @@
import { practiceAnswer, practiceCommit, queryCrsPracticeAnswerResult } from '@/api/practice.js';
import { startExamByCrs } from '@/api/examination.js';
import { startPracticeByCrs } from '@/api/practice.js';
const swiperRef = ref(null);
const feedbackRef = ref(null);
const dialogRef = ref(null);
@@ -117,7 +133,7 @@
let leaveStartTime = 0; //
const mode = ref('practice'); // examination practice
const systemInfo = uni.getSystemInfoSync();
const paperData = reactive({
exrId: '',
crsId: '',
@@ -365,16 +381,15 @@
paperData.crsId = practice.crsId;
paperData.name = practice.name;
paperData.exrId = practice.exrId;
answerMethod.value = practice.answerMethod ?? '01';
storageTopicList.value = practice.qnsInfoVos.map((res) => ({
...res,
isPreview: false,
clearResult: true,
es_status: '', // '' 00 01
my_answer: [],
answerMethod:answerMethod.value
answerMethod: answerMethod.value
}));
answerMethod.value = practice.answerMethod ?? '01'
console.log('answerMethod', answerMethod.value);
addProblem();
//
practiceStartTime = new Date().getTime();
@@ -477,12 +492,12 @@
onUnload(() => {
stopTimer();
});
onBackPress((res) => {
if(res.from === 'backbutton') {
exit_practice()
if (res.from === 'backbutton') {
exit_practice();
return true;
}
}
});
</script>