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
@@ -14,6 +14,7 @@ import audioManager from "@/audioManager";
import {
createPractiseAPI,
endPractiseAPI,
getPractiseAPI,
startPractiseAPI,
} from "@/apis";
@@ -39,6 +40,7 @@ const practiseId = ref("");
const showGuide = ref(false);
const targetType = ref(1);
const sharing = ref(false);
const exiting = ref(false);
const RESULT_TIP_CDN = "https://static.shelingxingqiu.com/shootmini/static";
onLoad((options) => {
@@ -170,6 +172,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
@@ -218,6 +235,7 @@ onBeforeUnmount(() => {
:bgType="1"
title="日常耐力挑战"
:showBottom="!start && !scores.length"
:onBack="exitPractise"
>
<view>
<TestDistance v-if="!start && !practiseResult.id" />