update:优化新手教程

This commit is contained in:
2026-08-27 17:24:25 +08:00
parent b9bbaba77f
commit 469487ba73
12 changed files with 106 additions and 14 deletions
+13 -2
View File
@@ -56,6 +56,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
targetType: {
type: [Number, String],
default: 40,
},
coordinateRadius: {
type: Number,
default: 20,
@@ -433,12 +437,19 @@ watch(
);
const simulShoot = async () => {
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
if (device.value.deviceId) {
await simulShootAPI(
device.value.deviceId,
undefined,
undefined,
props.targetType
);
}
};
const simulShoot2 = async () => {
if (device.value.deviceId) {
const r1 = Math.random() > 0.5 ? 0.01 : 0.02;
await simulShootAPI(device.value.deviceId, r1, r1);
await simulShootAPI(device.value.deviceId, r1, r1, props.targetType);
}
};
@@ -109,7 +109,14 @@ async function onReceiveMessage(msg) {
}
const simulShoot = async () => {
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
if (device.value.deviceId) {
await simulShootAPI(
device.value.deviceId,
undefined,
undefined,
props.targetType
);
}
};
onMounted(() => {
+7 -1
View File
@@ -91,6 +91,11 @@ const tips = ref("");
const targetType = ref(defaultTargetType);
const trainingParams = ref({});
const practiceInfo = ref({});
const simulatorTargetType = computed(() => {
const currentTargetType = Number(practiceInfo.value.targetType);
if ([20, 40].includes(currentTargetType)) return currentTargetType;
return [2, 40].includes(Number(targetType.value)) ? 40 : 20;
});
const rhythmServerTimestamp = ref(0);
const rhythmFallbackWindowStart = ref(0);
const rhythmFallbackTimestamp = ref(0);
@@ -1768,7 +1773,7 @@ onBeforeUnmount(() => {
<view class="practise-content">
<TestDistance
v-if="isDistanceStage"
:targetType="practiceInfo.targetType"
:targetType="simulatorTargetType"
:autoStart="true"
@passed="onReady"
/>
@@ -1809,6 +1814,7 @@ onBeforeUnmount(() => {
:currentRound="scores.length % 3"
:scores="scores"
:isSvip="isSvip"
:targetType="simulatorTargetType"
:shotEffectToken="shotEffectToken"
:showCrosshair="false"
:sectorCount="precisionBlocks"