From 3de1524aa9fdedc4e9208a1cd0bed671471e32c9 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Fri, 24 Oct 2025 16:48:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8A=BD=E5=A5=96=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E9=A1=B5):=2010=E8=BF=9E=E6=8A=BD=E5=8A=A8=E7=94=BB=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BA=E8=BD=AC=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Activities/Lottery/Lottery.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/views/Activities/Lottery/Lottery.vue b/src/views/Activities/Lottery/Lottery.vue index e1f70a3..95fa774 100644 --- a/src/views/Activities/Lottery/Lottery.vue +++ b/src/views/Activities/Lottery/Lottery.vue @@ -1156,29 +1156,29 @@ const sweepstakes = async (consecutive) => { if (consecutive == 1) { const resOnceDraw = await onceDraw(data) if (resOnceDraw.status && resOnceDraw.body) { - const resItem = resOnceDraw.body //接口获取的抽奖结果 + result.value.push(resOnceDraw.body) + + const resItem = resOnceDraw.body //接口获取的抽奖结果(单抽为对象) + //取抽奖结果的位置 const index = activity.value.prizeList.findIndex( (prize) => prize.prizeName == resItem?.prize.prizeName ) //转盘第几位停下 console.log('index:', index) await startLottery(index) - result.value.push(resItem) } } //连抽 else { const resMultiDraw = await multiDraw(data) if (resMultiDraw.status && resMultiDraw.body) { - const resDrawList = resMultiDraw.body //连抽获取的抽奖列表结果 - for (let i = 0; i < resDrawList.results.length; i++) { - const resItem = resDrawList.results[i] - const index = activity.value.prizeList.findIndex( - (prize) => prize.prizeName == resItem?.prize.prizeName - ) //转盘第几位停下 - console.log('index:', index) - await startLottery(index) - result.value.push(resItem) - } + result.value = resMultiDraw.body.results + + //取第一个抽奖结果的位置 + let index = activity.value.prizeList.findIndex( + (prize) => prize.prizeName == result.value[0]?.prize.prizeName + ) + console.log('index:', index) + await startLottery(index) } } getTickets() //重新获取拥有的抽奖券