fix; bug
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
# h5专用地址x2
|
||||
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
|
||||
|
||||
|
||||
@@ -246,6 +246,7 @@
|
||||
|
||||
const storageStore = useStorageStore();
|
||||
const audioCacheObj = computed(() => storageStore.audioObj);
|
||||
const isGettingId = computed(() => storageStore.getGettingVoiceId);
|
||||
const props = defineProps({
|
||||
type: {
|
||||
default: 0, // 1: userAnswer 0: AIAnswer
|
||||
@@ -581,6 +582,7 @@
|
||||
talkVoiceObj.value.src = url;
|
||||
talkVoiceObj.value.play();
|
||||
} else {
|
||||
storageStore.setStorage('setGettingVoiceId', unref(dataInfo)?.id);
|
||||
downloadVoiceFile(_url)
|
||||
.then((res) => {
|
||||
if (res?.data) {
|
||||
@@ -590,11 +592,15 @@
|
||||
voiceLoading.value = false;
|
||||
itemVoice.value = res.tempFilePath;
|
||||
talkVoiceObj.value.src = res.tempFilePath;
|
||||
talkVoiceObj.value.play();
|
||||
// 判斷是否在當前頁面
|
||||
// unref(dataInfo)?.id
|
||||
if(unref(isGettingId) === unref(dataInfo)?.id){
|
||||
talkVoiceObj.value.play();
|
||||
}
|
||||
storageStore.setStorage('audio', _url + _params.teachNo, itemVoice.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
voiceLoading.value = false;
|
||||
voiceLoading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -810,6 +810,8 @@
|
||||
teacherVoiceObj?.stop()
|
||||
teacherVoiceObj.src = ''
|
||||
} catch {}
|
||||
|
||||
storageStore.setStorage('setGettingVoiceId', '');
|
||||
// common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => {
|
||||
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
|
||||
// }).finally(() => {})
|
||||
|
||||
@@ -10,7 +10,8 @@ export const useStorageStore = defineStore('storageStore',{
|
||||
showPreviewDetail: false,
|
||||
fileType: 'iamge',
|
||||
fileId: '',
|
||||
fileSrc: ''
|
||||
fileSrc: '',
|
||||
gettingVoiceId: ''
|
||||
}),
|
||||
getters:{
|
||||
imgObj(state){
|
||||
@@ -37,8 +38,14 @@ export const useStorageStore = defineStore('storageStore',{
|
||||
getFileSrc(state){
|
||||
return state.fileSrc
|
||||
},
|
||||
getGettingVoiceId(state){
|
||||
return state.gettingVoiceId
|
||||
},
|
||||
},
|
||||
actions:{
|
||||
setGettingVoiceId(id){
|
||||
return this.gettingVoiceId = id
|
||||
},
|
||||
setShowPreviewDetail({ status = false, fileType = 'image', fileId = '', fileSrc = '' }){
|
||||
this.showPreviewDetail = status
|
||||
this.fileId = fileId
|
||||
|
||||
Reference in New Issue
Block a user