diff --git a/src/pages/sparring/tip.vue b/src/pages/sparring/tip.vue index 6526e28a..9bb0f7ec 100644 --- a/src/pages/sparring/tip.vue +++ b/src/pages/sparring/tip.vue @@ -200,8 +200,8 @@ isLoading: true }); scrollToBottomNow(); - // 设为提问中状态 - answerIsOver.value = false + // 设为提问中状态 + answerIsOver.value = false commonUploadVoiceFile(voicePath, '/trapractice/traPartnerChat/voiceTrans', {}) .then((_res) => { if (!!(_res.body.transContent || '').trim()) { @@ -296,8 +296,10 @@ common .show('提示信息', '网络环境不稳定,请重试!', false, '', '确认') .then((res) => { - reconcatNum.value += 1; - common.redirectTo(`/pages/index/dialog`); + overNow(()=>{ + reconcatNum.value += 1; + common.redirectTo(`/pages/index/dialog`); + }) }) .finally(() => { showModelComfirm.value = false; @@ -312,7 +314,7 @@ let _id = new Date().getTime() + 'id'; if (rtnCode === '0000') { if (commond === 'ASK-OPEN') { - console.log('ASK-OPEN!',body) + console.log('ASK-OPEN!', body) // 新连接 sendMessage({ commond: 'ASK-START', @@ -326,7 +328,7 @@ return; } if (commond === 'ASK-START') { - console.log('开启对话!',body) + console.log('开启对话!', body) execId.value = body.execId; return; } @@ -444,28 +446,35 @@ const overTalking = () => { common.show('提示', '确定结束陪练吗?').then(res => { if (res) { - partnerChatReportTrigger({ - execId: execId.value, - traId: traId.value, - talkingType: isPreview.value ? 'preview' : 'practice' - }).then(res => { - watchFlag.value = 1; - sendMessage({ - commond: 'ASK-STOP', - body: { - execId: execId.value || '' - } - }) - socketStore?.closeSocket(); - changePlayItemId('') - common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId - .value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ? '1' : '')) - // pointAndBadgesRun(talkingType.value === '01'? '07': '08', '', ()=>{ - // common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':'')) - // }) - }) + overNow() } }) + } + const overNow = (cb= ()=>{}) => { + partnerChatReportTrigger({ + execId: execId.value, + traId: traId.value, + talkingType: isPreview.value ? 'preview' : 'practice' + }).then(res => { + watchFlag.value = 1; + sendMessage({ + commond: 'ASK-STOP', + body: { + execId: execId.value || '' + } + }) + socketStore?.closeSocket(); + changePlayItemId('') + common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId + .value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ? '1' : '')) + // pointAndBadgesRun(talkingType.value === '01'? '07': '08', '', ()=>{ + // common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':'')) + // }) + }).catch(()=>{ + cb() + }) + + } const sendMessage = (data) => { unref(SocketObj).send(data); @@ -481,7 +490,7 @@ getDetailInfo() console.log('onLoad') //#ifdef APP-PLUS - plus.screen.lockOrientation('portrait-primary') + plus.screen.lockOrientation('portrait-primary') // #endif }); onUnload(() => {