From 363066595e9efd6756ffc0e9149428d7ebe2cab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Tue, 13 Jan 2026 15:48:30 +0800 Subject: [PATCH] =?UTF-8?q?JLBA202505130001=5F=E5=85=B3=E4=BA=8E=E5=90=89?= =?UTF-8?q?=E6=9E=97=E9=93=B6=E8=A1=8C=E6=96=B0=E5=BB=BAAI=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E5=9F=B9=E8=AE=AD=E7=B3=BB=E7=BB=9F=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=5F=E4=BF=AE=E5=A4=8Dsitbug5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/points-and-badge/holiday.vue | 13 ++++++++++- src/composables/useCheckIn.js | 24 +++++++++++++-------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/components/points-and-badge/holiday.vue b/src/components/points-and-badge/holiday.vue index b218e940..594081b9 100644 --- a/src/components/points-and-badge/holiday.vue +++ b/src/components/points-and-badge/holiday.vue @@ -175,6 +175,17 @@ // 退出 const close = (status: boolean): void => { + // 如果是固定积分,就设置一下 + console.log('如果是固定积分,就设置一下', holidayInfo.rewardType); + if(holidayInfo.rewardType === RewardType.FIXED_POINT) { + startLotteryCallback({ + holidayCode: '', + failCb: undefined, + successCb: () => { + console.log('设置成功'); + } + }) + } uni.showTabBar({ success() { popup.value.close(); @@ -193,7 +204,7 @@ ): void => { startLotteryCallback = lotteryCb; // 抽奖的回调 completeCallback = completeCb; // 关闭弹窗的回调 - + console.log('holidayBody', holidayBody); Object.assign(holidayInfo, holidayBody); if (!holidayInfo.rewardFlag || holidayInfo.obtainFlag) { // if (!holidayInfo.rewardFlag) { diff --git a/src/composables/useCheckIn.js b/src/composables/useCheckIn.js index d7a55548..c23c87df 100644 --- a/src/composables/useCheckIn.js +++ b/src/composables/useCheckIn.js @@ -258,16 +258,22 @@ export default function useCheckIn() { successCb = () => {}, failCb = () => {} }) => { - obtainRewardRandom({ - holidayCode - }).then(({body}) => { - console.log('抽取成功回调', body); - // 把缓存中的记录设置为已经抽取积分 + if(holidayCode) { + obtainRewardRandom({ + holidayCode + }).then(({body}) => { + console.log('抽取成功回调', body); + // 把缓存中的记录设置为已经抽取积分 + setLocalSignStatus({ obtainFlag: true}); + successCb?.(body); + }).catch((error) => { + failCb?.(error) + }) + } else { setLocalSignStatus({ obtainFlag: true}); - successCb?.(body); - }).catch((error) => { - failCb?.(error) - }) + successCb?.(); + } + }; /**