update:优化个人练习

This commit is contained in:
2026-07-09 18:29:04 +08:00
parent 82eedc3ab8
commit 58a7bb2017
5 changed files with 48 additions and 3 deletions
+15
View File
@@ -16,6 +16,7 @@ import audioManager from "@/audioManager";
import {
createPractiseAPI,
getPractiseAPI,
startPractiseAPI,
} from "@/apis";
import { connectMatchWebSocket, closeMatchWebSocket } from "@/matchWebsocket";
import { sharePractiseData } from "@/canvas";
@@ -71,7 +72,21 @@ const createPractise = async () => {
return result;
};
const beginPractise = async () => {
if (!practiseId.value) {
uni.showToast({
title: "练习未创建,请重试",
icon: "none",
});
return false;
}
await startPractiseAPI(practiseId.value);
return true;
};
const onReady = async () => {
const result = await beginPractise();
if (!result) return;
scores.value = [];
isSvip.value = false;
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数