考试页

This commit is contained in:
田岩
2025-08-08 17:37:14 +08:00
parent e0946cbbfd
commit 2f73406430
7 changed files with 186 additions and 39 deletions
@@ -19,13 +19,9 @@
{{subject_data.qnsContent}}
</view>
<view class="option_div">
<questionVue
@changePlay="changePlay"
:dataInfo="talkingInfo"
:activeVoiceId="activeVoiceId"
></questionVue>
<questionVue @changePlay="changePlay" :dataInfo="talkingInfo" :activeVoiceId="questionValue"></questionVue>
</view>
</view>
</template>
<script setup>
@@ -35,21 +31,15 @@
onMounted,
nextTick,
computed,
toRaw
toRaw,
watch
} 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',
backgroundColor: '#0066FF',
border: '1rpx solid rgb(12, 123, 245)',
}
const emit = defineEmits(['click_option'])
const questionValue = ref('')
const props = defineProps({
item: {
type: Object,
@@ -58,9 +48,52 @@
mode: {
type: String,
required: true,
}
},
activeVoiceId: {
type: String,
required: true,
},
voicePathValue: {
type: String,
required: true,
},
});
const talkingInfo = ref({
id: '3',
intrctWay: "",
intrctContent: "中的i id一二三。",
talkingText: '中的i id一二三。',
talkingVoice: ''
})
watch(() => props.voicePathValue, (val) => {
if (val) {
talkingInfo.value = {
id: '3',
intrctWay: "02",
intrctContent: "中的i id一二三。",
talkingText: '中的i id一二三。',
talkingVoice: val
}
}
})
// "chatId": "CHAT025018122068202508081709060000000000000000000000000000000098",
// "fileId": "S3F0250181220722025080817090600000476885",
// "ossFileAddr": "http://25.18.122.66::9786/traoss/show//S3F0250181220722025080817090600000476885",
// "transContent": "一二三四。"
// const activeVoiceId = ref()
const customStyle = {
borderRadius: '16rpx',
width: '292rpx',
backgroundColor: '#0066FF',
border: '1rpx solid rgb(12, 123, 245)',
}
const emit = defineEmits(['click_option'])
const subject_data = reactive({
qnsId: '',
qnsContent: '',
@@ -74,11 +107,17 @@
// 题类型
const subject_type_text = computed(() => SUBJECT_TYPE.find(res => subject_data.qnsTyp === res.value)?.label || '')
const changePlay = (id) => {
console.log('changePlay');
questionValue.value = id
// emit('handleEvents', 'changePlay', props.talkingInfo, id)
}
</script>
<style scoped lang="scss">
.option_div {
padding-top: 46rpx;
}
.item {
// height: 170rpx;
+1
View File
@@ -120,6 +120,7 @@ import { onUnload } from '@dcloudio/uni-app';
if(unref(dataInfo).intrctWay === '02'){
itemVoice.value = unref(dataInfo).talkingVoice
talkVoiceObj.value.src = itemVoice.value
console.log(talkVoiceObj.value.src,1111)
setTimeout(()=>{
setVoiceTime(0)
},100)