From 845b8b5571cfdc9f68fc2beb27b223bad8807c9c Mon Sep 17 00:00:00 2001 From: hiyu Date: Sat, 15 Jun 2024 21:42:52 +0700 Subject: [PATCH] fix: lottery --- src/components/lottery/LotteryGame.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/lottery/LotteryGame.vue b/src/components/lottery/LotteryGame.vue index f392720..3f52467 100644 --- a/src/components/lottery/LotteryGame.vue +++ b/src/components/lottery/LotteryGame.vue @@ -56,7 +56,7 @@ const countDownTime = new CountDown(0, (hh, mm, ss, t) => { const io = socket(); -io.emit("join", `game_${id}`); +io.emit("join", id); io.on("game-info", (data) => { const { name, session, end } = data; @@ -134,6 +134,14 @@ watch(amount, (value) => { }); }); +watch(countChoices, (newVal, oldVal) => { + if(newVal > 0 && oldVal == 0) { + isShowOrder.value = true; + } else if(newVal == 0 && oldVal > 0) { + isShowOrder.value = false; + } +}); + const formatResultText1 = (r) => { const s = r.split(",").reduce((prev, curr) => { return prev + (curr >> 0); @@ -153,7 +161,7 @@ const formatResultText2 = (r) => {