From 04711aa24251a1f084bef0d1f2481e45d4448167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 1 Dec 2025 20:34:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/sparring/tip.vue | 93 ++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 33 deletions(-) diff --git a/src/pages/sparring/tip.vue b/src/pages/sparring/tip.vue index 30d0534b..11e014f3 100644 --- a/src/pages/sparring/tip.vue +++ b/src/pages/sparring/tip.vue @@ -12,8 +12,9 @@ 内容由AI生成 - + @@ -24,9 +25,11 @@ {{ detailInfo.chaName }} {{ detailInfo.chaAge }}岁 - + - + @@ -58,8 +61,8 @@ {{ detailInfo.sceneDesc }} - @@ -70,7 +73,7 @@ + :isLoading="!answerIsOver" :isDisabled="false" v-if="detailInfo.traInterTyp === '01'" /> @@ -123,11 +126,15 @@ storeToRefs } from 'pinia'; import TalkingItem from './components/talking-item.vue' - import badge from '@/components/points-and-badge/badge'; + import badge from '@/components/points-and-badge/badge'; import points from '@/components/points-and-badge/points'; import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge'; - const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge(); - + const { + pointAndBadgesRun, + badgeRef, + pointsRef + } = usePointsAndBadge(); + const socketStore = useSocketStore(); const { @@ -145,12 +152,12 @@ const showRoleInfo = ref(false) const showLoading = ref(true) const talkingList = ref([]) - // { - // type: 'answer', - // talkingText: 'asad我是回答内容', - // isLoading: false, - // id: new Date().getTime(), - // }, + // { + // type: 'answer', + // talkingText: 'asad我是回答内容', + // isLoading: false, + // id: new Date().getTime(), + // }, const askData = ref({}) const execId = ref('') const answerIsOver = ref(true); @@ -227,7 +234,8 @@ // #endif } const toTalking = () => { - common.navigateTo('/pages/sparring/talk?traId=' + traId.value + '&chaId=' + chaId.value+ '&type=' + talkingType.value+ '&isPreview=' + (isPreview.value?'1':'0')) + common.navigateTo('/pages/sparring/talk?traId=' + traId.value + '&chaId=' + chaId.value + '&type=' + talkingType + .value + '&isPreview=' + (isPreview.value ? '1' : '0')) } const activeVoiceTalkingItemId = ref('') // 关闭播放状态 @@ -259,7 +267,7 @@ const answerText = ref('') const touchBtnCallBack = ref(null) const initsocketTask = () => { - let _src = isPreview.value ?'/trapractice/previewsocket/open':'/trapractice/partnersocket/open' + let _src = isPreview.value ? '/trapractice/previewsocket/open' : '/trapractice/partnersocket/open' socketStore.creatSocket(_src + '?summary='); // unref(SocketObj).on('open', (res)=>{ // if(!answerIsOver.value){ @@ -306,7 +314,7 @@ traId: traId.value, chaId: chaId.value, traTyp: talkingType.value, - execId: execId.value||'' + execId: execId.value || '' } }); return; @@ -356,12 +364,12 @@ if (body.event === 'start') { answerIsOver.value = false; answerText.value = ''; - talkingList.value.pop(); + talkingList.value.pop(); talkingList.value.push({ type: 'answer', talkingText: answerText.value, isLoading: false, - execLogId: body.execLogId||'', + execLogId: body.execLogId || '', id: _id + 'ans', ...body, askData: { @@ -409,22 +417,29 @@ const goBack = () => { if (detailInfo.value.traInterTyp === '01') { overTalking() - }else{ + } else { common.navigateBack() } } const overTalking = () => { - common.show('提示','确定结束陪练吗?').then(res => { + common.show('提示', '确定结束陪练吗?').then(res => { if (res) { partnerChatReportTrigger({ execId: execId.value, traId: traId.value, - talkingType: isPreview.value? 'preview' : 'practice' - }).then(res=>{ + 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':'')) + 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':'')) // }) @@ -447,6 +462,12 @@ }); onUnload(() => { watchFlag.value = 1; + sendMessage({ + commond: 'ASK-STOP', + body: { + execId: execId.value || '' + } + }) socketStore?.closeSocket(); }); onMounted(() => { @@ -510,7 +531,7 @@ left: 0; z-index: 2; - .top-desc{ + .top-desc { position: absolute; bottom: 0; font-size: 18rpx; @@ -518,6 +539,7 @@ left: 50%; transform: translateX(-50%); } + .top-title { height: 90rpx; // background-color: red; @@ -575,10 +597,11 @@ padding: 10rpx 24rpx 20rpx; box-sizing: border-box; overflow-y: auto; - - &.talking-type1{ + + &.talking-type1 { padding: 10rpx 24rpx 140rpx; } + .body-content-role { background-color: #fff; border-radius: 16rpx; @@ -741,17 +764,20 @@ text-align: center; } } - .talking-box{ + + .talking-box { padding-top: 24rpx; } } - .over-btn-box{ + + .over-btn-box { position: absolute; bottom: 180rpx; height: 140rpx; padding: 0 23rpx; width: 100%; - .over-btn{ + + .over-btn { float: right; width: 194rpx; height: 76rpx; @@ -759,10 +785,11 @@ border: 2rpx solid #06f; border-radius: 15rpx; text-align: center; - color:#06f; + color: #06f; margin-top: 34rpx; } } + .body-bottom { height: 180rpx; background-color: #fff;