diff --git a/src/common/common.js b/src/common/common.js index a5dd98c7..3384863f 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -59,8 +59,9 @@ const navigateBack = (delta = 1, fun = () => {}) => { } //关闭当前页面,跳转到应用内的某个页面。 -const redirectTo = url => uni.redirectTo({ - url: url +const redirectTo = (url, obj = {}) => uni.redirectTo({ + url: url, + ...obj }); // 时间转换时间戳 diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 5d786f41..40566429 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -317,9 +317,11 @@ const audioCacheObj = computed(() => storageStore.audioObj) // 重播 const restartPlay = () => { if(itemVoice.value){ + emit('changePlay', '') emit('changePlay', unref(dataInfo)?.id) setTimeout(()=>{ talkVoiceObj.value.src = itemVoice.value + talkVoiceObj.value.seek(0) talkVoiceObj.value.play() },100) }else{ diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index fb819dba..1dfd20a1 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -112,6 +112,7 @@ const showOverlayTalking = (obj) => { } } const hideOverlayTalking = (obj) => { + if(!showTalkingModel.value) return showTalkingModel.value = false //#ifdef APP-PLUS stopRecord() diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index cfa8209c..1507122d 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -21,7 +21,8 @@ {{item.teacherName}} 描述:{{item.voiceDesc || '--'}} - + + @@ -243,6 +244,7 @@ teacherVoiceObj.onEnded(()=>{ activeVoiceTeachNo.value = '' teacherVoiceObj.src = '' }) +const loadingTeacherVoice = ref(false) const playTeacherVoice = (item) =>{ teacherVoiceObj.stop() teacherVoiceObj.src = '' @@ -253,12 +255,15 @@ const playTeacherVoice = (item) =>{ teacherVoiceObj.src = item.voicePath teacherVoiceObj.play() }else{ + loadingTeacherVoice.value = true storageStore.getStorageById('audio', item.teacherNo, (url)=>{ if(url){ - teacherVoiceObj.src = _cache + teacherVoiceObj.src = url teacherVoiceObj.play() + loadingTeacherVoice.value = false }else{ downloadVoiceFile('/trastudy/traStdyInfo/trialListening?teachNo='+item.teacherNo).then(res=>{ + loadingTeacherVoice.value = false item.voicePath = res.tempFilePath teacherVoiceObj.src = item.voicePath teacherVoiceObj.play() @@ -675,17 +680,6 @@ const withdrawNow = (data) => { const loadingQstLogId = ref('') // 完成 const finishQuestionNow = (data) => { - let _id1 = new Date().getTime() + 'id' - talkingList.value.push({ - id: _id1, - talkingContent: '完成', - userInfo: {...choiceTeacherInfo.value}, - type: 0 - }) - // waitMakeEvaluateApi({ - // qstLogId: data.qstLogId - // }) - textChartApi({ processType: 'ANSER-OVER', requestBody: JSON.stringify({ @@ -694,6 +688,18 @@ const finishQuestionNow = (data) => { }) .then(res=> { // common.msg('完成成功,开始获取评分维度数据!') + let _state = res.body.chatBody.processStat + if(_state = 'ER'){ + common.msg('提交答案失败!') + return + } + let _id1 = new Date().getTime() + 'id' + talkingList.value.push({ + id: _id1, + talkingContent: '完成', + userInfo: {...choiceTeacherInfo.value}, + type: 0 + }) loadingQstLogId.value = res.body.chatBody.qstLogId qstLogId.value = loadingQstLogId.value let _id = new Date().getTime() + 'id' @@ -711,10 +717,6 @@ const finishQuestionNow = (data) => { // 查询问题回答评分 const getQuestionEvalateRequest = (id, data) => { if(loadingQstLogId.value){ - // queryQuestionEvalateApi({ - // qstLogId:loadingQstLogId.value - // }) - textChartApi({ processType: 'ANSER-RESULT', requestBody: JSON.stringify({ @@ -957,6 +959,7 @@ const chooseRateNow = (item) => { .talking-gif{ width: 140rpx; height: 40rpx; + margin-right: 20rpx; // background-color: #ccc; background: url(@/static/images/course/voice-gray.png) no-repeat; background-size: 100%; diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 162fcd8a..8f13c5af 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -84,7 +84,7 @@ 课程中心 - + AI问答