Fix:5245 【商城小程序】已过开奖时间,从千县进入抽奖活动应跳转至中奖名单页
This commit is contained in:
@@ -242,6 +242,21 @@ export default {
|
|||||||
]).then(([activityRes, winnersRes]) => {
|
]).then(([activityRes, winnersRes]) => {
|
||||||
if (activityRes && activityRes.success) {
|
if (activityRes && activityRes.success) {
|
||||||
const data = activityRes.data || {}
|
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 = {
|
||||||
...this.activityInfo,
|
...this.activityInfo,
|
||||||
...data,
|
...data,
|
||||||
@@ -473,7 +488,7 @@ export default {
|
|||||||
border: 4rpx solid #fff;
|
border: 4rpx solid #fff;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
padding: 6rpx 30rpx;
|
padding: 6rpx 30rpx;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
|
|||||||
@@ -929,6 +929,7 @@ import { pageListenMixins } from '@/mixins/pageListenMixins'
|
|||||||
import FunctionGuide from '@/components/FunctionGuide'
|
import FunctionGuide from '@/components/FunctionGuide'
|
||||||
import GuideMixins from '@/mixins/GuideMixins'
|
import GuideMixins from '@/mixins/GuideMixins'
|
||||||
import AiEntrance from '@/components/aiChat/entrance'
|
import AiEntrance from '@/components/aiChat/entrance'
|
||||||
|
import { checkDrawTime } from '@/api/lottery'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
imgBox,
|
imgBox,
|
||||||
@@ -1654,7 +1655,13 @@ export default {
|
|||||||
toggleCountyIntro() {
|
toggleCountyIntro() {
|
||||||
this.toggleCountyIntroStatus = !this.toggleCountyIntroStatus
|
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
|
const activityId = Number(this.detail.drawActivityId) || 0
|
||||||
if (!activityId) {
|
if (!activityId) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -1663,8 +1670,17 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let opened = false
|
||||||
|
try {
|
||||||
|
const res = await checkDrawTime(activityId)
|
||||||
|
opened = this.parseCheckTimeResult(res)
|
||||||
|
} catch (e) {
|
||||||
|
opened = false
|
||||||
|
}
|
||||||
uni.navigateTo({
|
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) {
|
showPic(index) {
|
||||||
|
|||||||
Reference in New Issue
Block a user