搜索页等

This commit is contained in:
田岩
2025-08-28 16:54:52 +08:00
parent caa4a8b1ec
commit bbfd232ae8
23 changed files with 550 additions and 617 deletions
+8 -18
View File
@@ -29,12 +29,10 @@
style="width: 100%; height: 100%"
></image>
</view>
<view class="text-btn" @click.stop="translateVoice()"></view>
<view class="text-btn" v-if="!textShow" @click.stop="translateVoice()"></view>
<view class="fl1"></view>
<view class="btns-cont-button-text" @click.stop="buutton_click('again')">重答</view>
<view class="btns-cont-button-text" @click.stop="buutton_click('complete')">完成</view>
<!-- <view class="icon text-btn" v-if="type === 1" @click.stop="translateVoice(dataInfo)"></view> -->
</view>
</view>
<!-- 01纯文字 -->
@@ -45,20 +43,6 @@
</text>
</view>
<view class="btns-cont">
<!-- <view class="play-btn">
<image
class="icon"
@click="playVoice"
src="@/static/images/course/play-blue.png"
style="width: 100%; height: 100%"
></image>
<image
class="icon"
@click.stop="pauseVoice"
src="@/static/images/course/stop-blue.png"
style="width: 100%; height: 100%"
></image>
</view> -->
<view class="fl1"></view>
<view class="btns-cont-button-text" @click.stop="buutton_click('again')">重答</view>
<view class="btns-cont-button-text" @click.stop="buutton_click('complete')">完成</view>
@@ -100,6 +84,10 @@
status: {
default: '',
type: String
},
isPreview: { // 是否是预览语音
default: false,
type: Boolean
}
});
@@ -151,9 +139,10 @@
console.log('点击播放');
audioStore.playAudio();
};
let unsubscribe = () =>{};
onMounted(() => {
// 2. 监听 Store 中 isPlaying 的变化,实时同步
const unsubscribe = audioStore.$subscribe((mutation, state) => {
unsubscribe = audioStore.$subscribe((mutation, state) => {
isPlaying.value = state.isPlaying;
});
// 注册播放完成回调
@@ -185,6 +174,7 @@
audioStore.stopAudio();
// 2. 移除当前组件注册的回调(避免内存泄漏)
audioStore.removeCallbacks();
unsubscribe();
});
</script>
+6 -5
View File
@@ -9,7 +9,7 @@
<view class="mark_and_feedback_div" v-if="['examination', 'practice'].includes(props.mode)">
<image
v-if="props.mode === 'examination'"
:src="markIcon(props.item.mark ? '#0066FF' : '#ABABAB')"
:src="markIcon(props.item.mark ? '#e8b531' : '#ABABAB')"
class="img"
@click="mark_click()"
></image>
@@ -32,8 +32,9 @@
<questionVue
:status="subject_data.es_status"
:dataInfo="props.item?.my_answer"
:isPreview="props.isPreview"
:activeVoiceId="subject_data.qnsId"
@buutton_click="questionBuuttonClick"
@buutton_click="questionButtonClick"
></questionVue>
</template>
<template v-else>
@@ -212,8 +213,8 @@
set: (val) => {}
});
// 按钮
const questionBuuttonClick = (type, submitObj) => {
// 语音播放组件小按钮
const questionButtonClick = (type, submitObj) => {
console.log('type', type, submitObj);
// 判断点击的是什么
if (type === 'complete') {
@@ -224,7 +225,7 @@
emit('subject_click', type, {
qnsTyp: props.item.qnsTyp,
qnsId: props.item.qnsId,
answer: item_answer.value,
answer: submitObj,
answerItems: []
});
};