接口参数修改

This commit is contained in:
kron
2025-11-17 14:15:06 +08:00
parent d9563a25c6
commit bb8f1c715e
4 changed files with 9 additions and 6 deletions

View File

@@ -194,9 +194,10 @@ export const getMyDevicesAPI = () => {
return request("GET", "/user/device/getBindings");
};
export const createPractiseAPI = (arrows) => {
export const createPractiseAPI = (arrows, mode) => {
return request("POST", "/user/practice/create", {
arrows,
mode,
});
};

View File

@@ -56,7 +56,7 @@ const onSwiperIndexChange = (index) => {
};
const createPractise = async (arrows) => {
const result = await createPractiseAPI(arrows);
const result = await createPractiseAPI(arrows, 1);
if (result) practiseId.value = result.id;
};

View File

@@ -31,7 +31,7 @@ const wait = ref(0);
const timer = ref(null);
const onReady = async () => {
const result = await createPractiseAPI(total);
const result = await createPractiseAPI(total, 2);
if (result) practiseId.value = result.id;
currentRound.value = 0;
scores.value = [];
@@ -71,13 +71,15 @@ async function onReceiveMessage(messages = []) {
}, 1500);
}
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
wait.value = msg.wait;
if (msg.wait === 20) {
uni.$emit("update-ramain", 0);
wait.value = msg.wait;
for (let i = 0; i < 6; i++) {
if (!scores.value[i]) scores.value[i] = { x: -30, y: -30, ring: 0 };
}
}
if (msg.wait === 0) {
let count = 60;
wait.value = msg.wait;
uni.$emit("update-ramain", count);
audioManager.play("练习开始");
if (!timer.value) {

View File

@@ -26,7 +26,7 @@ const practiseId = ref("");
const showGuide = ref(false);
const onReady = async () => {
const result = await createPractiseAPI(total);
const result = await createPractiseAPI(total, 3);
if (result) practiseId.value = result.id;
scores.value = [];
start.value = true;