From ebd473703fe1260784bac031ea1684b86fe0cacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 15 Dec 2025 17:18:24 +0800 Subject: [PATCH 1/9] =?UTF-8?q?fix=EF=BC=9A=E5=9B=9E=E7=AD=94=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development.yh | 4 +-- .../sparring/components/talking-item.vue | 35 +++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.env.development.yh b/.env.development.yh index 95d4857d..193ce295 100644 --- a/.env.development.yh +++ b/.env.development.yh @@ -4,8 +4,8 @@ ENV = 'development.yh' # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' -# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786' -VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786' +# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' # VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' # VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604' # VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603' diff --git a/src/pages/sparring/components/talking-item.vue b/src/pages/sparring/components/talking-item.vue index a5f307cd..5e6b43ba 100644 --- a/src/pages/sparring/components/talking-item.vue +++ b/src/pages/sparring/components/talking-item.vue @@ -18,10 +18,12 @@ 回答提示 + {{tipsContent}} + @@ -92,6 +94,7 @@ const loadingTips = ref(false) const tipsContent = ref('') + const showContent = ref(false) const handleEvents = (type, info = {}) => { emit('handleEvents', { type, @@ -101,24 +104,28 @@ }) } const getTips = () => { - if(tipsContent.value){ - tipsContent.value = '' + if(showContent.value){ + showContent.value = false return } - loadingTips.value = true + showContent.value = true handleEvents('scrollToBottom') - partnerChatPrompt({ - execId: props.execId, - traId: props.traId, - content: props.talkingInfo.talkingText, - chaId: roleInfo.value?.chaId - }).then(res=>{ - tipsContent.value = res.body - loadingTips.value = false + if(!tipsContent.value){ + loadingTips.value = true handleEvents('scrollToBottom') - }).catch(()=> { - loadingTips.value =false - }) + partnerChatPrompt({ + execId: props.execId, + traId: props.traId, + content: props.talkingInfo.talkingText, + chaId: roleInfo.value?.chaId + }).then(res=>{ + tipsContent.value = res.body + loadingTips.value = false + handleEvents('scrollToBottom') + }).catch(()=> { + loadingTips.value =false + }) + } } const changePlay = (id) => { emit('handleEvents', { From 34ab7198e9b206b30503628d589f8f224058e0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Mon, 15 Dec 2025 18:46:39 +0800 Subject: [PATCH 2/9] fix: bug --- .env.development | 4 ++-- src/pages/sparring/components/touchBtn.vue | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index acccd2fd..3b4f755d 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ ENV = 'development' # VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' -#VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' +VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' # VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' @@ -14,7 +14,7 @@ ENV = 'development' # VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001' # VITE_APP_BASE_API_Url = 'http://192.168.108.129' # dev -VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' +# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' # sit #VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786' diff --git a/src/pages/sparring/components/touchBtn.vue b/src/pages/sparring/components/touchBtn.vue index ffb38177..c01eb183 100644 --- a/src/pages/sparring/components/touchBtn.vue +++ b/src/pages/sparring/components/touchBtn.vue @@ -221,7 +221,9 @@ } else { console.log(11, '验证停止方法不存在') isGettingPermission.value = false - closeModel(); + setTimeout(() => { + closeModel(); + }, 300) } } catch { console.log(12, '验证错误') From 66ed67f7b23e61a3083ba54af9387e43b5f355e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Tue, 16 Dec 2025 08:42:01 +0800 Subject: [PATCH 3/9] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/sparring/chooseRole.vue | 36 ++++++++++++++++++++----------- src/pages/sparring/detail.vue | 29 ++++++++++++++++++------- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/pages/sparring/chooseRole.vue b/src/pages/sparring/chooseRole.vue index b32783a6..7a2432da 100644 --- a/src/pages/sparring/chooseRole.vue +++ b/src/pages/sparring/chooseRole.vue @@ -33,7 +33,8 @@ import common from '@/common/common'; import ImagePreview from '@/components/image-preview/image-preview.vue'; import { - queryTraPartnerCharacterInfoList + queryTraPartnerCharacterInfoList, + checkTraPartnerInfoById } from "@/api/sparring.js" import CardSwiper from './components/card-swiper.vue'; const traId = ref('') @@ -41,10 +42,10 @@ const detailInfo = ref({}) const roleList = ref([]) const currentIndex = ref(0) - const activeRole = computed(()=>{ - if(roleList.value.length>0){ + const activeRole = computed(() => { + if (roleList.value.length > 0) { return roleList.value[currentIndex.value] - }else{ + } else { return {} } }) @@ -61,7 +62,16 @@ } const isPreview = ref(false) const toTip = () => { - common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + '&type=' + talkingType.value+ '&isPreview=' + (isPreview.value ?'1':'')) + checkTraPartnerInfoById({ + traId: traId.value + }).then(res => { + if (res.body.inRange) { + common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ? '1' : '')) + } else { + common.show('提示', res.body.message, false) + } + }) } onLoad((params) => { traId.value = params.traId; @@ -82,6 +92,7 @@ flex-direction: column; background-image: url(@/static/images/sparring/bg.png); background-size: cover; + .sparring-detail-body { position: absolute; overflow-x: hidden; @@ -169,6 +180,7 @@ overflow: hidden; } } + // .body-card { // flex: 1; // .card { @@ -182,7 +194,7 @@ // transition: all 0.3s ease; // position: relative; // padding: 50rpx 23rpx 23rpx; - + // .img-box { // width: 300rpx; // height: 300rpx; @@ -190,11 +202,11 @@ // overflow: hidden; // margin: 0 auto; // } - + // .card-content { // padding: 24rpx; // } - + // .card-title { // display: flex; // font-size: 29rpx; @@ -207,7 +219,7 @@ // text-align: center; // margin: 33rpx auto; // justify-content: center; - + // &-name{ // margin-right: 20rpx; // line-height: 44rpx; @@ -227,7 +239,7 @@ // width: 30rpx; // } // } - + // .card-item { // width: 100%; // display: block; @@ -254,11 +266,11 @@ // } // } // &-desc{ - + // } // } // } - + // } diff --git a/src/pages/sparring/detail.vue b/src/pages/sparring/detail.vue index e64fb579..84061a2a 100644 --- a/src/pages/sparring/detail.vue +++ b/src/pages/sparring/detail.vue @@ -18,7 +18,8 @@ 已陪练次数:{{ detailInfo.practiceTimes }} 类型:{{ detailInfo.traInterTypDesc }} - 截止时间:{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}} + + 截止时间:{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}} 通过分数:{{detailInfo.passGrade || 0}} 分 @@ -89,7 +90,8 @@ import common from '@/common/common' import ImagePreview from '@/components/image-preview/image-preview.vue' import { - queryTraPartnerInfoById + queryTraPartnerInfoById, + checkTraPartnerInfoById } from '@/api/sparring.js' import { previewFileFnc @@ -123,8 +125,17 @@ }) } const toChooseRole = type => { - common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + (isPreview - .value ? '1' : '')) + checkTraPartnerInfoById({ + traId: traId.value + }).then(res => { + if (res.body.inRange) { + common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + ( + isPreview + .value ? '1' : '')) + } else { + common.show('提示', res.body.message, false) + } + }) } const isPreview = ref(false) const scrollTop = ref(0) @@ -212,7 +223,7 @@ left: 50rpx; top: 33rpx; transform: translateY(-50%); - z-index: 10; + z-index: 10; } .back-icon::before, @@ -296,7 +307,8 @@ display: inline-block; width: 50%; margin-bottom: 15rpx; - &.full{ + + &.full { width: 100%; } } @@ -361,7 +373,8 @@ margin-left: 36rpx; background: #06f; color: #fff; - &.no-margin{ + + &.no-margin { margin-left: 0; } } @@ -395,7 +408,7 @@ line-height: 52rpx; color: #333; white-space: pre-line; - + &-file { color: #06f; } From f6f3020556aa53b41e5e67e5594150fb0c5c71dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Tue, 16 Dec 2025 10:12:59 +0800 Subject: [PATCH 4/9] fix: bug --- .env.development.yh | 4 +- src/pages/sparring/components/touchBtn.vue | 27 ++- src/pages/sparring/tip.vue | 246 ++++++++++++--------- 3 files changed, 151 insertions(+), 126 deletions(-) diff --git a/.env.development.yh b/.env.development.yh index 193ce295..95d4857d 100644 --- a/.env.development.yh +++ b/.env.development.yh @@ -4,8 +4,8 @@ ENV = 'development.yh' # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' -VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786' -# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' +# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786' +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' # VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' # VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604' # VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603' diff --git a/src/pages/sparring/components/touchBtn.vue b/src/pages/sparring/components/touchBtn.vue index c01eb183..0873009e 100644 --- a/src/pages/sparring/components/touchBtn.vue +++ b/src/pages/sparring/components/touchBtn.vue @@ -12,8 +12,7 @@ {{'语音对话'}} --> - + @@ -130,6 +129,7 @@ const isStartNum = ref(0); const isStopNum = ref(0); const isGettingPermission = ref(false) + const isHandleClosed = ref(false) const initRecord = () => { recordObjCom.value = uni.getRecorderManager(); unref(recordObjCom)?.onStop((res, duration) => { @@ -173,10 +173,10 @@ setTimeout(() => { startFlag.value = 2; }, 1000); - setRecordTime() - if (isStopNum.value === isStartNum.value) { + if ((isStopNum.value === isStartNum.value) || isHandleClosed.value) { stopRecord(); } else { + setRecordTime() showTalkingModel.value = true; } }); @@ -206,6 +206,7 @@ unref(recordObjCom).start({ format: formatType.value }); + // showTalkingModel.value = true; }; const stopRecord = () => { @@ -216,31 +217,31 @@ isGettingPermission.value = false }, 1000) console.log(10, '验证停止方法存在') - closeModel(); + closeModel(); unref(recordObjCom).stop(); } else { console.log(11, '验证停止方法不存在') isGettingPermission.value = false - setTimeout(() => { closeModel(); - }, 300) } } catch { console.log(12, '验证错误') isGettingPermission.value = false - closeModel(); + closeModel(); } }; const closeModel = (cb = () => {}) => { console.log(99, '关闭弹窗') isStopNum.value = isStartNum.value; - setTimeout(() => { - isTalking.value = false; - }, 800); + isHandleClosed.value = true setTimeout(() => { showTalkingModel.value = false; cb && cb(); - }, 350); + }, 300); + setTimeout(() => { + isTalking.value = false; + isHandleClosed.value = false + }, 1000); }; // #endif //#ifndef APP-PLUS @@ -334,7 +335,6 @@ }); return false } else if (_state === 'not determined') { - // startRecord() return true } else { return true @@ -383,7 +383,6 @@ touchY.value = obj.changedTouches[0].pageY; baseY.value = obj.currentTarget.offsetTop; //#ifdef APP-PLUS - // canStart.value = false startRecord(); // #endif setTimeout(() => { diff --git a/src/pages/sparring/tip.vue b/src/pages/sparring/tip.vue index 590dc959..15be2ae5 100644 --- a/src/pages/sparring/tip.vue +++ b/src/pages/sparring/tip.vue @@ -11,14 +11,9 @@ 内容由AI生成 - + @@ -28,16 +23,10 @@ {{ detailInfo.chaName }} {{ detailInfo.chaAge }}岁 - - + + @@ -74,45 +63,24 @@ -请点击下方按钮开始{{ detailInfo.traInterTypDesc }} - + 结束陪练 - + - + - - + + {{ detailInfo.traInterTypDesc }} @@ -125,27 +93,62 @@