feat(抽奖活动页): 10连抽动画调整为转一次
This commit is contained in:
parent
4715bfa089
commit
3de1524aa9
@ -1156,29 +1156,29 @@ const sweepstakes = async (consecutive) => {
|
|||||||
if (consecutive == 1) {
|
if (consecutive == 1) {
|
||||||
const resOnceDraw = await onceDraw(data)
|
const resOnceDraw = await onceDraw(data)
|
||||||
if (resOnceDraw.status && resOnceDraw.body) {
|
if (resOnceDraw.status && resOnceDraw.body) {
|
||||||
const resItem = resOnceDraw.body //接口获取的抽奖结果
|
result.value.push(resOnceDraw.body)
|
||||||
|
|
||||||
|
const resItem = resOnceDraw.body //接口获取的抽奖结果(单抽为对象)
|
||||||
|
//取抽奖结果的位置
|
||||||
const index = activity.value.prizeList.findIndex(
|
const index = activity.value.prizeList.findIndex(
|
||||||
(prize) => prize.prizeName == resItem?.prize.prizeName
|
(prize) => prize.prizeName == resItem?.prize.prizeName
|
||||||
) //转盘第几位停下
|
) //转盘第几位停下
|
||||||
console.log('index:', index)
|
console.log('index:', index)
|
||||||
await startLottery(index)
|
await startLottery(index)
|
||||||
result.value.push(resItem)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//连抽
|
//连抽
|
||||||
else {
|
else {
|
||||||
const resMultiDraw = await multiDraw(data)
|
const resMultiDraw = await multiDraw(data)
|
||||||
if (resMultiDraw.status && resMultiDraw.body) {
|
if (resMultiDraw.status && resMultiDraw.body) {
|
||||||
const resDrawList = resMultiDraw.body //连抽获取的抽奖列表结果
|
result.value = resMultiDraw.body.results
|
||||||
for (let i = 0; i < resDrawList.results.length; i++) {
|
|
||||||
const resItem = resDrawList.results[i]
|
//取第一个抽奖结果的位置
|
||||||
const index = activity.value.prizeList.findIndex(
|
let index = activity.value.prizeList.findIndex(
|
||||||
(prize) => prize.prizeName == resItem?.prize.prizeName
|
(prize) => prize.prizeName == result.value[0]?.prize.prizeName
|
||||||
) //转盘第几位停下
|
)
|
||||||
console.log('index:', index)
|
console.log('index:', index)
|
||||||
await startLottery(index)
|
await startLottery(index)
|
||||||
result.value.push(resItem)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getTickets() //重新获取拥有的抽奖券
|
getTickets() //重新获取拥有的抽奖券
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user