|
@ -45,24 +45,24 @@ export function useLotteryEngine(dataManager, renderer3D) { |
|
|
// 请求后端进行抽奖
|
|
|
// 请求后端进行抽奖
|
|
|
try { |
|
|
try { |
|
|
const lotteryData = { |
|
|
const lotteryData = { |
|
|
gradeName: prize.title, |
|
|
|
|
|
prizeName: prize.text, |
|
|
|
|
|
|
|
|
gradeId: prize.gradeId, |
|
|
|
|
|
prizeId: prize.prizeId, |
|
|
perWin: basePerCount, |
|
|
perWin: basePerCount, |
|
|
round: dataManager.state.currentRound |
|
|
|
|
|
|
|
|
remainNum: prize.remainNum |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
console.log('请求后端抽奖,参数:', lotteryData); |
|
|
console.log('请求后端抽奖,参数:', lotteryData); |
|
|
const response = await drawLottery(lotteryData); |
|
|
const response = await drawLottery(lotteryData); |
|
|
console.log('response', response); |
|
|
console.log('response', response); |
|
|
winners.value = response.data; |
|
|
|
|
|
|
|
|
winners.value = response.data.data; |
|
|
console.log('抽奖的winners', winners.value); |
|
|
console.log('抽奖的winners', winners.value); |
|
|
// winners.value = response.data;
|
|
|
// winners.value = response.data;
|
|
|
|
|
|
|
|
|
console.log('后端抽奖返回结果:', response); |
|
|
console.log('后端抽奖返回结果:', response); |
|
|
|
|
|
|
|
|
if (response && response.data && Array.isArray(response.data)) { |
|
|
|
|
|
|
|
|
if (response && response.data.data && Array.isArray(response.data.data)) { |
|
|
// 后端返回中奖用户数据
|
|
|
// 后端返回中奖用户数据
|
|
|
const currentLuckys = response.data.map(item => ({ |
|
|
|
|
|
|
|
|
const currentLuckys = response.data.data.map(item => ({ |
|
|
jwcode: item.jwcode, |
|
|
jwcode: item.jwcode, |
|
|
username: item.username |
|
|
username: item.username |
|
|
})); |
|
|
})); |
|
@ -143,6 +143,14 @@ export function useLotteryEngine(dataManager, renderer3D) { |
|
|
console.log('executeLottery - selectCard completed'); |
|
|
console.log('executeLottery - selectCard completed'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 抽奖完成后更新奖品列表数据
|
|
|
|
|
|
try { |
|
|
|
|
|
await dataManager.updatePrizeList(); |
|
|
|
|
|
console.log('抽奖完成后奖品列表已更新'); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('更新奖品列表失败:', error); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
dataManager.setLotteryStatus(false); |
|
|
dataManager.setLotteryStatus(false); |
|
|
isLotting.value = false; |
|
|
isLotting.value = false; |
|
|
} |
|
|
} |
|
|