fix ;bug
This commit is contained in:
@@ -436,18 +436,14 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
}
|
||||
const showNextBtn = ref(true)
|
||||
const showGoonBtn = computed(()=>{
|
||||
return showNextBtn.value && [3, 6].indexOf(props.type) >= 0 && isLast.value && !isPlaying.value
|
||||
return showNextBtn.value && [3, 6].indexOf(props.type) >= 0 && isLast.value // && !isPlaying.value
|
||||
})
|
||||
const goOnGetQues = () => {
|
||||
if(props.type === 5){
|
||||
// 完成问题
|
||||
emit('nextQuestion', unref(dataInfo))
|
||||
}else if(props.type === 3){
|
||||
// studyParagraphOverApi({
|
||||
// pgrphId:unref(dataInfo)?.pgrphId,
|
||||
// logId:unref(dataInfo)?.logId,
|
||||
// }).then(res=>{
|
||||
// showNextBtn.value = false
|
||||
// })
|
||||
// 完成段落
|
||||
emit('nextQuestion', unref(dataInfo), 'overGraph')
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,9 @@ const audioPath = ref('')
|
||||
const audioObj = uni.createInnerAudioContext()
|
||||
//#ifdef APP-PLUS
|
||||
// app端
|
||||
const recordObjCom = uni.getRecorderManager()
|
||||
const recordObjCom = ref({})
|
||||
const initRecord = () => {
|
||||
recordObjCom.value = uni.getRecorderManager()
|
||||
unref(recordObjCom)?.onStop((res, duration)=>{
|
||||
audioPath.value = res.tempFilePath
|
||||
})
|
||||
@@ -76,7 +77,7 @@ const stopRecord = () => {
|
||||
}
|
||||
// #endif
|
||||
//#ifndef APP-PLUS
|
||||
const recordObjCom = {}
|
||||
const recordObjCom = ref({})
|
||||
const initRecord = () => {}
|
||||
// #endif
|
||||
onMounted(async ()=>{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<uv-radio-group v-model="choiceTeacher">
|
||||
<view class="voice-item" v-for="item in teacherList" :key="item.teacherNo" @click="choiceTeacher = item.teacherNo">
|
||||
<view class="avatar-box">
|
||||
<ImagePreview class="img-box" :imgId="item.imgAddr" :isCache="true" :width="120" :height="160"></ImagePreview>
|
||||
<ImagePreview class="img-box" :src="item.imgAddr" :isCache="true" :width="120" :height="160"></ImagePreview>
|
||||
</view>
|
||||
<view class="right-cont">
|
||||
<view class="right-name">{{item.teacherName}}</view>
|
||||
@@ -82,7 +82,7 @@
|
||||
@uploadVoice="uploadRecordNow"
|
||||
@submitAnswer="submitAnswerNow"
|
||||
@startRecord="changePlayItemId('')"
|
||||
:isDisabled="(lastTalkingInfo.type||0) !== 4"
|
||||
:isDisabled="((lastTalkingInfo.type||0) !== 4) || isUploadingVoice"
|
||||
/>
|
||||
</view>
|
||||
<uv-overlay :show="showSeekModel" opacity=".6" @click="showSeekModel = false">
|
||||
@@ -162,6 +162,7 @@ const activeVoiceTalkingItemId = ref('')
|
||||
const answerValue = ref('')
|
||||
const inputRef = ref('')
|
||||
const flagVal = ref('1')
|
||||
const isUploadingVoice = ref(false)
|
||||
// 初始化数据
|
||||
const getData = async (flag) => {
|
||||
// if(flag === flagVal.value){
|
||||
@@ -171,7 +172,6 @@ const getData = async (flag) => {
|
||||
// }
|
||||
try{
|
||||
const { body } = await getCourseStudyInfoApi({crsId: crsId.value})
|
||||
console.log(body)
|
||||
initsocketTask()
|
||||
teacherList.value = body.teacheList.map(t=>({
|
||||
...t,
|
||||
@@ -584,7 +584,18 @@ onUnload(()=>{
|
||||
teacherVoiceObj?.stop?.()
|
||||
teacherVoiceObj.src = ''
|
||||
})
|
||||
const testAnswer = computed(()=>{
|
||||
if(talkingList.value.length < 5) return true
|
||||
let _arr = talkingList.value.slice(-5)
|
||||
let _num = _arr.map(t=>[1,2,6].indexOf(Number(t.type))>=0).filter(t => !!t)
|
||||
return _num.length < 5
|
||||
})
|
||||
const uploadRecordNow = (voicePath) => {
|
||||
if(!testAnswer.value){
|
||||
common.msg('每个问题最多连续发送五次答案!')
|
||||
return
|
||||
}
|
||||
isUploadingVoice.value = true
|
||||
let _data = {
|
||||
qnsId: unref(lastTalkingInfo).qnsId,// 问题ID 必输项:true 类型:String
|
||||
pgrphId: unref(lastTalkingInfo).pgrphId,// 段落ID 必输项:true 类型:String
|
||||
@@ -606,7 +617,8 @@ const uploadRecordNow = (voicePath) => {
|
||||
userInfo: {...choiceTeacherInfo.value},
|
||||
id: _id
|
||||
})
|
||||
scrollToBottomNow()
|
||||
isUploadingVoice.value = false
|
||||
scrollToBottomNow()
|
||||
// #endif
|
||||
//#ifdef APP-PLUS
|
||||
talkingList.value.push({
|
||||
@@ -648,7 +660,9 @@ const uploadRecordNow = (voicePath) => {
|
||||
})
|
||||
scrollToBottomNow()
|
||||
}else{}
|
||||
isUploadingVoice.value = false
|
||||
}).catch(err=>{
|
||||
isUploadingVoice.value = false
|
||||
talkingList.value = talkingList.value.filter(t=>t.id !== _id)
|
||||
uni.showToast({
|
||||
title: '系统异常,请联系管理员',
|
||||
@@ -660,6 +674,10 @@ const uploadRecordNow = (voicePath) => {
|
||||
}
|
||||
// 发送文本
|
||||
const submitAnswerNow = (val, cb) => {
|
||||
if(!testAnswer.value){
|
||||
common.msg('每个问题最多连续发送五次答案!')
|
||||
return
|
||||
}
|
||||
let _data = {
|
||||
qnsId: unref(lastTalkingInfo).qnsId,// 问题ID 必输项:true 类型:String
|
||||
pgrphId: unref(lastTalkingInfo).pgrphId,// 段落ID 必输项:true 类型:String
|
||||
|
||||
Reference in New Issue
Block a user