pinia 版本降级

This commit is contained in:
yanghang
2025-07-01 15:59:50 +08:00
parent 1f9b7091ac
commit fee07ada90
4 changed files with 48 additions and 130 deletions
+12 -8
View File
@@ -44,11 +44,11 @@
src="@/static/images/course/play.png"
style="width: 100%;height: 100%;"
@click="playVoice"
v-show="props.activeVoiceId !== dataInfo.id"
v-show="!isPlaying"
></image>
<image
class="icon"
v-show="props.activeVoiceId === dataInfo.id"
v-show="isPlaying"
src="@/static/images/course/pause.png"
style="width: 100%;height: 100%;"
@click="pauseVoice"
@@ -86,12 +86,12 @@
<view class="play-btn">
<image class="icon"
@click="playQnsVoice('qns', dataInfo)"
v-show="props.activeVoiceId !== dataInfo.id"
v-show="!isPlaying"
src="@/static/images/course/play-blue.png"
style="width: 100%;height: 100%;"
></image>
<image class="icon"
v-show="props.activeVoiceId === dataInfo.id"
v-show="isPlaying"
@click="pauseVoice"
src="@/static/images/course/stop-blue.png"
style="width: 100%;height: 100%;"
@@ -148,15 +148,19 @@ import { getUserInfo } from '@/common/common';
isLast:{
default:false,
type: Boolean
}
},
isPlaying:{
default:false,
type: Boolean
},
})
const { type, dataInfo, activeVoiceId } = toRefs(props)
const { type, dataInfo, activeVoiceId, isPlaying, isLast} = toRefs(props)
const emit = defineEmits(['changePlay', 'nextQuestion'])
// 声音播放初始化
const talkVoiceObj = ref(uni.createInnerAudioContext())
const userInfo = computed(() => getUserInfo())
watch(() => props.activeVoiceId,(val) => {
if(val && (val !== unref(dataInfo).id)){
watch(() => props.isPlaying,(val) => {
if(!val){
talkVoiceObj.value?.stop()
}
},{
+3 -2
View File
@@ -49,6 +49,7 @@
:type="item.type"
:dataInfo="item"
:activeVoiceId="activeVoiceTalkingItemId"
:isPlaying="activeVoiceTalkingItemId === item.id"
@changePlay="changePlayItemId"
@nextQuestion="nextQuestionSuccess"
:id="'item' + item.id"
@@ -139,7 +140,7 @@ const talkingList = ref([])
const activeVoiceTalkingItemId = ref('')
const answerValue = ref('')
const inputRef = ref('')
// 初始化数据
const getData = async () => {
try{
const { body } = await getCourseStudyInfoApi({crsId: crsId.value})
@@ -205,7 +206,7 @@ const changePlayItemId = (id) => {
activeVoiceTalkingItemId.value = id
}
}
// 选择的教师对象信息
const choiceTeacherInfo = computed(()=>{
return teacherList.value.find(t=> t.teacherNo === choiceTeacher.value)
})