diff --git a/pkg-video/views/county-lottery.vue b/pkg-video/views/county-lottery.vue index 6772169..8bdb1c3 100644 --- a/pkg-video/views/county-lottery.vue +++ b/pkg-video/views/county-lottery.vue @@ -242,6 +242,21 @@ export default { ]).then(([activityRes, winnersRes]) => { if (activityRes && activityRes.success) { const data = activityRes.data || {} + + // 如果活动已开奖(或已过开奖时间),直接重定向至中奖名单页 + const targetTime = data.drawTime || '' + let isPassed = false + if (targetTime) { + const date = new Date(String(targetTime).replace(/-/g, '/')) + if (!Number.isNaN(date.getTime()) && date.getTime() <= Date.now()) { + isPassed = true + } + } + if (isPassed || Number(data.status) === 2 || Number(data.status) === 3) { + uni.redirectTo({ url: `/pkg-video/views/county-winners?activityId=${this.activityId}` }) + return + } + this.activityInfo = { ...this.activityInfo, ...data, @@ -473,7 +488,7 @@ export default { border: 4rpx solid #fff; border-radius: 40rpx; padding: 6rpx 30rpx; - font-size: 28rpx; + font-size: 24rpx; margin-bottom: 24rpx; &::after { diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue index 3f2e7a0..ce9d4c5 100644 --- a/pkg_product/views/famousQianxianShop.vue +++ b/pkg_product/views/famousQianxianShop.vue @@ -929,6 +929,7 @@ import { pageListenMixins } from '@/mixins/pageListenMixins' import FunctionGuide from '@/components/FunctionGuide' import GuideMixins from '@/mixins/GuideMixins' import AiEntrance from '@/components/aiChat/entrance' +import { checkDrawTime } from '@/api/lottery' export default { components: { imgBox, @@ -1654,7 +1655,13 @@ export default { toggleCountyIntro() { this.toggleCountyIntroStatus = !this.toggleCountyIntroStatus }, - goDrawActivity() { + parseCheckTimeResult(res) { + if (typeof res === 'boolean') return res + if (typeof (res && res.data) === 'boolean') return res.data + if (res && typeof res.success !== 'undefined') return Boolean(res.data) + return false + }, + async goDrawActivity() { const activityId = Number(this.detail.drawActivityId) || 0 if (!activityId) { uni.showToast({ @@ -1663,8 +1670,17 @@ export default { }) return } + let opened = false + try { + const res = await checkDrawTime(activityId) + opened = this.parseCheckTimeResult(res) + } catch (e) { + opened = false + } uni.navigateTo({ - url: `/pkg-video/views/county-lottery?activityId=${activityId}` + url: opened + ? `/pkg-video/views/county-winners?activityId=${activityId}` + : `/pkg-video/views/county-lottery?activityId=${activityId}` }) }, showPic(index) {