JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_fix: 视频播放问题处理
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ ENV = 'development'
|
|||||||
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||||
|
|
||||||
|
|
||||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||||
|
|
||||||
|
|
||||||
# DEV
|
# DEV
|
||||||
|
|||||||
+3
-3
@@ -47,7 +47,7 @@ export const getPreviewFileUrl = (id) => {
|
|||||||
return get_base_url() + `/traoss/tras3/show/${id}`
|
return get_base_url() + `/traoss/tras3/show/${id}`
|
||||||
}
|
}
|
||||||
// 对象存储下载 /traoss/tras3/show/{文件ID}
|
// 对象存储下载 /traoss/tras3/show/{文件ID}
|
||||||
export function downloadFile(id) {
|
export function downloadFile(id = '', url = '') {
|
||||||
const token = getToken();
|
const token = getToken();
|
||||||
const header = {
|
const header = {
|
||||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||||
@@ -55,10 +55,10 @@ export function downloadFile(id) {
|
|||||||
if (token)
|
if (token)
|
||||||
header['summary'] = token
|
header['summary'] = token
|
||||||
let baseUrl = get_base_url();
|
let baseUrl = get_base_url();
|
||||||
|
let _url = id?`${baseUrl}/traoss/tras3/show/${id}?tk=${token}`:`${url}?tk=${token}`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: `${baseUrl}/traoss/tras3/show/${id}`,
|
url: _url,
|
||||||
header,
|
header,
|
||||||
success(result) {
|
success(result) {
|
||||||
resolve(result)
|
resolve(result)
|
||||||
|
|||||||
@@ -171,7 +171,6 @@
|
|||||||
const focus = (event) => {
|
const focus = (event) => {
|
||||||
isShow.value = true
|
isShow.value = true
|
||||||
isFocus.value = true
|
isFocus.value = true
|
||||||
console.log('focusevent');
|
|
||||||
if(!isReply.value){
|
if(!isReply.value){
|
||||||
getMemList()
|
getMemList()
|
||||||
}
|
}
|
||||||
@@ -185,7 +184,6 @@
|
|||||||
})
|
})
|
||||||
const resStart = ref(-1)
|
const resStart = ref(-1)
|
||||||
const blur = (event) => {
|
const blur = (event) => {
|
||||||
console.log('失去焦点不一定关闭',event);
|
|
||||||
// popHeight.value = '0px'
|
// popHeight.value = '0px'
|
||||||
resStart.value = event.detail.cursor
|
resStart.value = event.detail.cursor
|
||||||
isShow.value = true
|
isShow.value = true
|
||||||
@@ -193,7 +191,6 @@
|
|||||||
}
|
}
|
||||||
const hideAll = (flag=false) => {
|
const hideAll = (flag=false) => {
|
||||||
popHeight.value = '0px'
|
popHeight.value = '0px'
|
||||||
console.log('hideAll');
|
|
||||||
isShow.value = false
|
isShow.value = false
|
||||||
isFocus.value = false
|
isFocus.value = false
|
||||||
if(flag){
|
if(flag){
|
||||||
@@ -245,7 +242,6 @@
|
|||||||
const extension = url.slice(lastDotIndex + 1).split('?')[0].toLowerCase()
|
const extension = url.slice(lastDotIndex + 1).split('?')[0].toLowerCase()
|
||||||
return ['png', 'jpg'].includes(extension)
|
return ['png', 'jpg'].includes(extension)
|
||||||
})
|
})
|
||||||
console.log(tempFilePaths,valid)
|
|
||||||
if (!valid) return common.msg('您选择的图片格式有误。')
|
if (!valid) return common.msg('您选择的图片格式有误。')
|
||||||
const data = {
|
const data = {
|
||||||
bizScen: 'S3005'
|
bizScen: 'S3005'
|
||||||
@@ -304,13 +300,10 @@
|
|||||||
bbsTag: bbsTag.value, // 评价标签 (SUG 建议 ASK 提问 )
|
bbsTag: bbsTag.value, // 评价标签 (SUG 建议 ASK 提问 )
|
||||||
bbsContent: value.value // 评价内容
|
bbsContent: value.value // 评价内容
|
||||||
}
|
}
|
||||||
console.log(_params)
|
|
||||||
publishCrsEvaluation(_params).then((res) => {
|
publishCrsEvaluation(_params).then((res) => {
|
||||||
const loadingDuration = Date.now() - loadingStartTime;
|
const loadingDuration = Date.now() - loadingStartTime;
|
||||||
const minLoadingTime = 700;
|
const minLoadingTime = 700;
|
||||||
console.log(loadingStartTime, loadingDuration);
|
|
||||||
const delayTime = Math.max(0, minLoadingTime - loadingDuration);
|
const delayTime = Math.max(0, minLoadingTime - loadingDuration);
|
||||||
console.log('delayTime', delayTime);
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
common.hideLoading();
|
common.hideLoading();
|
||||||
nextTick(() => common.msg('发表成功'));
|
nextTick(() => common.msg('发表成功'));
|
||||||
@@ -322,9 +315,7 @@
|
|||||||
emit('submitOver')
|
emit('submitOver')
|
||||||
}, 500);
|
}, 500);
|
||||||
}, delayTime);
|
}, delayTime);
|
||||||
}).catch(err=>{
|
}).catch(err=>{})
|
||||||
console.log(err)
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
const reply_send = async () => {
|
const reply_send = async () => {
|
||||||
emit('sendReply', {...answerData.value, bbsContent: value.value})
|
emit('sendReply', {...answerData.value, bbsContent: value.value})
|
||||||
@@ -351,10 +342,7 @@
|
|||||||
popHeight.value = val ? `${maxKeyboardHeight.value}px` : (keyboardHeight.value+'px')
|
popHeight.value = val ? `${maxKeyboardHeight.value}px` : (keyboardHeight.value+'px')
|
||||||
})
|
})
|
||||||
watch(()=> keyboardHeight.value,(val)=>{
|
watch(()=> keyboardHeight.value,(val)=>{
|
||||||
console.log(val,showEmoji.value)
|
|
||||||
console.log(maxKeyboardHeight.value)
|
|
||||||
popHeight.value = showEmoji.value ? `${maxKeyboardHeight.value}px` : keyboardHeight.value+'px'
|
popHeight.value = showEmoji.value ? `${maxKeyboardHeight.value}px` : keyboardHeight.value+'px'
|
||||||
console.log(popHeight.value)
|
|
||||||
})
|
})
|
||||||
defineExpose({hideAll, resetVal})
|
defineExpose({hideAll, resetVal})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -94,7 +94,10 @@
|
|||||||
},
|
},
|
||||||
srcList() {
|
srcList() {
|
||||||
return this.storageStore?.getFileSrcList
|
return this.storageStore?.getFileSrcList
|
||||||
}
|
},
|
||||||
|
isBase() {
|
||||||
|
return this.storageStore?.getIsBase
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
fileId: {
|
fileId: {
|
||||||
@@ -148,6 +151,11 @@
|
|||||||
},
|
},
|
||||||
initSrc(newval, oldval) {
|
initSrc(newval, oldval) {
|
||||||
let _src
|
let _src
|
||||||
|
if(this.isBase){
|
||||||
|
_src = newval
|
||||||
|
this.fileUrlShow = _src
|
||||||
|
return _src
|
||||||
|
}
|
||||||
if (newval.indexOf('http') === 0) {
|
if (newval.indexOf('http') === 0) {
|
||||||
_src = newval + '?tk=' + getToken()
|
_src = newval + '?tk=' + getToken()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -68,11 +68,13 @@
|
|||||||
<!-- <RadioSubjectRequest v-if="[8].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" /> -->
|
<!-- <RadioSubjectRequest v-if="[8].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" /> -->
|
||||||
<!-- 段落图片视频预览 -->
|
<!-- 段落图片视频预览 -->
|
||||||
<view v-if="type === 3" style="overflow: hidden;padding-top: 10rpx;">
|
<view v-if="type === 3" style="overflow: hidden;padding-top: 10rpx;">
|
||||||
<ImagePreview :class="['cont-img-box',imgAddrs.length === 1?'cont-video-box':imgAddrs.length === 2?'cont-img-box2':'']" v-for="item in imgAddrs "
|
<ImagePreview
|
||||||
:imgId="item" :previewDetail="false" @click="previewImage(item, imgAddrs)"></ImagePreview>
|
:class="['cont-img-box',imgAddrs.length === 1?'cont-video-box':imgAddrs.length === 2?'cont-img-box2':'']"
|
||||||
|
v-for="item in imgAddrs " :imgId="item" :previewDetail="false" @click="previewImage(item, imgAddrs)">
|
||||||
|
</ImagePreview>
|
||||||
<VideoPreview class="cont-img-box cont-video-box" v-if="(dataInfo.vidoAddrs || []).length > 0"
|
<VideoPreview class="cont-img-box cont-video-box" v-if="(dataInfo.vidoAddrs || []).length > 0"
|
||||||
:fileId="dataInfo.vidoAddrs[0].vidAddr"
|
:fileId="dataInfo.vidoAddrs[0].vidAddr" :picId="dataInfo.vidoAddrs[0].vidImgAddr"
|
||||||
:picId="dataInfo.vidoAddrs[0].vidImgAddr" @click="previewVideo(dataInfo.vidoAddrs[0])">
|
@click="previewVideo(dataInfo.vidoAddrs[0])">
|
||||||
</VideoPreview>
|
</VideoPreview>
|
||||||
<view class="file-items" v-if="(dataInfo.fileData || []).length > 0">
|
<view class="file-items" v-if="(dataInfo.fileData || []).length > 0">
|
||||||
<view class="file-item" v-for="item in dataInfo.fileData" @click="previewFile(item)">
|
<view class="file-item" v-for="item in dataInfo.fileData" @click="previewFile(item)">
|
||||||
@@ -234,7 +236,8 @@
|
|||||||
downloadVoiceFile,
|
downloadVoiceFile,
|
||||||
downloadVoiceParams,
|
downloadVoiceParams,
|
||||||
uploadVoiceFile,
|
uploadVoiceFile,
|
||||||
getAudioByText
|
getAudioByText,
|
||||||
|
downloadFile
|
||||||
} from '@/api/common.js';
|
} from '@/api/common.js';
|
||||||
import {
|
import {
|
||||||
studyParagraphOverApi,
|
studyParagraphOverApi,
|
||||||
@@ -245,6 +248,7 @@
|
|||||||
import ChartFive from './chartFive.vue';
|
import ChartFive from './chartFive.vue';
|
||||||
import common from '@/common/common';
|
import common from '@/common/common';
|
||||||
import {
|
import {
|
||||||
|
getPhoneEnvBool,
|
||||||
getUserInfo
|
getUserInfo
|
||||||
} from '@/common/common';
|
} from '@/common/common';
|
||||||
import {
|
import {
|
||||||
@@ -337,7 +341,7 @@
|
|||||||
...(dataInfo.value?.traQnsInfoVo || {}),
|
...(dataInfo.value?.traQnsInfoVo || {}),
|
||||||
my_answer: dataInfo.value?.traQnsInfoVo?.anserResult || '',
|
my_answer: dataInfo.value?.traQnsInfoVo?.anserResult || '',
|
||||||
answerMethod: props.answerMethod,
|
answerMethod: props.answerMethod,
|
||||||
...(props.type === 5?{
|
...(props.type === 5 ? {
|
||||||
"qnsTyp": "ES",
|
"qnsTyp": "ES",
|
||||||
my_answer: dataInfo.value,
|
my_answer: dataInfo.value,
|
||||||
itemVos: [{
|
itemVos: [{
|
||||||
@@ -346,18 +350,18 @@
|
|||||||
"qnsId": dataInfo.value.qnsId,
|
"qnsId": dataInfo.value.qnsId,
|
||||||
"itemAnswer": dataInfo.value.itemAnswer,
|
"itemAnswer": dataInfo.value.itemAnswer,
|
||||||
"relKeyword": dataInfo.value.relKeyword,
|
"relKeyword": dataInfo.value.relKeyword,
|
||||||
anserResult:dataInfo.value?.traQnsInfoVo?.anserResult || '',
|
anserResult: dataInfo.value?.traQnsInfoVo?.anserResult || '',
|
||||||
"evalSettingVos": dataInfo.value?.essayEvalVo,
|
"evalSettingVos": dataInfo.value?.essayEvalVo,
|
||||||
}]
|
}]
|
||||||
}:{})
|
} : {})
|
||||||
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const mode = computed(()=>{
|
const mode = computed(() => {
|
||||||
return props.type == 5 ? 'study_answer' : props.type == 8 ? 'study_result' : 'study'
|
return props.type == 5 ? 'study_answer' : props.type == 8 ? 'study_result' : 'study'
|
||||||
}); // 考试 examination 练习practice 学习study 学习结果study_answer
|
}); // 考试 examination 练习practice 学习study 学习结果study_answer
|
||||||
|
|
||||||
const imgAddrs = computed(()=>{
|
const imgAddrs = computed(() => {
|
||||||
return (dataInfo.value.imageAddrs || [])
|
return (dataInfo.value.imageAddrs || [])
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -424,16 +428,16 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (type.value === 5) {
|
if (type.value === 5) {
|
||||||
if(dataInfo.value.stdyStat !== 'Y' && dataInfo.value.isLastQns === 'Y'){
|
if (dataInfo.value.stdyStat !== 'Y' && dataInfo.value.isLastQns === 'Y') {
|
||||||
return false
|
return false
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type.value === 8) {
|
if (type.value === 8) {
|
||||||
if(dataInfo.value.stdyStat !== 'Y' && dataInfo.value.isLastQns === 'Y'){
|
if (dataInfo.value.stdyStat !== 'Y' && dataInfo.value.isLastQns === 'Y') {
|
||||||
return false
|
return false
|
||||||
}else{
|
} else {
|
||||||
return !!dataInfo.value.traQnsInfoVo?.judgeResult;
|
return !!dataInfo.value.traQnsInfoVo?.judgeResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -467,19 +471,36 @@
|
|||||||
return str.replace(/\/n/g, '\n');
|
return str.replace(/\/n/g, '\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
const previewVideo = (obj)=>{
|
const previewVideo = async (obj) => {
|
||||||
console.log(obj)
|
const IsAndEnv = getPhoneEnvBool('AND');
|
||||||
storageStore.setShowPreviewDetail({
|
if (IsAndEnv) {
|
||||||
status: true,
|
storageStore.setShowPreviewDetail({
|
||||||
fileType: 'video',
|
status: true,
|
||||||
fileId: '',
|
fileType: 'video',
|
||||||
fileSrc: obj.vidAddr
|
fileId: '',
|
||||||
})
|
isBase: false,
|
||||||
|
fileSrc: obj.vidAddr
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
common.loading('加载中');
|
||||||
|
try {
|
||||||
|
const _res = await downloadFile('', obj.vidAddr)
|
||||||
|
storageStore.setShowPreviewDetail({
|
||||||
|
status: true,
|
||||||
|
fileType: 'video',
|
||||||
|
fileId: '',
|
||||||
|
isBase: _res.tempFilePath ? true : false,
|
||||||
|
fileSrc: _res.tempFilePath || obj.vidAddr
|
||||||
|
})
|
||||||
|
} catch {} finally {
|
||||||
|
common.hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const previewImage = (obj, arr=[])=>{
|
const previewImage = (obj, arr = []) => {
|
||||||
storageStore.setShowPreviewDetail({
|
storageStore.setShowPreviewDetail({
|
||||||
status: true,
|
status: true,
|
||||||
fileType: arr.length>0?'imageList':'image',
|
fileType: arr.length > 0 ? 'imageList' : 'image',
|
||||||
fileId: '',
|
fileId: '',
|
||||||
fileSrc: obj,
|
fileSrc: obj,
|
||||||
fileSrcList: arr
|
fileSrcList: arr
|
||||||
@@ -495,15 +516,13 @@
|
|||||||
});
|
});
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
// pauseVoice();
|
// pauseVoice();
|
||||||
console.log('onUnload')
|
|
||||||
talkVoiceObj.value?.destroy()
|
talkVoiceObj.value?.destroy()
|
||||||
if(downloadFnc.value && downloadFnc.value.abord) downloadFnc.value?.abord()
|
if (downloadFnc.value && downloadFnc.value.abord) downloadFnc.value?.abord()
|
||||||
downloadFnc.value = null
|
downloadFnc.value = null
|
||||||
});
|
});
|
||||||
onHide(() => {
|
onHide(() => {
|
||||||
console.log('onHide')
|
|
||||||
voiceLoading.value = false;
|
voiceLoading.value = false;
|
||||||
if(downloadFnc.value && downloadFnc.value.abord) downloadFnc.value?.abord()
|
if (downloadFnc.value && downloadFnc.value.abord) downloadFnc.value?.abord()
|
||||||
downloadFnc.value = null
|
downloadFnc.value = null
|
||||||
});
|
});
|
||||||
let prevTime = -1;
|
let prevTime = -1;
|
||||||
@@ -513,7 +532,7 @@
|
|||||||
talkVoiceObj.value.onEnded(() => {
|
talkVoiceObj.value.onEnded(() => {
|
||||||
console.log('onEnded');
|
console.log('onEnded');
|
||||||
voiceIsPlaying.value = false
|
voiceIsPlaying.value = false
|
||||||
if(props.activeVoiceId){
|
if (props.activeVoiceId) {
|
||||||
emit('changePlay', '');
|
emit('changePlay', '');
|
||||||
}
|
}
|
||||||
prevTime = -1;
|
prevTime = -1;
|
||||||
@@ -524,7 +543,7 @@
|
|||||||
console.log('onStop');
|
console.log('onStop');
|
||||||
voiceLoading.value = false;
|
voiceLoading.value = false;
|
||||||
voiceIsPlaying.value = false
|
voiceIsPlaying.value = false
|
||||||
if(props.activeVoiceId){
|
if (props.activeVoiceId) {
|
||||||
emit('changePlay', '');
|
emit('changePlay', '');
|
||||||
}
|
}
|
||||||
prevTime = -1;
|
prevTime = -1;
|
||||||
@@ -536,7 +555,7 @@
|
|||||||
voiceLoading.value = false;
|
voiceLoading.value = false;
|
||||||
prevTime = talkVoiceObj.value.currentTime;
|
prevTime = talkVoiceObj.value.currentTime;
|
||||||
pauseTime = prevTime
|
pauseTime = prevTime
|
||||||
if(downloadFnc.value && downloadFnc.value.abord) downloadFnc.value?.abord()
|
if (downloadFnc.value && downloadFnc.value.abord) downloadFnc.value?.abord()
|
||||||
downloadFnc.value = null
|
downloadFnc.value = null
|
||||||
});
|
});
|
||||||
talkVoiceObj.value.onPlay(() => {
|
talkVoiceObj.value.onPlay(() => {
|
||||||
@@ -545,9 +564,9 @@
|
|||||||
pauseTime = prevTime
|
pauseTime = prevTime
|
||||||
startPlay.value = true
|
startPlay.value = true
|
||||||
voiceIsPlaying.value = true
|
voiceIsPlaying.value = true
|
||||||
setTimeout(()=> {
|
setTimeout(() => {
|
||||||
startPlay.value= false
|
startPlay.value = false
|
||||||
},300)
|
}, 300)
|
||||||
emit('changePlay', unref(dataInfo)?.id);
|
emit('changePlay', unref(dataInfo)?.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -559,8 +578,9 @@
|
|||||||
prevTime = talkVoiceObj.value.currentTime;
|
prevTime = talkVoiceObj.value.currentTime;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (props.isPlaying && (talkVoiceObj.value.currentTime > 0) && props.activeVoiceId && !startPlay.value) {
|
if (props.isPlaying && (talkVoiceObj.value.currentTime > 0) && props.activeVoiceId && !startPlay
|
||||||
console.log(pauseTime , prevTime)
|
.value) {
|
||||||
|
console.log(pauseTime, prevTime)
|
||||||
emit('changePlay', '');
|
emit('changePlay', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -597,7 +617,7 @@
|
|||||||
const downloadFnc = ref(null)
|
const downloadFnc = ref(null)
|
||||||
const playVoice = (readType = 'pgth') => {
|
const playVoice = (readType = 'pgth') => {
|
||||||
console.log('playVoice11111111')
|
console.log('playVoice11111111')
|
||||||
if(voiceIsPlaying.value) return
|
if (voiceIsPlaying.value) return
|
||||||
let _content = showContent.value;
|
let _content = showContent.value;
|
||||||
if (!_content) {
|
if (!_content) {
|
||||||
common.msg('没有可以播放的文字信息!');
|
common.msg('没有可以播放的文字信息!');
|
||||||
@@ -607,14 +627,14 @@
|
|||||||
emit('changePlay', unref(dataInfo)?.id);
|
emit('changePlay', unref(dataInfo)?.id);
|
||||||
// readType 阅读内容类型pgrh段落/qns问题
|
// readType 阅读内容类型pgrh段落/qns问题
|
||||||
if (talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) {
|
if (talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) {
|
||||||
if(voiceIsPlaying.value) return
|
if (voiceIsPlaying.value) return
|
||||||
talkVoiceObj.value.play();
|
talkVoiceObj.value.play();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
talkVoiceObj.value.src = '';
|
talkVoiceObj.value.src = '';
|
||||||
if (itemVoice.value) {
|
if (itemVoice.value) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if(voiceIsPlaying.value) return
|
if (voiceIsPlaying.value) return
|
||||||
talkVoiceObj.value.src = itemVoice.value;
|
talkVoiceObj.value.src = itemVoice.value;
|
||||||
talkVoiceObj.value.play();
|
talkVoiceObj.value.play();
|
||||||
}, 100);
|
}, 100);
|
||||||
@@ -666,7 +686,7 @@
|
|||||||
if (url) {
|
if (url) {
|
||||||
voiceLoading.value = false;
|
voiceLoading.value = false;
|
||||||
itemVoice.value = url;
|
itemVoice.value = url;
|
||||||
if(voiceIsPlaying.value) return
|
if (voiceIsPlaying.value) return
|
||||||
talkVoiceObj.value.src = url;
|
talkVoiceObj.value.src = url;
|
||||||
talkVoiceObj.value.play();
|
talkVoiceObj.value.play();
|
||||||
} else {
|
} else {
|
||||||
@@ -681,10 +701,10 @@
|
|||||||
}
|
}
|
||||||
voiceLoading.value = false;
|
voiceLoading.value = false;
|
||||||
itemVoice.value = res.tempFilePath;
|
itemVoice.value = res.tempFilePath;
|
||||||
if(voiceIsPlaying.value) return
|
if (voiceIsPlaying.value) return
|
||||||
talkVoiceObj.value.src = res.tempFilePath;
|
talkVoiceObj.value.src = res.tempFilePath;
|
||||||
// 判斷是否在當前頁面
|
// 判斷是否在當前頁面
|
||||||
if(unref(isGettingId) === unref(dataInfo)?.id){
|
if (unref(isGettingId) === unref(dataInfo)?.id) {
|
||||||
talkVoiceObj.value.play();
|
talkVoiceObj.value.play();
|
||||||
storageStore.setStorage('audio', _url + _params.teachNo, itemVoice.value);
|
storageStore.setStorage('audio', _url + _params.teachNo, itemVoice.value);
|
||||||
}
|
}
|
||||||
@@ -748,11 +768,11 @@
|
|||||||
const setVoiceTime = (sum) => {
|
const setVoiceTime = (sum) => {
|
||||||
plus.io.getAudioInfo({
|
plus.io.getAudioInfo({
|
||||||
filePath: unref(dataInfo).talkingVoice,
|
filePath: unref(dataInfo).talkingVoice,
|
||||||
success:(res)=>{
|
success: (res) => {
|
||||||
voiceTime.value = (Math.floor(res.duration) || 1) + 's'
|
voiceTime.value = (Math.floor(res.duration) || 1) + 's'
|
||||||
},
|
},
|
||||||
fail:(res)=>{
|
fail: (res) => {
|
||||||
voiceTime.value = (unref(dataInfo).voiceTime || 1) + 's'
|
voiceTime.value = (unref(dataInfo).voiceTime || 1) + 's'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -809,16 +829,16 @@
|
|||||||
clickNow();
|
clickNow();
|
||||||
if ([5, 8].indexOf(props.type) >= 0) {
|
if ([5, 8].indexOf(props.type) >= 0) {
|
||||||
// 完成问题
|
// 完成问题
|
||||||
if(dataInfo.value.stdyStat === 'Y' && dataInfo.value.isLastQns === 'Y'){
|
if (dataInfo.value.stdyStat === 'Y' && dataInfo.value.isLastQns === 'Y') {
|
||||||
emit('nextQuestion', unref(dataInfo), 'overNextGraph');
|
emit('nextQuestion', unref(dataInfo), 'overNextGraph');
|
||||||
}else{
|
} else {
|
||||||
emit('nextQuestion', unref(dataInfo));
|
emit('nextQuestion', unref(dataInfo));
|
||||||
}
|
}
|
||||||
} else if ([3].indexOf(props.type) >= 0) {
|
} else if ([3].indexOf(props.type) >= 0) {
|
||||||
// 完成段落
|
// 完成段落
|
||||||
if(unref(dataInfo).hasQns !=='Y'){
|
if (unref(dataInfo).hasQns !== 'Y') {
|
||||||
emit('nextQuestion', unref(dataInfo), 'overNextGraph');
|
emit('nextQuestion', unref(dataInfo), 'overNextGraph');
|
||||||
}else{
|
} else {
|
||||||
emit('nextQuestion', unref(dataInfo), 'overGraph');
|
emit('nextQuestion', unref(dataInfo), 'overGraph');
|
||||||
}
|
}
|
||||||
} else if ([9].indexOf(props.type) >= 0) {
|
} else if ([9].indexOf(props.type) >= 0) {
|
||||||
@@ -972,10 +992,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-items{
|
.file-items {
|
||||||
float: left;
|
float: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 12rpx;
|
padding-top: 12rpx;
|
||||||
|
|
||||||
.file-item {
|
.file-item {
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@@ -994,18 +1015,21 @@
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
|
||||||
&.cont-video-box{
|
&.cont-video-box {
|
||||||
width: 433rpx;
|
width: 433rpx;
|
||||||
height: 269rpx;
|
height: 269rpx;
|
||||||
margin-right: 0rpx;
|
margin-right: 0rpx;
|
||||||
}
|
}
|
||||||
&:nth-child(3n){
|
|
||||||
|
&:nth-child(3n) {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
&.cont-img-box2{
|
|
||||||
|
&.cont-img-box2 {
|
||||||
width: calc(50% - 10rpx);
|
width: calc(50% - 10rpx);
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
&:nth-child(2n){
|
|
||||||
|
&:nth-child(2n) {
|
||||||
margin-right: 0rpx;
|
margin-right: 0rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export const useStorageStore = defineStore('storageStore',{
|
|||||||
fileId: '',
|
fileId: '',
|
||||||
fileSrc: '',
|
fileSrc: '',
|
||||||
fileSrcList: [],
|
fileSrcList: [],
|
||||||
|
isBase: false,
|
||||||
gettingVoiceId: ''
|
gettingVoiceId: ''
|
||||||
}),
|
}),
|
||||||
getters:{
|
getters:{
|
||||||
@@ -46,17 +47,21 @@ export const useStorageStore = defineStore('storageStore',{
|
|||||||
getGettingVoiceId(state){
|
getGettingVoiceId(state){
|
||||||
return state.gettingVoiceId
|
return state.gettingVoiceId
|
||||||
},
|
},
|
||||||
|
getIsBase(state){
|
||||||
|
return state.isBase
|
||||||
|
}
|
||||||
},
|
},
|
||||||
actions:{
|
actions:{
|
||||||
setGettingVoiceId(id){
|
setGettingVoiceId(id){
|
||||||
return this.gettingVoiceId = id
|
return this.gettingVoiceId = id
|
||||||
},
|
},
|
||||||
setShowPreviewDetail({ status = false, fileType = 'image', fileId = '', fileSrc = '', fileSrcList = [] }){
|
setShowPreviewDetail({ status = false, fileType = 'image', fileId = '', fileSrc = '', fileSrcList = [], isBase = false }){
|
||||||
this.showPreviewDetail = status
|
this.showPreviewDetail = status
|
||||||
this.fileId = fileId
|
this.fileId = fileId
|
||||||
this.fileType = fileType
|
this.fileType = fileType
|
||||||
this.fileSrc = fileSrc
|
this.fileSrc = fileSrc
|
||||||
this.fileSrcList = fileSrcList
|
this.fileSrcList = fileSrcList
|
||||||
|
this.isBase = isBase
|
||||||
},
|
},
|
||||||
setTouchBtnZIndex(index = 12){
|
setTouchBtnZIndex(index = 12){
|
||||||
this.touchBtnZIndex = index
|
this.touchBtnZIndex = index
|
||||||
|
|||||||
Reference in New Issue
Block a user