调试多v多房间功能

This commit is contained in:
kron
2026-02-05 18:06:55 +08:00
parent 93c549109f
commit 4cfa097cc8
7 changed files with 32 additions and 121 deletions

View File

@@ -36,10 +36,12 @@ const updateTimer = (value) => {
};
onMounted(() => {
audioManager.play("请射箭测试距离");
timer.value = setInterval(() => {
if (count.value > 0) count.value -= 1;
else clearInterval(timer.value);
}, 1000);
if (props.isBattle) {
timer.value = setInterval(() => {
count.value -= 1;
if (count.value < 0) clearInterval(timer.value);
}, 1000);
}
uni.$on("update-timer", updateTimer);
});
onBeforeUnmount(() => {
@@ -117,11 +119,12 @@ onBeforeUnmount(() => {
</view>
<view v-if="isBattle" class="ready-timer">
<image src="../static/test-tip.png" mode="widthFix" />
<view>
<view v-if="count >= 0">
<text>具体正式比赛还有</text>
<text>{{ count }}</text>
<text></text>
</view>
<view v-else> 进入中... </view>
</view>
</view>
</template>