fix: 答题样式调整

This commit is contained in:
杨航
2025-08-19 18:27:23 +08:00
parent 76bcb91480
commit b885a6600c
4 changed files with 65 additions and 30 deletions
+16 -2
View File
@@ -19,10 +19,11 @@
<text class="talking-text" v-if="[3, 5, 6].indexOf(type) >= 0 && !dataInfo.isLoading">
{{ showContent }}
</text>
<text class="talking-text" v-if="[4].indexOf(type) >= 0">
<text class="talking-text" v-if="[4].indexOf(type) >= 0 && dataInfo.qnsTyp === 'ES'">
<!-- 请您思考并作答:<br> -->
{{ showContent }}
</text>
<RadioSubject v-if="[4].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" />
<view v-if="type === 3" style="overflow: hidden;">
<ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]" :previewDetail="true"></ImagePreview>
<VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :fileId="dataInfo.vidoAddrs[0]"></VideoPreview>
@@ -199,6 +200,8 @@ 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'
const storageStore = useStorageStore()
const audioCacheObj = computed(() => storageStore.audioObj)
const props = defineProps({
@@ -249,13 +252,15 @@ const audioCacheObj = computed(() => storageStore.audioObj)
})
const { type, dataInfo, activeVoiceId, isPlaying, isLast, lastQuestionInfo, teacherInfo} = toRefs(props)
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion'])
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion', 'answerQuestion'])
// 声音播放初始化
const talkVoiceObj = ref(uni.createInnerAudioContext())
talkVoiceObj.value.playbackRate = Number(props.voiceRate)
const userInfo = computed(() => getUserInfo())
const itemVoice = ref('')
const mode = ref('study') // 考试 examination 练习practice 学习study
const showWithdraw = computed(()=>{
let _isMe = unref(lastQuestionInfo).qstLogId === unref(dataInfo).qstLogId
let _isQuestion = unref(lastQuestionInfo).isQuestion
@@ -316,6 +321,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
return str.replace(/\/n/g,"\n")
}
const voiceTime = ref('')
const itemInfo = ref({})
onMounted(()=>{
console.log()
initVoice()
@@ -504,6 +510,13 @@ const audioCacheObj = computed(() => storageStore.audioObj)
const finishQuestion = (data) => {
emit('finishQuestion',data)
}
// 答题 选择
const subject_click = (type,data) => {
if(type === 'answer'){
emit('answerQuestion', data)
}
}
</script>
<style lang="scss">
@@ -546,6 +559,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
background-color: #fff;
overflow: hidden;
padding-bottom: 30rpx;
width: 100%;
&.talking-info-less{
float: left;
min-width: 400rpx;
+9 -1
View File
@@ -73,6 +73,7 @@
@changePlay="changePlayItemId"
@nextQuestion="nextQuestionSuccess"
@withdraw="withdrawNow"
@answerQuestion="answerQuestionNow"
@finishQuestion="finishQuestionNow"
:id="'item' + item.id"
:isLast="talkingList.length === (index+1)"
@@ -440,6 +441,7 @@ const getQuestionInfoUnStudy = (pgrphId) => {
}).finally(() => {})
return
}
console.log(_body.chatBody)
if(_body.chatBody && _body.chatBody?.stdyStat !== 'N'){
let _id = new Date().getTime() + 'id'
lastTalkingInfo.value = {
@@ -454,8 +456,11 @@ const getQuestionInfoUnStudy = (pgrphId) => {
type: 4,
userInfo: {...choiceTeacherInfo.value},
id: _id,
isQuestion: true
isQuestion: true,
my_answer:[],
backend_answer: []
}
console.log(lastTalkingInfo.value)
talkingList.value.push(JSON.parse(JSON.stringify(lastTalkingInfo.value)))
qstLogId.value = _body.chatBody?.qstLogId
scrollToBottomNow()
@@ -827,6 +832,9 @@ const withdrawNow = (data) => {
})
}
const loadingQstLogId = ref('')
const answerQuestionNow = (data) => {
console.log(data,1111111111)
}
// 完成
const finishQuestionNow = (data) => {
textChartApi({