update:vip完成

This commit is contained in:
2026-06-18 16:18:55 +08:00
parent 68f13910a3
commit 8d8ede5397
41 changed files with 1054 additions and 107 deletions

View File

@@ -30,6 +30,7 @@ const { user } = storeToRefs(store);
const start = ref(false);
const scores = ref([]);
const isSvip = ref(false);
const total = 36;
/** 当前练习中连续 X 环计数,用于触发 tententen 音效 */
const xRingStreak = ref(0);
@@ -47,6 +48,7 @@ onLoad((options) => {
const onReady = async () => {
await startPractiseAPI();
scores.value = [];
isSvip.value = false;
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
start.value = true;
audioManager.play("练习开始");
@@ -78,6 +80,7 @@ function checkAndPlayTententen(isXRing) {
async function onReceiveMessage(msg) {
if (msg.type === MESSAGETYPESV2.ShootResult) {
const prevLen = scores.value.length;
isSvip.value = msg.sVip === true;
scores.value = msg.details;
// 有新箭时取最后一箭判断是否 X 环并检测连续计数
if (scores.value.length > prevLen) {
@@ -116,6 +119,7 @@ async function onComplete() {
practiseResult.value = {};
start.value = false;
scores.value = [];
isSvip.value = false;
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
const result = await createPractiseAPI(total, 3600);
if (result) practiseId.value = result.id;
@@ -175,6 +179,7 @@ onBeforeUnmount(() => {
:currentRound="scores.length"
:totalRound="start ? total : 0"
:scores="scores"
:isSvip="isSvip"
/>
<ScorePanel
v-if="start"