Commit ebfb6408 authored by 天马流星拳's avatar 天马流星拳

fix: 修复活动时间判断和月份选择逻辑

在HomePage中添加活动时间判断,防止在非活动时间查看分布
在myQradesPage中修正月份列表生成逻辑并初始化selectId
parent 26ff79e4
......@@ -118,6 +118,7 @@ class HomePage extends React.Component<any, any> {
// 查看分布按钮
viewDistribution = (item) => {
console.log("🚀 ~ HomePage ~ item:", item)
if (!store.judgeActTime()) return
// 新增 type 0-月榜 1-总榜
item.type = this.state.rankingTab
ModalCtrl.showModal(Positionpop, { item })
......
......@@ -16,7 +16,7 @@ class Myqradespage extends React.Component {
this.state = {
monthInfo:[], // 月份信息
selectIndex: 0,
selectId: {},
selectId: '',
info:{},
actStartTime: 0, // 活动开始时间戳
actEndTime: 0, //活动结束时间戳
......@@ -67,7 +67,7 @@ class Myqradespage extends React.Component {
// 初始化状态
this.setState({ monthInfo: data.monthInfo }, () => {
// 生成完整月份列表
const monthList = this.generateMonthList(data.actStartTime, data.actEndTime);
const monthList = this.generateMonthList(data.actStartTime, data.currentEndMonthTime);
console.log("🚀 ~ Myqradespage ~ monthList:", monthList);
// 合并月份信息
......@@ -84,7 +84,8 @@ class Myqradespage extends React.Component {
// 更新状态并在回调中执行后续操作
this.setState({
monthInfo: mergedMonthInfo,
selectIndex: targetIndex
selectIndex: targetIndex,
selectId: mergedMonthInfo[targetIndex].monthId
}, () => {
console.log("🚀 ~ Myqradespage ~ monthInfo:", this.state.monthInfo);
// 确保monthInfo数组非空再调用getdrawIndex
......
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