update:个人训练优化

This commit is contained in:
2026-08-14 17:13:23 +08:00
parent d662db9465
commit e7f073ed7c
25 changed files with 481 additions and 344 deletions
+13 -3
View File
@@ -67,6 +67,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
enableShotEffect: {
type: Boolean,
default: true,
},
});
const pMode = ref(true);
@@ -113,7 +117,13 @@ function hasShotPoint(shot) {
}
function shouldPlayShotEffect(shot) {
return props.isSvip && !!shot && Number(shot.ring) > 0 && hasShotPoint(shot);
return (
props.enableShotEffect &&
props.isSvip &&
!!shot &&
Number(shot.ring) > 0 &&
hasShotPoint(shot)
);
}
function clearTipTimer() {
@@ -276,7 +286,7 @@ watch(
const latestShot = props.scores[newLen - 1];
if (shouldPlayShotEffect(latestShot)) {
void prepareShotEffect("red", latestShot, newLen - 1);
} else {
} else if (props.enableShotEffect) {
shotEffectRequestGeneration += 1;
pendingShotEffect.value = null;
showShotTip("red", latestShot);
@@ -301,7 +311,7 @@ watch(
const latestShot = props.blueScores[newLen - 1];
if (shouldPlayShotEffect(latestShot)) {
void prepareShotEffect("blue", latestShot, newLen - 1);
} else {
} else if (props.enableShotEffect) {
shotEffectRequestGeneration += 1;
pendingShotEffect.value = null;
showShotTip("blue", latestShot);