Commit 25d95f93 authored by spc's avatar spc

lottery

parent 4f7e7e1a
......@@ -181,12 +181,7 @@ const recentNotices = computed(() => {
if (winningCarousel.value.length > 0) {
notices = winningCarousel.value.slice(0, 20);
} else {
// 如果没有API数据,显示默认公告
notices = [
{ userNickname: '用户152****8839', prizeName: 'XXXXXX' },
{ userNickname: '用户138****5678', prizeName: 'YYYYYY' },
{ userNickname: '用户159****1234', prizeName: 'ZZZZZZ' }
];
}
// 如果只有1条数据,复制成3条以确保轮播效果
......@@ -307,10 +302,10 @@ const loadLotteryInfo = async () => {
// 启动公告轮播(无论是否有API数据)
startNoticeCarousel()
} else {
uni.showToast({
title: response.msg || '获取抽奖信息失败',
icon: 'none'
})
// uni.showToast({
// title: response.msg || '获取抽奖信息失败',
// icon: 'none'
// })
// 即使API失败也启动轮播
startNoticeCarousel()
}
......@@ -396,6 +391,7 @@ const handleDrawClick = async () => {
// 根据接口返回的prizeId找到对应的奖品索引
const prizeIndex = turntablePrizes.value.findIndex(prize => prize.prizeId === response.data.prizeId)
console.warn("prizeIndex", prizeIndex)
if (prizeIndex !== -1) {
// 开始轮流亮起效果
startHighlightAnimation(prizeIndex, response.data.isWin)
......@@ -491,10 +487,10 @@ const handleDrawSucModalClose = () => {
const handleHappyGet = () => {
console.log('点击开心领取')
showDrawSucModal.value = false
uni.showToast({
title: '奖品领取成功',
icon: 'success'
})
// uni.showToast({
// title: '奖品领取成功',
// icon: 'success'
// })
}
// 抽奖失败弹窗关闭处理
......@@ -506,10 +502,10 @@ const handleDrawFailModalClose = () => {
const handleIKnow = () => {
console.log('点击我知道了')
showDrawFailModal.value = false
uni.showToast({
title: '下次再来试试吧',
icon: 'none'
})
// uni.showToast({
// title: '下次再来试试吧',
// icon: 'none'
// })
}
// 生命周期
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment