diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue
index ebd37d2..77127b9 100644
--- a/src/components/BowTarget.vue
+++ b/src/components/BowTarget.vue
@@ -51,6 +51,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
+ targetType: {
+ type: [Number, String],
+ default: 40,
+ },
targetRadius: {
type: Number,
default: 20,
@@ -426,12 +430,19 @@ function getExperienceTipStyle(shot) {
);
}
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);
}
};
diff --git a/src/components/TestDistance.vue b/src/components/TestDistance.vue
index 13ce54f..37b3b42 100644
--- a/src/components/TestDistance.vue
+++ b/src/components/TestDistance.vue
@@ -29,6 +29,10 @@ const props = defineProps({
type: Number,
default: 15,
},
+ targetType: {
+ type: [Number, String],
+ default: 40,
+ },
autoStart: {
type: Boolean,
default: false,
@@ -105,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(() => {
diff --git a/src/pages/first-try.vue b/src/pages/first-try.vue
index b767cb3..f66dd2a 100644
--- a/src/pages/first-try.vue
+++ b/src/pages/first-try.vue
@@ -114,7 +114,7 @@ const createPractise = async (arrows) => {
const result = await createPractiseAPI(
arrows,
120,
- 1,
+ 2,
device.value.deviceId
);
if (result) practiseId.value = result.id;
@@ -384,7 +384,7 @@ const getResultTipSrc = (result = {}) => {
请完成以上步骤校准智能弓
-
+
{
:totalRound="step === 5 ? total : 0"
:scores="scores"
:isSvip="isSvip"
+ :targetType="40"
+ stable-shot-effect
/>
{
function recoverData(battleInfo, { force = false } = {}) {
battleInfo = normalizeBattleInfo(battleInfo);
if (!battleInfo) return;
+ const nextTargetType = Number(battleInfo.targetType ?? battleInfo.target_type);
+ if ([20, 40].includes(nextTargetType)) targetType.value = nextTargetType;
if (battleInfo.status !== undefined) {
battleEnded = [2, 4].includes(Number(battleInfo.status));
}
@@ -374,6 +377,7 @@ function onMatchSocketState(event) {
}
onLoad(async (options) => {
+ targetType.value = 20;
const returnSnapshot = options.fromReturn ? takeMatchReturnSnapshot() : null;
skipNextRestoreOnShow = false;
if (returnSnapshot?.matchId) battleId.value = returnSnapshot.matchId;
@@ -468,6 +472,7 @@ onShow(() => {
:guide="false"
:isBattle="true"
:count="readyTime"
+ :targetType="targetType"
/>
{
:totalRound="12"
:scores="playersScores.map((r) => r[user.id]).flat()"
:isSvip="isCurrentUserSvip"
+ :targetType="targetType"
:stop="halfRest"
stable-shot-effect
/>
diff --git a/src/pages/practise-one.vue b/src/pages/practise-one.vue
index 96a4462..3ed5de1 100644
--- a/src/pages/practise-one.vue
+++ b/src/pages/practise-one.vue
@@ -1,5 +1,5 @@