update:优化个人练习
This commit is contained in:
@@ -16,6 +16,7 @@ import audioManager from "@/audioManager";
|
||||
import {
|
||||
createPractiseAPI,
|
||||
getPractiseAPI,
|
||||
startPractiseAPI,
|
||||
laserAimAPI,
|
||||
laserCloseAPI,
|
||||
} from "@/apis";
|
||||
@@ -134,6 +135,18 @@ const onOver = async (message) => {
|
||||
start.value = false;
|
||||
};
|
||||
|
||||
const beginPractise = async () => {
|
||||
if (!practiseId.value) {
|
||||
uni.showToast({
|
||||
title: "练习未创建,请重试",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
await startPractiseAPI(practiseId.value);
|
||||
return true;
|
||||
};
|
||||
|
||||
async function onReceiveMessage(msg) {
|
||||
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
isSvip.value = msg.sVip === true;
|
||||
@@ -229,6 +242,8 @@ const nextStep = async () => {
|
||||
title.value = "-小试牛刀";
|
||||
} else if (step.value === 4) {
|
||||
title.value = "小试牛刀";
|
||||
const result = await beginPractise();
|
||||
if (!result) return;
|
||||
scores.value = [];
|
||||
isSvip.value = false;
|
||||
step.value = 5;
|
||||
|
||||
Reference in New Issue
Block a user