Merge branch 'feat-vip' into test

This commit is contained in:
2026-06-18 16:24:47 +08:00
70 changed files with 3253 additions and 410 deletions
+7 -2
View File
@@ -30,6 +30,7 @@ const { user } = storeToRefs(store);
const start = ref(false);
const scores = ref([]);
const isSvip = ref(false);
const total = 36;
/** 当前练习中连续 10 环及以上计数,用于触发 tententen 音效 */
const xRingStreak = ref(0);
@@ -47,7 +48,8 @@ onLoad((options) => {
const onReady = async () => {
await startPractiseAPI();
scores.value = [];
xRingStreak.value = 0; // 新一局开始,重置 10 环及以上连续计数
isSvip.value = false;
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
start.value = true;
audioManager.play("练习开始");
};
@@ -82,6 +84,7 @@ function checkAndPlayTententen(isTenPlusRingShot) {
async function onReceiveMessage(msg) {
if (msg.type === MESSAGETYPESV2.ShootResult) {
const prevLen = scores.value.length;
isSvip.value = msg.sVip === true;
scores.value = msg.details;
// 有新箭时取最后一箭判断是否 10 环及以上并检测连续计数
if (scores.value.length > prevLen) {
@@ -120,7 +123,8 @@ async function onComplete() {
practiseResult.value = {};
start.value = false;
scores.value = [];
xRingStreak.value = 0; // 重新开始练习,重置 10 环及以上连续计数
isSvip.value = false;
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
const result = await createPractiseAPI(total, 3600);
if (result) practiseId.value = result.id;
}
@@ -179,6 +183,7 @@ onBeforeUnmount(() => {
:currentRound="scores.length"
:totalRound="start ? total : 0"
:scores="scores"
:isSvip="isSvip"
/>
<ScorePanel
v-if="start"