update:新版本websocket

This commit is contained in:
2026-07-10 13:57:09 +08:00
parent 58a7bb2017
commit b5373bee31
11 changed files with 216 additions and 31 deletions
+18
View File
@@ -15,6 +15,7 @@ import audioManager from "@/audioManager";
import {
createPractiseAPI,
endPractiseAPI,
getPractiseAPI,
startPractiseAPI,
} from "@/apis";
@@ -40,6 +41,7 @@ const showGuide = ref(false);
const tips = ref("");
const targetType = ref(1);
const sharing = ref(false);
const exiting = ref(false);
const RESULT_TIP_CDN = "https://static.shelingxingqiu.com/shootmini/static";
onLoad((options) => {
@@ -155,6 +157,21 @@ async function onComplete() {
}
}
async function exitPractise() {
if (exiting.value) return;
exiting.value = true;
try {
if (practiseId.value && !practiseResult.value?.details) {
await endPractiseAPI(practiseId.value);
}
} catch (error) {
console.error("Failed to stop practice", error);
} finally {
uni.navigateBack();
}
}
const getResultTipSrc = (result = {}) => {
const validCount = (result.details || []).filter(
(arrow) => arrow.x !== -30 && arrow.y !== -30
@@ -204,6 +221,7 @@ onBeforeUnmount(() => {
:bgType="1"
title="个人单组练习"
:showBottom="!start && !scores.length"
:onBack="exitPractise"
>
<view>
<TestDistance v-if="!start && !practiseResult.id" />