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
+6
View File
@@ -29,6 +29,7 @@ const { user, online } = storeToRefs(store);
const title = ref("");
const start = ref(null);
const battleId = ref("");
const targetType = ref(20);
/** 对战模式:1=好友约战 2=排位赛,用于结算页跳转判断 */
const way = ref(0);
const currentRound = ref(1);
@@ -254,6 +255,8 @@ watch(online, (newVal, oldVal) => {
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"
/>
<ShootProgress
:show="start"
@@ -490,6 +495,7 @@ onShow(() => {
:totalRound="12"
:scores="playersScores.map((r) => r[user.id]).flat()"
:isSvip="isCurrentUserSvip"
:targetType="targetType"
:stop="halfRest"
stable-shot-effect
/>