From da5a2cdfd269ee5819a063374ab54ce346688beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Thu, 12 Feb 2026 17:31:33 +0800 Subject: [PATCH] =?UTF-8?q?JLBA202505130001=5F=E5=85=B3=E4=BA=8E=E5=90=89?= =?UTF-8?q?=E6=9E=97=E9=93=B6=E8=A1=8C=E6=96=B0=E5=BB=BAAI=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E5=9F=B9=E8=AE=AD=E7=B3=BB=E7=BB=9F=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=5F=E5=90=88=E5=B9=B6=E5=AE=89=E5=8D=93ISO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.sit | 2 +- src/components/touch-btn/touch-btn.vue | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.env.sit b/.env.sit index 8e8ed9e9..57bb6db5 100644 --- a/.env.sit +++ b/.env.sit @@ -2,4 +2,4 @@ ENV = 'sit' # base api -VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' +VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' diff --git a/src/components/touch-btn/touch-btn.vue b/src/components/touch-btn/touch-btn.vue index 9581d1b8..3107971d 100644 --- a/src/components/touch-btn/touch-btn.vue +++ b/src/components/touch-btn/touch-btn.vue @@ -101,7 +101,7 @@ import { startAudioRecord, stopAudioRecord } from '@/uni_modules/ty-recording'; import { ProtocolCodec, MessageType, ControlCommand, ControlCode } from '@/pages/sparring/js/ProtocolCodec'; import permissionApi from '@/common/permission'; - + const emit = defineEmits(['submit']); const ws = ref(null); const status = ref('voice'); @@ -142,25 +142,22 @@ }); // 记录 按下移动位置 const touchPos = reactive({ x: 0, y: 0 }); - + // 计算是否超出按下盒子位置01代表下方盒子,02代表左上03代表右上 const isOutStatus = computed(() => { - if (touchPos.y < bottomAreaTopBoundary) { - if (touchPos.x < horizontalSplitX) return '02'; - else return '03'; - } else { - return '01'; - } + const { y: touchY, x: touchX } = touchPos; + if (touchY >= bottomAreaTopBoundary) return '01'; + return touchX < horizontalSplitX ? '02' : '03'; }); // 监听按下移动 const handleMove = (obj) => { - const changedTouche = obj.changedTouches[0]; - touchPos.x = changedTouche.pageX; - touchPos.y = changedTouche.pageY; + const { pageX, pageY } = obj.changedTouches[0]; + touchPos.x = pageX; + touchPos.y = pageY; }; const allText = ref(''); const tempText = ref(''); - + // 键盘还是语音 const keyboardIsShow = ref(false); const popupRef = ref(null); @@ -174,7 +171,6 @@ console.error('麦克风权限申请失败:', e); return; } - const changedTouche = obj.touches[0]; touchPos.x = changedTouche.clientX; touchPos.y = changedTouche.clientY;